addScript("components/com_cpeventcalendar/DC_EventCalendar/utilities.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/button.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/container.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/yahoo.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/event.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/dom.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/calendar.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/element.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/DCEventCalendar.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/intervalcalendar.js"); $document->addScript("components/com_cpeventcalendar/DC_EventCalendar/calendarcolors.js"); $document->addStyleSheet("components/com_cpeventcalendar/DC_EventCalendar/fonts-min.css"); $document->addStyleSheet("components/com_cpeventcalendar/DC_EventCalendar/button.css"); $document->addStyleSheet("components/com_cpeventcalendar/DC_EventCalendar/container.css"); $document->addStyleSheet("components/com_cpeventcalendar/DC_EventCalendar/calendar.css"); $document->addStyleSheet("components/com_cpeventcalendar/DC_EventCalendar/DCEventCalendar.css"); $container = "plg".mt_rand(); $styletext = "#".$container." .yui-calendar td.calcell {width:".(int)$matches[3]."px;height:".(int)$matches[4]."px;}"; $document->addStyleDeclaration($styletext); $document->addScriptDeclaration("var pathCalendarCPE = \"".JURI::base(true)."/components/com_cpeventcalendar/DC_EventCalendar/\";\n". "var pathCalendarCPEJB = \"".JURI::base(true)."/\";\n". "initEventCalendar(\"".$id."\",\"".$container."\",".(int)$matches[5].",2,\"".$matches[2]."\",{},".(int)$matches[3].",".(int)$matches[4].");"); $str = '
'; return $str; } class plgContentEventcalendar extends JPlugin { public function __construct(& $subject, $config) { parent::__construct($subject, $config); $this->loadLanguage(); } /** * Example prepare content method * * Method is called by the view * * @param object The article object. Note $article->text is also available * @param object The article params * @param int The 'page' number */ public function onContentPrepare($context, &$article, &$params, $limitstart) { // define the regular expression for the bot $regex = "#\{eventcalendar\:(\d{1,2})\:(\S{5})\:(\d{1,3})\:(\d{1,3})\:(\d{1,2})\}#s"; $article->text = preg_replace_callback( $regex, 'EventCalendar_replacer', $article->text ); return true; } }