From b93464db656fe017fe434b0fc917921ded88a12c Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 00:36:32 +0000 Subject: --- user_guide/libraries/calendar.html | 64 +++++++++++++++----------------- user_guide/libraries/file_uploading.html | 5 ++- 2 files changed, 34 insertions(+), 35 deletions(-) (limited to 'user_guide/libraries') 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

Setting Display Preferences

-

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: +

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:

-$this->load->library('calendar');
-
+ $prefs = array (
               'start_day'    => 'saturday',
               'month_type'   => 'long',
               'day_type'     => 'short'
             );

-$this->calendar->initialize($prefs);
+$this->load->library('calendar', $prefs);

echo $this->calendar->generate();
@@ -166,6 +165,30 @@ regarding preferences below.

+

Showing Next/Previous Month Links

+ +

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:

+ + +$this->load->library('calendar');
+
+$prefs = array (
+               'show_next_prev'  => TRUE,
+               'next_prev_url'   => 'http://www.your-site.com/index.php/calendar/show/'
+             );
+
+echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $prefs);
+ +

You'll notice a few things about the above example:

+ + + +

Creating a Calendar Template

@@ -173,7 +196,7 @@ regarding preferences below.

calendar will be placed within a pair of pseudo-variables as shown here:

-$this->load->library('calendar');

+ $prefs['template'] = '

   {table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}

@@ -206,39 +229,12 @@ $prefs['template'] = '

   {table_close}</table>{/table_close}
';

-$this->calendar->initialize($prefs);
+$this->load->library('calendar', $prefs);

echo $this->calendar->generate();
-

Showing Next/Previous Month Links

- -

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:

- - -$this->load->library('calendar');
-
-$prefs = array (
-               'show_next_prev'  => TRUE,
-               'next_prev_url'   => 'http://www.your-site.com/index.php/calendar/show/'
-             );
-
-$this->calendar->initialize($prefs);
-
-echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
- -

You'll notice a few things about the above example:

- -
    -
  • You must set the "show_next_prev" to TRUE.
  • -
  • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
  • -
  • 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.).
  • -
- - - diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 6a2317da1..1fa93bf17 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -171,7 +171,7 @@ class Upload extends Controller { $config['max_width'] = '1024'; $config['max_height'] = '768'; - $this->upload->initialize($config); + $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) { @@ -230,6 +230,9 @@ $config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';

+$this->load->library('ftp', $config);

+ +// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
$this->upload->initialize($config);

The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

-- cgit v1.2.3-24-g4f1b