Welcome Guest, Not a member yet? Register   Sign In
Calendar Library : My version that adding the previous year & next year link on header and pref as parameter of generate
#1

[eluser]Unknown[/eluser]
Hi all,

Please find in the link hereafter my own modificated version of calendar.php library.
Those modifications allow user to have links for previous & next year, in addition of previous & next month.

This also add the capability to send calendar prefs as 4th parameter of the generate method :
Code:
// Prepare calendar prefs
$calendarPrefs = array (
   'start_day'    => 'monday',
   'month_type'   => 'long',
   'day_type'    => 'short',
   'show_next_prev'  => true,
   'next_prev_month_url' => site_url().'agenda/index',
   'next_prev_year_url' => site_url().'agenda/index'
);

// Finalize data array to be send to view
  $this->data = (object)array(
   'output'  => $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $calendarData, $calendarPrefs),
   'js_files' => array(
       'http://localhost/javascripts/js/jquery-1.8.2.min.js',
       'http://localhost/javascripts/js/jquery-ui-1.8.24.custom.min.js'
       ),
   'css_files' => array('http://localhost/javascripts/css/ui-lightness/jquery-ui-1.8.24.custom.css')
  );

Calendar.php (to replace once located in /system/libraries)

Hope this help....

______
Elgger




Theme © iAndrew 2016 - Forum software by © MyBB