Beispiel #1
0
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
$plugin_info = array('pi_name' => 'Easy iCalendar', 'pi_version' => Easy_ical::PI_VERSION, 'pi_author' => 'Crescendo Multimedia', 'pi_author_url' => 'http://crescendo.net.nz/', 'pi_description' => 'Create valid iCalendars in seconds', 'pi_usage' => Easy_ical::usage());
class Easy_ical
{
    const PI_VERSION = '1.1.1';
    function Easy_ical()
    {
        $this->EE =& get_instance();
    }
    function calendar()
    {
        $out = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n";
        $out .= "PRODID:-//ExpressionEngine Easy iCalendar plugin//NONSGML v" . self::PI_VERSION . "//EN\r\n";
        if ($this->EE->TMPL->fetch_param('timezone') !== FALSE) {
            $out .= "X-WR-TIMEZONE:" . $this->escape($this->EE->TMPL->fetch_param('timezone')) . "\r\n";
        }
        if ($this->EE->TMPL->fetch_param('calname') !== FALSE) {
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
$plugin_info = array('pi_name' => 'Easy iCalendar', 'pi_version' => Easy_ical::VERSION, 'pi_author' => 'Exp:resso', 'pi_author_url' => 'http://exp-resso.com/', 'pi_description' => 'Create valid iCalendars in seconds', 'pi_usage' => Easy_ical::usage());
class Easy_ical
{
    const VERSION = '1.2';
    public function calendar()
    {
        $out = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n";
        $out .= "PRODID:-//ExpressionEngine Easy iCalendar plugin//NONSGML v" . self::VERSION . "//EN\r\n";
        if (ee()->TMPL->fetch_param('timezone') !== FALSE) {
            $out .= "X-WR-TIMEZONE:" . $this->escape(ee()->TMPL->fetch_param('timezone')) . "\r\n";
        }
        if (ee()->TMPL->fetch_param('calname') !== FALSE) {
            $out .= "X-WR-CALNAME:" . $this->escape(ee()->TMPL->fetch_param('calname')) . "\r\n";
        }
        // EE has probably put heaps of useless whitespace between each entry
        $tagdata = trim(ee()->TMPL->tagdata);