public function getInput()
 {
     $document =& JFactory::getDocument();
     $document->addScript(JURI::base() . 'components/com_gcalendar/libraries/jscolor/jscolor.js');
     $buffer = "<input type=\"text\" name=\"" . $this->name . "\" id=\"" . $this->id . "\" readonly=\"readonly\" class=\"inputbox\" \n";
     $buffer .= "size=\"100%\" value=\"" . $this->value . "\" style=\"background-color: " . GCalendarUtil::getFadedColor($this->value) . "\" />\n";
     $buffer .= "<br CLEAR=\"both\"/><label id=\"jform_colors-lbl\" title=\"\" for=\"jform_color\"></label><table><tbody>\n";
     for ($i = 0; $i < count($this->googleColors); $i++) {
         if ($i % 7 == 0) {
             $buffer .= "<tr>\n";
         }
         $c = $this->googleColors[$i];
         $cFaded = GCalendarUtil::getFadedColor($c);
         $buffer .= "<td onmouseover=\"this.style.cursor='pointer'\" onclick=\"document.getElementById('" . $this->id . "').style.backgroundColor = '" . $cFaded . "';document.getElementById('" . $this->id . "').value = '" . $c . "';\" style=\"background-color: " . $cFaded . ";width: 20px;\"></td><td>" . $c . "</td>\n";
         if ($i % 7 == 6) {
             $buffer .= "</tr>\n";
         }
     }
     $buffer .= "</tbody></table>\n";
     return $buffer;
 }
Beispiel #2
0
				</td>
				<td class="nowrap has-context">
					<a href="<?php 
    echo JRoute::_('index.php?option=com_gcalendar&task=gcalendar.edit&id=' . $item->id);
    ?>
" title="<?php 
    echo JText::_('JACTION_EDIT');
    ?>
">
						<?php 
    echo $this->escape($item->name);
    ?>
					</a>
				</td>
				<td class="nowrap has-context"><div style="background-color: <?php 
    echo GCalendarUtil::getFadedColor($item->color);
    ?>
