| Current Path : /proc/thread-self/root/proc/thread-self/root/proc/self/root/proc/2897192/cwd/ |
| Current File : //proc/thread-self/root/proc/thread-self/root/proc/self/root/proc/2897192/cwd/calendar.php.tar |
home/digilove/public_html/110/plugins/fields/calendar/tmpl/calendar.php 0000644 00000001044 15241232303 0022031 0 ustar 00 <?php
/**
* @package Joomla.Plugin
* @subpackage Fields.Calendar
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$value = $field->value;
if ($value == '')
{
return;
}
if (is_array($value))
{
$value = implode(', ', $value);
}
$formatString = $field->fieldparams->get('showtime', 0) ? 'DATE_FORMAT_LC5' : 'DATE_FORMAT_LC4';
echo htmlentities(JHtml::_('date', $value, JText::_($formatString)));
home/digilove/public_html/libraries/joomla/google/data/calendar.php 0000644 00000036730 15241346476 0021531 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage Google
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Registry\Registry;
/**
* Google Calendar data class for the Joomla Platform.
*
* @since 3.1.4
* @deprecated 4.0 Use the `joomla/google` package via Composer instead
*/
class JGoogleDataCalendar extends JGoogleData
{
/**
* Constructor.
*
* @param Registry $options Google options object
* @param JGoogleAuth $auth Google data http client object
*
* @since 3.1.4
*/
public function __construct(Registry $options = null, JGoogleAuth $auth = null)
{
parent::__construct($options, $auth);
if (isset($this->auth) && !$this->auth->getOption('scope'))
{
$this->auth->setOption('scope', 'https://www.googleapis.com/auth/calendar');
}
}
/**
* Method to remove a calendar from a user's calendar list
*
* @param string $calendarID ID of calendar to delete
*
* @return boolean Success or failure
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function removeCalendar($calendarID)
{
if ($this->isAuthenticated())
{
$jdata = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendarList/' . urlencode($calendarID), null, null, 'delete');
if ($jdata->body != '')
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
return true;
}
else
{
return false;
}
}
/**
* Method to get a calendar's settings from Google
*
* @param string $calendarID ID of calendar to get.
*
* @return mixed Data from Google
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function getCalendar($calendarID)
{
if ($this->isAuthenticated())
{
$jdata = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendarList/' . urlencode($calendarID));
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to add a calendar to a user's Google Calendar list
*
* @param string $calendarID New calendar ID
* @param array $options New calendar settings
*
* @return mixed Data from Google
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function addCalendar($calendarID, $options = array())
{
if ($this->isAuthenticated())
{
$options['id'] = $calendarID;
$url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList';
$jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'post');
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to retrieve calendar list from Google
*
* @param array $options Search settings
* @param int $maxpages Maximum number of pages of calendars to return
*
* @return mixed Data from Google
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function listCalendars($options = array(), $maxpages = 1)
{
if ($this->isAuthenticated())
{
$next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null;
unset($options['nextPageToken']);
$url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList?' . http_build_query($options);
return $this->listGetData($url, $maxpages, $next);
}
else
{
return false;
}
}
/**
* Method to edit a Google Calendar's settings
*
* @param string $calendarID Calendar ID
* @param array $options Calendar settings
*
* @return mixed Data from Google
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function editCalendarSettings($calendarID, $options)
{
if ($this->isAuthenticated())
{
$url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList/' . urlencode($calendarID);
$jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'put');
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to clear a Google Calendar
*
* @param string $calendarID ID of calendar to clear
*
* @return boolean Success or failure
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function clearCalendar($calendarID)
{
if ($this->isAuthenticated())
{
$data = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/clear', null, null, 'post');
if ($data->body != '')
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`.");
}
return true;
}
else
{
return false;
}
}
/**
* Method to delete a calendar from Google
*
* @param string $calendarID ID of calendar to delete.
*
* @return boolean Success or failure
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function deleteCalendar($calendarID)
{
if ($this->isAuthenticated())
{
$data = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID), null, null, 'delete');
if ($data->body != '')
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`.");
}
return true;
}
else
{
return false;
}
}
/**
* Method to create a Google Calendar
*
* @param string $title New calendar title
* @param array $options New calendar settings
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function createCalendar($title, $options = array())
{
if ($this->isAuthenticated())
{
$options['summary'] = $title;
$url = 'https://www.googleapis.com/calendar/v3/calendars';
$jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'post');
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to edit a Google Calendar
*
* @param string $calendarID Calendar ID.
* @param array $options Calendar settings.
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function editCalendar($calendarID, $options)
{
if ($this->isAuthenticated())
{
$url = 'https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID);
$jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'put');
$data = json_decode($jdata->body, true);
if ($data && array_key_exists('items', $data))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to delete an event from a Google Calendar
*
* @param string $calendarID ID of calendar to delete from
* @param string $eventID ID of event to delete.
*
* @return boolean Success or failure.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function deleteEvent($calendarID, $eventID)
{
if ($this->isAuthenticated())
{
$url = 'https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/events/' . urlencode($eventID);
$data = $this->query($url, null, null, 'delete');
if ($data->body != '')
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`.");
}
return true;
}
else
{
return false;
}
}
/**
* Method to get an event from a Google Calendar
*
* @param string $calendarID ID of calendar
* @param string $eventID ID of event to get
* @param array $options Options to send to Google
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function getEvent($calendarID, $eventID, $options = array())
{
if ($this->isAuthenticated())
{
$url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList/';
$url .= urlencode($calendarID) . '/events/' . urlencode($eventID) . '?' . http_build_query($options);
$jdata = $this->query($url);
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to create a Google Calendar event
*
* @param string $calendarID ID of calendar
* @param mixed $start Event start time
* @param mixed $end Event end time
* @param array $options New event settings
* @param mixed $timezone Timezone for event
* @param boolean $allday Treat event as an all-day event
* @param boolean $notify Notify participants
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws InvalidArgumentException
* @throws UnexpectedValueException
*/
public function createEvent($calendarID, $start, $end = false, $options = array(), $timezone = false, $allday = false, $notify = false)
{
if ($this->isAuthenticated())
{
if (!$start)
{
$startobj = new DateTime;
}
elseif (is_int($start))
{
$startobj = new DateTime;
$startobj->setTimestamp($start);
}
elseif (is_string($start))
{
$startobj = new DateTime($start);
}
elseif (is_a($start, 'DateTime'))
{
$startobj = $start;
}
else
{
throw new InvalidArgumentException('Invalid event start time.');
}
if (!$end)
{
$endobj = $startobj;
}
elseif (is_int($end))
{
$endobj = new DateTime;
$endobj->setTimestamp($end);
}
elseif (is_string($end))
{
$endobj = new DateTime($end);
}
elseif (is_a($end, 'DateTime'))
{
$endobj = $end;
}
else
{
throw new InvalidArgumentException('Invalid event end time.');
}
if ($allday)
{
$options['start'] = array('date' => $startobj->format('Y-m-d'));
$options['end'] = array('date' => $endobj->format('Y-m-d'));
}
else
{
$options['start'] = array('dateTime' => $startobj->format(DateTime::RFC3339));
$options['end'] = array('dateTime' => $endobj->format(DateTime::RFC3339));
}
if ($timezone === true)
{
$options['start']['timeZone'] = $startobj->getTimezone()->getName();
$options['end']['timeZone'] = $endobj->getTimezone()->getName();
}
elseif (is_a($timezone, 'DateTimeZone'))
{
$options['start']['timeZone'] = $timezone->getName();
$options['end']['timeZone'] = $timezone->getName();
}
elseif (is_string($timezone))
{
$options['start']['timeZone'] = $timezone;
$options['end']['timeZone'] = $timezone;
}
$url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($calendarID) . '/events' . ($notify ? '?sendNotifications=true' : '');
$jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'post');
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to retrieve a list of events on a Google calendar
*
* @param string $calendarID Calendar ID
* @param string $eventID ID of the event to change
* @param array $options Search settings
* @param int $maxpages Minimum number of events to retrieve (more may be retrieved depending on page size)
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function listRecurrences($calendarID, $eventID, $options = array(), $maxpages = 1)
{
if ($this->isAuthenticated())
{
$next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null;
unset($options['nextPageToken']);
$url = 'https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/events/' . urlencode($eventID) . '/instances';
$url .= '?' . http_build_query($options);
return $this->listGetData($url, $maxpages, $next);
}
else
{
return false;
}
}
/**
* Method to retrieve a list of events on a Google calendar
*
* @param string $calendarID Calendar ID
* @param array $options Calendar settings
* @param int $maxpages Cycle through pages of data to generate a complete list
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function listEvents($calendarID, $options = array(), $maxpages = 1)
{
if ($this->isAuthenticated())
{
$next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null;
unset($options['nextPageToken']);
$url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($calendarID) . '/events?' . http_build_query($options);
return $this->listGetData($url, $maxpages, $next);
}
else
{
return false;
}
}
/**
* Method to move an event from one calendar to another
*
* @param string $calendarID Calendar ID
* @param string $eventID ID of the event to change
* @param string $destID Calendar ID
* @param boolean $notify Notify participants of changes
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function moveEvent($calendarID, $eventID, $destID, $notify = false)
{
if ($this->isAuthenticated())
{
$url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($calendarID) . '/events/' . urlencode($eventID) . '/move';
$url .= '?destination=' . $destID . ($notify ? '&sendNotifications=true' : '');
$jdata = $this->query($url, null, null, 'post');
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
/**
* Method to edit a Google Calendar event
*
* @param string $calendarID Calendar ID
* @param string $eventID ID of the event to change
* @param array $options Event settings
* @param boolean $notify Notify participants of changes
*
* @return mixed Data from Google.
*
* @since 3.1.4
* @throws UnexpectedValueException
*/
public function editEvent($calendarID, $eventID, $options, $notify = false)
{
if ($this->isAuthenticated())
{
$url = 'https://www.googleapis.com/calendar/v3/calendars/';
$url .= urlencode($calendarID) . '/events/' . urlencode($eventID) . ($notify ? '?sendNotifications=true' : '');
$jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'put');
if ($data = json_decode($jdata->body, true))
{
return $data;
}
else
{
throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
}
}
else
{
return false;
}
}
}
home/digilove/public_html/110/libraries/fof/form/field/calendar.php 0000644 00000012352 15242362312 0021142 0 ustar 00 <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('calendar');
/**
* Form Field class for the FOF framework
* Supports a calendar / date field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldCalendar extends JFormFieldCalendar implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
// ATTENTION: Redirected getInput() to getStatic()
case 'input':
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
return $this->getCalendar('static');
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
return $this->getCalendar('repeatable');
}
/**
* Method to get the calendar input markup.
*
* @param string $display The display to render ('static' or 'repeatable')
*
* @return string The field input markup.
*
* @since 2.1.rc4
*/
protected function getCalendar($display)
{
// Initialize some field attributes.
$format = $this->element['format'] ? (string) $this->element['format'] : '%Y-%m-%d';
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$default = $this->element['default'] ? (string) $this->element['default'] : '';
// PHP date doesn't use percentages (%) for the format, but the calendar Javascript
// DOES use it (@see: calendar-uncompressed.js). Therefore we have to convert it.
$formatJS = $format;
$formatPHP = str_replace(array('%', 'H:M:S', 'B'), array('', 'H:i:s', 'F'), $formatJS);
// Check for empty date values
if (empty($this->value) || $this->value == FOFPlatform::getInstance()->getDbo()->getNullDate() || $this->value == '0000-00-00')
{
$this->value = $default;
}
// Get some system objects.
$config = FOFPlatform::getInstance()->getConfig();
$user = JFactory::getUser();
// Format date if exists
if (!empty($this->value))
{
$date = FOFPlatform::getInstance()->getDate($this->value, 'UTC');
// If a known filter is given use it.
switch (strtoupper((string) $this->element['filter']))
{
case 'SERVER_UTC':
// Convert a date to UTC based on the server timezone.
if ((int) $this->value)
{
// Get a date object based on the correct timezone.
$date->setTimezone(new DateTimeZone($config->get('offset')));
}
break;
case 'USER_UTC':
// Convert a date to UTC based on the user timezone.
if ((int) $this->value)
{
// Get a date object based on the correct timezone.
$date->setTimezone($user->getTimezone());
}
break;
default:
break;
}
// Transform the date string.
$this->value = $date->format($formatPHP, true, false);
}
if ($display == 'static')
{
// Build the attributes array.
$attributes = array();
if ($this->element['size'])
{
$attributes['size'] = (int) $this->element['size'];
}
if ($this->element['maxlength'])
{
$attributes['maxlength'] = (int) $this->element['maxlength'];
}
if ($this->element['class'])
{
$attributes['class'] = (string) $this->element['class'];
}
if ((string) $this->element['readonly'] == 'true')
{
$attributes['readonly'] = 'readonly';
}
if ((string) $this->element['disabled'] == 'true')
{
$attributes['disabled'] = 'disabled';
}
if ($this->element['onchange'])
{
$attributes['onchange'] = (string) $this->element['onchange'];
}
if ($this->required)
{
$attributes['required'] = 'required';
$attributes['aria-required'] = 'true';
}
return JHtml::_('calendar', $this->value, $this->name, $this->id, $formatJS, $attributes);
}
else
{
return '<span class="' . $this->id . ' ' . $class . '">' .
htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
}
home/digilove/public_html/110/plugins/fields/calendar/calendar.php 0000644 00000002361 15243327123 0021067 0 ustar 00 <?php
/**
* @package Joomla.Plugin
* @subpackage Fields.Calendar
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::import('components.com_fields.libraries.fieldsplugin', JPATH_ADMINISTRATOR);
/**
* Fields Calendar Plugin
*
* @since 3.7.0
*/
class PlgFieldsCalendar extends FieldsPlugin
{
/**
* Transforms the field into a DOM XML element and appends it as a child on the given parent.
*
* @param stdClass $field The field.
* @param DOMElement $parent The field node parent.
* @param JForm $form The form.
*
* @return DOMElement
*
* @since 3.7.0
*/
public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form)
{
$fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form);
if (!$fieldNode)
{
return $fieldNode;
}
// Set filter to user UTC
$fieldNode->setAttribute('filter', 'USER_UTC');
// Set field to use translated formats
$fieldNode->setAttribute('translateformat', '1');
$fieldNode->setAttribute('showtime', $field->fieldparams->get('showtime', 0) ? 'true' : 'false');
return $fieldNode;
}
}