Location: PHPKode > scripts > PHPalm Calendar > phpalm-calendar/doc.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="DC.title" content="Calendar : Documentation" />
<meta name="Author" content="Rémy Salettes" />
<title>Calendar : Documentation</title>
</head>
<body>

<!-- Début du document -->

<div id="main">
  
  <div id="header">
	<h1>Calendar : Documentation</h1>	
	
	<div id="menu">
  	<h2>Fast Access :</h2>
	<ul>
		<li><a href="#Description">Description</a></li>
		<li><a href="#Features">Main features</a></li>
		<li><a href="#Licence">Licence</a></li>
		<li><a href="#Variables">Variables</a></li>
		<li><a href="#Functions">Functions</a></li>
		<li><a href="#Author">Author</a></li>
		<li><a href="#Date">Release Date</a></li>
	</ul>
  </div>

	<h2><a id="Description">Description :</a></h2>
  	<p>
	Calendar is a <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>4 class intended to generates and displays a calendar in valid <acronym title="eXtensible Hyper-Text Markup Language">XHTML 1.1</acronym> as stated by the <acronym title="World Wide Web Consortium"><a href="http://w3.org">W3C</a></acronym>.<br/>
	It also provides many features such as translations in several languages or a "links on days" system ...
	</p>
	<h2><a id="Features">Main features :</a></h2>
	<ul>
		<li>Generates valid <acronym title="eXtensible Hyper-Text Markup Language">XHTML</acronym> according to the <a href="http://validator.w3.org/">W3C Validator</a>.</li>
		<li>Provides 5 translations "out of the box" : English, German, Spanish, French and Portuguese. Making your owns is easy as pie.</li>
		<li>Lets you choose to show either the current month calendar or the calendar of the month and the year of your choice. Covers about 136 years (limitation due to UNIX timestamp).</li>
		<li>Allows you to specify links on specific days, with the url pattern of your choice, which can be dynamic.</li>
		<li>Lets you choose whether the first day of the calendar must be Monday or Sunday.</li>
		<li>Lets you change the current month with a link system that adapts to your website by checking the variables you passed by url.</li>
	</ul>	
	<h2><a id="Licence">Licence :</a></h2>
	<p>
	This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
	</p>	
  </div>
  
  <div id="variables">
  <h2><a id="Variables">Variables : </a></h2>
  <ul>
  <li><a href="#CFG">$calendar::CFG</a></li>
  <li><a href="#buffer">$calendar::buffer</a></li>
  <li><a href="#url">$calendar::url</a></li>
  <li><a href="#LINKS">$calendar::LINKS</a></li>
  <li><a href="#monday_1st">$calendar::monday_1st</a></li>
  <li><a href="#jour_1er_du_mois">$calendar::jour_1er_du_mois</a></li>
  <li><a href="#jour_1er_du_mois_chiffre">$calendar::jour_1er_du_mois_chiffre</a></li>
  <li><a href="#cases_vides_debut">$calendar::cases_vides_debut</a></li>
  <li><a href="#cases_vides_fin">$calendar::cases_vides_fin</a></li>
  <li><a href="#nombre_jour_du_mois">$calendar::nombre_jour_du_mois</a></li>
  <li><a href="#use_links">$calendar::use_links</a></li>  
  <li><a href="#allow_change">$calendar::allow_change</a></li>
  <li><a href="#prev">$calendar::prev</a></li>
  <li><a href="#next">$calendar::next</a></li>
  </ul>
  
  <h3><a id="CFG">$calendar::CFG</a></h3>
  <ul>
  <li><strong>Type :</strong> Array.</li>
  <li><strong>Role :</strong> Contains three essential informations : the month, the year and the language choosen.</li>
  </ul>
  
  <h3><a id="buffer">$calendar::buffer</a></h3>
  <ul>
  <li><strong>Type :</strong> Varchar.</li>
  <li><strong>Role :</strong> Contains all the generated <acronym title="eXtensible Hyper-Text Markup Language">XHTML</acronym></li>
  </ul>
  
  <h3><a id="url">$calendar::url</a></h3>
  <ul>
  <li><strong>Type :</strong> String.</li>
  <li><strong>Role :</strong> Contains the url pattern, specified by the user.</li>
  </ul>
  
  <h3><a id="LINKS">$calendar::LINKS</a></h3>
  <ul>
  <li><strong>Type :</strong> Array.</li>
  <li><strong>Role :</strong> Contains the days that have to be linked.</li>
  </ul>
  
  <h3><a id="monday_1st">$calendar::monday_1st</a></h3>
  <ul>
  <li><strong>Type :</strong> Char.</li>
  <li><strong>Role :</strong> Have to be set to 'y', 'yes', 'o', 'oui' or '1' in order to have monday as the first day on the calendar.</li>
  </ul>
  
  <h3><a id="jour_1er_du_mois">$calendar::jour_1er_du_mois</a></h3>
  <ul>
  <li><strong>Type :</strong> Varchar.</li>
  <li><strong>Role :</strong> Name of the first day of the month</li>
  </ul>
  
  <h3><a id="jour_1er_du_mois_chiffre">$calendar::jour_1er_du_mois_chiffre</a></h3>
  <ul>
  <li><strong>Type :</strong> Int.</li>
  <li><strong>Role :</strong> Number of the first day of the month</li>
  </ul>
  
  <h3><a id="cases_vides_debut">$calendar::cases_vides_debut</a></h3>
  <ul>
  <li><strong>Type :</strong> Int.</li>
  <li><strong>Role :</strong> Number of empty cells at the beginning of the calendar.</li>
  </ul>
  
  <h3><a id="cases_vides_fin">$calendar::cases_vides_fin</a></h3>
  <ul>
  <li><strong>Type :</strong> Int.</li>
  <li><strong>Role :</strong> Number of empty cells at the end of the calendar.</li>
  </ul>
  
  <h3><a id="nombre_jour_du_mois">$calendar::nombre_jour_du_mois</a></h3>
  <ul>
  <li><strong>Type :</strong> Int.</li>
  <li><strong>Role :</strong> Number of days during the month.</li>
  </ul>
  
  <h3><a id="use_links">$calendar::use_links</a></h3>
  <ul>
  <li><strong>Type :</strong> Int.</li>
  <li><strong>Role :</strong> Set to '1' if function calendar::links() is used ; unset otherwise.</li>
  </ul> 
  
  <h3><a id="allow_change">$calendar::allow_change</a></h3>
  <ul>
  <li><strong>Type :</strong> Int.</li>
  <li><strong>Role :</strong> Set to '0' if you don't want to let the visitors change the month of the calendar. Set to '1' if you want so. Note that default is '1'.</li>
  </ul>
  
  <h3><a id="prev">$calendar::prev</a></h3>
  <ul>
  <li><strong>Type :</strong> String.</li>
  <li><strong>Role :</strong> String used to show where to click to get the previous month. Default is '&amp;lt;'.</li>
  </ul>  
  
  <h3><a id="next">$calendar::next</a></h3>
  <ul>
  <li><strong>Type :</strong> String.</li>
  <li><strong>Role :</strong> String used to show where to click to get the next month. Default is '&amp;gt;'.</li>
  </ul>  
   
  </div>
  
  <div id="functions">
  <h2><a id="Functions">Functions :</a></h2>
  <ul>
  <li><a href="#calendar_">calendar::calendar([string, string, char])</a></li>
  <li><a href="#links_">calendar::links(string str, string str)</a></li>
  <li><a href="#generate_">calendar::generate()</a></li>
  <li><a href="#draw_">calendar::draw()</a></li>
  </ul>
  
  <h3><a id="calendar_">calendar::calendar([string, string, char])</a></h3>
  <ul>
  <li><strong>Role :</strong> Constructor : initialize the class, set most of the settings.</li>
  <li><strong>First parameter :</strong> <i>Optionnal :</i> set it to the wanted month (in numbers, DD) ; let it blank or set it to auto if you want the current month.</li> 
  <li><strong>Second parameter :</strong> <i>Optionnal :</i> set it to the wanted year (in numbers, YYYY) ; let it blank or set it to auto if you want the current year.</li>
  <li>
  <strong>Third parameter :</strong> <i>Optionnal :</i> specify here the expected translation. <br/>
  Default translations codes : <i>en</i> : English, <i>de</i> : German, <i>es</i> : Spanish, <i>fr</i> : French, <i>pt</i> : Portuguese. <br/>
  Note that you can make your own by creating a new calendar.<i>xx</i>.php file. Have a look at 5 provided out of the box, it will be easy then to understand how to.  
  </li>
  </ul> 
  
  <h3><a id="links_">calendar::links(string str, string str)</a></h3>
  <ul>
  <li><strong>Role :</strong> <i>Optionnal</i> : Allows you to put links to specified days.</li>
  <li><strong>First parameter :</strong> String composed of numbers separated by ':' ; the numbers are expected to be the days you want to link. <i>(ex: '03:16:25:31')</i></li> 
  <li>
  <strong>Second parameter :</strong> Pattern of the links url. You can specify either static pattern or dynamic pattern. <br/>
  A static pattern consists in a simple string <br/> <i>(ex: 'foo.php')</i><br/>
  A dynamic pattern consists in a string with special elements that change according to the setting of the calendar. There are 3 special elements : <br/>
  {D} : int, number of the day linked in the calendar. <br/>
  {M} : int, month of the calendar. <br/>
  {Y} : int, year of the calendar. <br/>
  This can be very useful to interact with the users, passing variables through the url thanks to these elements. <br/>
  <i>(ex: 'foo.php?day={D}&amp;month={M}&amp;year={Y}')</i>
  </li>
  </ul>
 
  <h3><a id="generate_">calendar::generate()</a></h3>
  <ul>
  <li><strong>Role :</strong> Generate the XHTML code.</li>
  <li><strong>No parameter</strong></li>   
  </ul> 

  <h3><a id="draw_">calendar::draw()</a></h3>
  <ul>
  <li><strong>Role :</strong> Display the calendar.</li>
  <li><strong>No parameter</strong></li>   
  </ul> 
     
  </div>
  
  <div id="foot">
	<h2><a id="Author">Author :</a></h2>
	<p>
	Rémy Salettes &lt; <a href="mailto:remysa {at} gmail {dot} com">remysa {at} gmail {dot} com</a> &gt; &lt; <a href="http://remsa.free.fr">http://remsa.free.fr</a> &gt;
	</p>	
	<h2><a id="Date">Release Date :</a></h2>
	February 2005
  </div>

  <p>
  <img src="valid-xhtml11.png" alt="Valid XHTML 1.1!" height="31" width="88" />
  </p>	
  
</div>

<!-- fin du document -->
</body>
</html>
Return current item: PHPalm Calendar