;width:40px;height:20px"></div></td>
				<td class="nowrap has-context">
					<?php 
    echo urldecode($item->calendar_id);
    ?>
				</td>
				<td class="nowrap has-context">
					<?php 
    if (!empty($item->magic_cookie)) {
        echo JText::_('COM_GCALENDAR_FIELD_MAGIC_COOKIE_LABEL');
    } else {
        if (!empty($item->username)) {
            echo JText::_('COM_GCALENDAR_VIEW_GCALENDARS_COLUMN_AUTHENTICATION_USERNAME');
        } else {
Beispiel #3
0
$calCode .= "var eventResizeCustom = function(event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view){};\n";
$calCode .= "// ]]>\n";
$document->addScriptDeclaration($calCode);
echo JHTML::_('content.prepare', $params->get('textbefore'));
if ($params->get('show_selection', 1) == 1 || $params->get('show_selection', 1) == 3) {
    $document->addScript(JURI::base() . 'components/com_gcalendar/views/gcalendar/tmpl/gcalendar.js');
    $calendar_list = '<div id="gc_gcalendar_view_list"><table class="gcalendar-table">';
    foreach ($allCalendars as $calendar) {
        $value = html_entity_decode(JRoute::_('index.php?option=com_gcalendar&view=jsonfeed&format=raw&gcid=' . $calendar->id));
        $checked = '';
        if (empty($calendarids) || in_array($calendar->id, $calendarids)) {
            $checked = 'checked="checked"';
        }
        $calendar_list .= "<tr>\n";
        $calendar_list .= "<td><input type=\"checkbox\" name=\"" . $calendar->calendar_id . "\" value=\"" . $value . "\" " . $checked . " onclick=\"updateGCalendarFrame(this)\"/></td>\n";
        $calendar_list .= "<td><font color=\"" . GCalendarUtil::getFadedColor($calendar->color) . "\">" . $calendar->name . "</font></td></tr>\n";
    }
    $calendar_list .= "</table></div>\n";
    echo $calendar_list;
    echo "<div align=\"center\" style=\"text-align:center\">\n";
    $image = JURI::base() . 'media/com_gcalendar/images/down.png';
    if ($params->get('show_selection', 1) == 3) {
        $image = JURI::base() . 'media/com_gcalendar/images/up.png';
    }
    echo "<img id=\"gc_gcalendar_view_toggle_status\" name=\"gc_gcalendar_view_toggle_status\" src=\"" . $image . "\" alt=\"" . JText::_('COM_GCALENDAR_GCALENDAR_VIEW_CALENDAR_LIST') . "\" title=\"" . JText::_('COM_GCALENDAR_GCALENDAR_VIEW_CALENDAR_LIST') . "\"/>\n";
    echo "</div>\n";
}
echo "<div id='gcalendar_component_loading' style=\"text-align: center;\"><img src=\"" . JURI::base() . "media/com_gcalendar/images/ajax-loader.gif\"  alt=\"loader\" /></div>";
echo "<div id='gcalendar_component'></div><div id='gcalendar_component_popup' style=\"visibility:hidden\" ></div>";
echo JHTML::_('content.prepare', $params->get('textafter'));
$dispatcher = JDispatcher::getInstance();
$document->addScript(JURI::base() . 'components/com_gcalendar/libraries/jquery/ext/jquery.qtip-1.0.0.min.js');
$document->addStyleDeclaration("#ui-datepicker-div { z-index: 15; }");
$theme = $params->get('theme', '');
if (JRequest::getVar('theme', null) != null) {
    $theme = JRequest::getVar('theme', null);
}
if (!empty($theme)) {
    $document->addStyleSheet(JURI::base() . 'components/com_gcalendar/libraries/jquery/themes/' . $theme . '/jquery-ui-1.7.3.custom.css');
} else {
    $document->addStyleSheet(JURI::base() . 'components/com_gcalendar/libraries/jquery/themes/ui-lightness/jquery-ui-1.7.3.custom.css');
}
$calsSources = "\t\teventSources: [\n";
foreach ($this->calendars as $calendar) {
    $cssClass = "gcal-event_gccal_" . $calendar->id;
    $calsSources .= "\t\t\t'" . JRoute::_('index.php?option=com_gcalendar&view=jsonfeed&format=raw&gcid=' . $calendar->id) . "',\n";
    $color = GCalendarUtil::getFadedColor($calendar->color);
    $document->addStyleDeclaration("." . $cssClass . ",.fc-agenda " . $cssClass . " .fc-event-time, ." . $cssClass . " a, ." . $cssClass . " span{background-color: " . $color . " !important; border-color: #" . $calendar->color . "; color: white;}");
}
$calsSources = trim($calsSources, ",\n");
$calsSources .= "\t\t],\n";
$daysLong = "[";
$daysShort = "[";
$daysMin = "[";
$monthsLong = "[";
$monthsShort = "[";
for ($i = 0; $i < 7; $i++) {
    $daysLong .= "'" . GCalendarUtil::dayToString($i, false) . "'";
    $daysShort .= "'" . GCalendarUtil::dayToString($i, true) . "'";
    $daysMin .= "'" . substr(GCalendarUtil::dayToString($i, true), 0, 2) . "'";
    if ($i < 6) {
        $daysLong .= ",";
$event_display = $params->get('output', '');
$dateformat = $params->get('date_format', '%d.%m.%Y');
$timeformat = $params->get('time_format', '%H:%M');
echo $params->get('text_before');
if (!empty($gcalendar_data)) {
    if ($params->get('images', 'no') != 'no') {
        echo '<p style="clear: both;"/>';
    }
    foreach ($gcalendar_data as $item) {
        // APRIL 2010 MOD - CALENDAR IMAGES by Tyson Moore
        if ($params->get('images', 'no') != 'no') {
            $tmp = JFactory::getDate($item->get_start_date());
            $month_text = strtoupper(GCalendarUtil::monthToString($tmp->toFormat('%m'), true));
            $day = $tmp->toFormat('%d');
            $feed = $item->get_feed();
            $colorImageBackground = $params->get('images', 'yes') == 'custom' ? '#' . $params->get('calimage_background') : GCalendarUtil::getFadedColor($feed->get('gccolor'), 80);
            $colorMonth = $params->get('images', 'yes') == 'custom' ? $params->get('calimage_month') : 'FFFFFF';
            $colorDay = $params->get('images', 'yes') == 'custom' ? $params->get('calimage_day') : $feed->get('gccolor');
            echo '<div class="gc_up_mod_img">';
            echo '<div class="gc_up_mod_month_background" style="background-color: ' . $colorImageBackground . ';"></div>';
            echo '<div class="gc_up_mod_month_text" style="color: #' . $colorMonth . ';">' . $month_text . '</div>';
            echo '<div class="gc_up_mod_day" style="color: #' . $colorDay . ';">' . $day . '</div>';
            echo '</div>';
        }
        //END MOD
        echo GCalendarUtil::renderEvent($item, $event_display, $dateformat, $timeformat);
        if ($params->get('images', 'no') != 'no') {
            echo '<p style="clear: both;"/>';
        }
    }
}
Beispiel #6
0
    echo $row->id;
    ?>
</td>
		<td><?php 
    echo $checked;
    ?>
</td>
		<td><a href="<?php 
    echo $link;
    ?>
"><?php 
    echo $row->name;
    ?>
</a></td>
		<td width="40px"><div style="background-color: <?php 
    echo GCalendarUtil::getFadedColor($row->color);
    ?>
;width: 100%;height: 100%;"/></td>
		<td>
		<table>
			<tr>
				<td><b><?php 
    echo JText::_('Calendar ID');
    ?>
:</b></td>
				<td><?php 
    echo $row->calendar_id;
    ?>
</td>
			</tr>
			<tr>
Beispiel #7
0
			size="100%" value="<?php 
echo $calendar->color;
?>
" style="background-color: <?php 
echo GCalendarUtil::getFadedColor($calendar->color);
?>
;" />
		<table>
			<tbody>
			<?php 
for ($i = 0; $i < count($googleColors); $i++) {
    if ($i % 7 == 0) {
        echo "<tr>\n";
    }
    $c = $googleColors[$i];
    $cFaded = GCalendarUtil::getFadedColor($c);
    echo "<td onmouseover=\"this.style.cursor='pointer'\" onclick=\"document.getElementById('color').style.backgroundColor = '" . $cFaded . "';document.getElementById('color').value = '" . $c . "';\" style=\"background-color: " . $cFaded . ";width: 20px;\"/><td>" . $c . "</td>\n";
    if ($i % 7 == 6) {
        echo "</tr>\n";
    }
}
?>
			</tbody>
		</table>
		</td>
	</tr>
</table>
</fieldset>
</div>
<div class="clr"></div>
 function display()
 {
     $calculatedDate = $this->calculateDate();
     $dateObject = getdate($calculatedDate);
     $this->month = (int) $dateObject["mon"];
     $this->year = (int) $dateObject["year"];
     $this->day = (int) $dateObject["mday"];
     $this->view = JRequest::getVar('gcalendarview', $this->getDefaultView());
     if ($this->getForceView() != null) {
         $this->view = $this->getForceView();
     }
     $userAgent = "unk";
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $uaRaw = strtolower($_SERVER['HTTP_USER_AGENT']);
         if (strpos($uaRaw, "opera") !== false) {
             $userAgent = "opera";
         } elseif (strpos($uaRaw, "msie") !== false) {
             $userAgent = "ie";
         } else {
             $userAgent = "other";
         }
     }
     switch ($this->view) {
         case "month":
             $start = mktime(0, 0, 0, $this->month, 1, $this->year);
             $end = strtotime("+1 month", $start);
             break;
         case "day":
             $start = mktime(0, 0, 0, $this->month, $this->day, $this->year);
             $end = strtotime("+1 day", $start);
             break;
         case "week":
             $start = $this->getFirstDayOfWeek($this->year, $this->month, $this->day, $this->getWeekStart());
             $end = strtotime("+1 week +1 day", $start);
     }
     $this->feeds = $this->getGoogleCalendarFeeds($start, $end);
     $cal = new CalendarRenderer($this);
     $document =& JFactory::getDocument();
     $document->addScript('administrator/components/com_gcalendar/libraries/nifty/nifty.js');
     $document->addStyleSheet('administrator/components/com_gcalendar/libraries/nifty/niftyCorners.css');
     $document->addStyleSheet('administrator/components/com_gcalendar/libraries/rss-calendar/gcalendar.css');
     if ($userAgent == "ie") {
         $document->addStyleSheet('administrator/components/com_gcalendar/libraries/rss-calendar/gcalendar-ie6.css');
     }
     $feeds = $this->getFeeds();
     if (!empty($feeds)) {
         $calCode = "window.addEvent(\"domready\", function(){\n";
         foreach ($feeds as $feed) {
             $calCode .= "Nifty(\"div.gccal_" . $feed->get('gcid') . "\",\"small\");\n";
             $document->addStyleDeclaration("div.gccal_" . $feed->get('gcid') . "{padding: 1px;margin:0 auto;background:" . GCalendarUtil::getFadedColor($feed->get('gccolor')) . "}");
         }
         $calCode .= "});";
         $document->addScriptDeclaration($calCode);
     }
     echo "<div class=\"gcalendar" . $this->id . "\">\n";
     if ($this->showSelectionList) {
         $this->printCalendarSelectionList();
     }
     $this->printToolBar();
     $cal->printCal();
     echo "</div>\n";
 }