New module 'Calendar'

This commit is contained in:
Manuel Cillero 2017-07-26 20:02:02 +02:00
parent 280a1af4fe
commit f697b66461
99 changed files with 13284 additions and 0 deletions

View file

@ -0,0 +1,339 @@
Views Calendar 6.x
==================
See documentation at http://drupal.org/node/262064.
Version 2.0 dev
=================
Version 6.2.4
=============
- Theme folder got lost in 6.2.3 release.
Version 6.2.3
=============
- #811704 Fix broken handling of calendar links that looses track of where you are if you click around too much.
- #720868 by dereine and KarenS, Fix argument handling for dates outside allowed range so only page views return 404.
- #1005412 by developer-x, fix multiday date id.
- #999708 Try to avoid fatal errors from duplicate functions when enabling the Multiday module.
- #1003938 Fix position of multiday navigation when displayed in a block.
- #708258 by Kars-T, remove D7 drupal_exit() call from popup.
- #372988 by joachim, Eliminate 'broken field' message in view summary when no date link is chosen.
- #870018 by crell, don't call date_limit_format thousands of times.
- #931392 by developer-x, Add multiday striping effect as an optional alternative display.
- #978442 by bwynants and KarenS, fix some remaining brokenness from ical validation fix.
- #638620 by ericduran, show add event link to user with administer nodes permissions.
- #439454 by TheRec, Darren Oh, don't show link to calendar day if there are no items.
- #389334 by Gribnif and dnotes, fix ical feed to show all repeating dates.
- #513794 by jhedstrom, add array keys to calendar links for easier theming.
- #638304 by bricef, make sure time groupings display all items.
- #697738 by Zoltan Balogh and Magnus, clean html out of translation strings.
- #452690 by aufumy and mikesteff, avoid errors if calendar min or max dates are empty.
- #469394 by extect, fix validation of calendar by removing duplicate ids.
- #522914 by jjemmett, user date_real_url() on week links.
- #704068 by gibus, add option to color calendar items by group.
- #360364 by marcushenningsen, don't link to day if there is no day view.
- #382852 by llslim, make sure replacements patterns work even if field is excluded.
- #660880 by kaare, fix method of including js in jacalendar module.
- #760316 by skwashd, arithmetric clean up ical rfc compliance.
- #613528 Fix Views option handling to set options correctly and avoid attempt to modify property of non-object error.
Version 6.2.2
=============
- #429446 Col element must not be in thead.
- #506944 Localize more link in jcalendar popup.
- #529826 Add check_plain().
- #489722 Remove mistake that caused year calendar to process endlessly.
- #389294 Require the date field in calendar style, needed to identify what cell the date belongs in.
- #452690 Avoid errors when some date fields are empty (usually when there are multiple date fields in view.)
- #389294 Avoid errors when date argument or filter is not available as a date field.
- #454958 Calendar patch was broken in ical.
- #444526 Fix typo in variable name for calendar translation.
- #427996 More link logic was reversed.
- #389294 Avoid errors when date argument or filter is not available as date field.
Version 6.2.1
=============
- #385886 Add handling for non-node date fields.
- #360967 Add method for deleting a custom default calendar.
Version 6.2.0
=============
- #377760 Fix alias handling for node edit and delete links.
- Fix the way the node type filter was configured in the default view.
- Get rid of truncated field display options, Views now handles that.
- #372625 Reset year granularity after processing months on year view now that Views has changed processing order, also omit deprecated themes, we now use date_nav_title.
- #345077 Make sure duplicate copies of the date field each get to theme the raw, unaltered, data.
- #338253 Re-work date_t() to create a more robust method of handling translations of abbreviations and other short strings.
- Add more description text to the ical description and location fields to clarify that you have to add fields to the view.
- #368632 Make sure iCal exports handle multi-day dates correctly.
- Clean up inconsistent use of calendar_display and calendar_type to use only calendar_type.
- #365113 Remove agenda hour column when not grouping by hour.
- #357019 Add method to hide all items and show only count or 'more' link.
- #350229 Make sure Calendar doesn't get updated before Views.
- #341841 Add 'has-events' and 'has-no-events' classes for easier themeing.
- Make sure there is a sane defualt value for the iCal summary field to avoid theme errors.
- #364770 Add new date link needs to convert underscore to hyphen.
- #370092 Add all-day checkbox to date field and use it in calendar.
- #369573 Fix jCalendar popup when used without clean urls.
- #367627 Fit jCalendar popup into window better.
- #368632 Fix repeating date iCal export: show date only one time and add RRULE to export.
- #332273 Use field alias in iCal location and description fields to avoid problems with CCK table optimization.
- #328097 Fix some small problems found while researching this issue. The main fix was in the Date filter.
- Allow removal of displays, still no UI since they can't go on other views.
- Don't try to set date argument when another argument precedes it.
- #349409 Fix jcalendar popup.
- Add option to link calendar to content type, and add link to calendar to node, and link to node/add to calendar.
- #342119 Make sure calendar_type option is in expected format, maybe this was causing the translation problems?
- #343090 'Today' highlighting got lost in last round of theme changes, restore it.
- #340215 Make sure day and week time slots are checking >= instead of >.
- #327221 Don't add 'today' class in empty blocks.
- #341964 Get missing back/next links back in year view (needs fix in Date module, too).
- Fix some logic in stripe labels that was showing empty content type stripes and missing taxonomy stripes.
Version 2.0 rc6
=================
- All day events were getting dropped.
- #341202, #339457, #337952, #329128, #337787, #341203, Fix repeating and multiple date displays.
- #303714 Make sure calendar obeys the date format chosen in the view now that the Date module has a 'time' format available.
- #340604 Seed taxonomy color stripes with #ffffff to be sure the colorpicker works right.
- #340215 Fix broken method of setting the key for start times.
- Get rid of hard-coded 'UTC' for database values in favor of consistently using date_get_timezone_db().
- Make sure parent pre_execute() function is called so things like items per page get set.
- Set calendar item font size at a higher level to make sure all sub-elements pick it up and make it easier to override in the theme.
- Make sure node stripes aren't created when there is no stripe color set.
- Don't truncate fields if there is no truncate value.
- Fix field name code in default view, don't add '_value' to core fields!
- Make sure default view doesn't make any assumptions about available content types.
- #337635 Make sure Views doesn't limit the calendar results to 10 items in the calendar style.
- #338515 Initialize $date_field_options to avoid error when editing style.
- Consolidate error messages about missing Date arguments so we don't get the message repeated, and add more info about how to fix.
- #337635 Make sure max_items defaults to unlimited.
- Remove deprecated iCal code left over from old method of importing feeds.
- #337665 Fix bad variable name that kept month titles from showing.
- #337664 Add warning message when selecting terms if no vocabulary has been set yet.
- #337646 We only need a single Advanced Help icon for Calendar settings.
Version 2.0 rc5
=================
New Features:
=============
- Update day and week view to use new configurable, agenda-style calendar views grouped by hour.
- #337004 By hotspoons: Add settings to display calendar legend colors based on taxonomy.
- #319344 By MothersClick.com: Add updated css styles, settings to truncate titles in calendar cells
and limit the number of events that display in calendar cells.
- Make default calendar view configurable so we can create default calendars for specific date fields.
- Add a date_embed_view() function to provide a way to embed views and have their navigation move
either together or separately, and document it in Advanced help.
- Start building Advanced help instructions, including how to do iCal import using Feed API.
- #290365 Add upcoming events block to default calendar.
Other:
======
- Rename values added to views to avoid name clashes and keep all date values together.
- #329153 Make sure day link in calendar mini block goes to full day view.
- Set day-splitting timezone to be sure it will split days using the time displayed in the calendar.
- #329418 Fix week number formatting.
- Adapt processing to make sure only selected dates display in nodes, views, and calendars.
- Improve the look of the day view by postponing the time when the item is output so we have more information in the template.
- Had the block view identifier set too early, before we know if the block is being used, causing all views to act like blocks.
- Only the month view needs the 'mini' theme, make sure it isn't used anywhere else.
- #326597 Make sure ical icon theme arguments and parameters sent to it match.
- Get the links in embedded views and blocks to work correctly using a helper function date_real_url().
- Add option to maximum items per day to either show maximum plus 'more' link or hide all and link to day.
- Use view->date fields from either date arguments or date filters.
- Add helper function for creating calendar urls based on type or requested argument.
- Fix undefined index in new Date popup calendar option.
- Make sure 'time ago' formats will work in calendar.
- Fix logic problem in the validation of multiple dates that use the grouped value, non-multiple dates were triggering the error.
- #279679 Fix broken handling of date format selection.
- Make sure popup date switcher isn't shown in the mini calendar.
- Adjust the recent changes to the navigation header to be sure only the calendar header and not the date browser is affected.
- #292164 Keep calendar date selector description from floating out of block in IE.
- #298929 Fix code so that calendar legend doesn't display empty div when empty.
- Make some fixes to the calendar legend to be sure text added for accessibility stays invisible in all themes.
- #321831 Make sure day view gets populated.
- Rework html of Year view so month titles will match block view month title for easier css themeing.
- #174580 Add rel=nofollow to back/next links.
- #289166 Change ical link in default calendar to 'all time' link instead of single period.
- #315843 Make sure there is validation to keep you from trying to group multiple date values in the calendar.
- Add the popup calendar date selector back into the D6 version.
Version 2.0 rc4
=================
- Change the jcalendar code to use the new display_ids.
- Make it possible to expose the calendar parts in the UI. To make this work better, combine year, month, day, and week handlers into a single handler.
- #311485 Make sure mini calendar has the right number of columns if using week number.
- #317660 Hard code line feeds in ical export to be sure they come through correctly in all systems.
- Start adding in Advanced help for the calendar.
- Move the colorpicker js info to the plugin so it isn't loaded everywhere.
- #314682 Add missing url() in jcalendar js code.
- #315955 Translation cleanup.
- Get colorpicker working in the Views UI again. I'm not loading the js in the best place, but at least it works now.
- Get rid of deprecated theme for ical output that is not being used in current code.
- #307544 Get rid of extra line feed at end of ical description and make sure template works correctly.
- #312170 Fix misplaced parenthesis in jCalendar theme.
- #313161 Use date_id as iCal UID to be sure it is unique.
- #303537 Display:relative should be position:relative.
- #313538 Fix color typo in calendar.css.
- #309608, #309253 Get rid of attempt to simplify the navigation query, it is too easily broken.
- #309391 Now that the Views fatal error for missing display handlers is fixed, add the ical display back.
Version 2.0 rc2
=================
- #301414 Revert http://drupal.org/cvs?commit=133523, wrong way to fix that.
- #308372 Make ical display handlers are removed from views display table when Calendar iCal is disabled.
- Eliminate query for navigation display.
- Calendar ical theme was in the wrong folder, move it to the ical folder.
- #303000 The calendar ical feed was deeply sub-classed and wasn't working right, rewrite it to not require so many other classes.
- #294469 Get rid of redundant timezone conversion that showed dates without timezone conversion in UTC.
- #303999 Correct theme paths for Views themes.
- #304762 Add missing folders for translations.
- Update to new Views2 API. Now requires latest versions of Views and CCK, and files have been re-arranged.
- Replace all include_once() with require_once().
- #301324 Rework calendar date selector to use site short date format.
- Fix css for week number to be sure it stays small in all browsers.
Version 2.0 rc1
=================
- Fix jCalendar popup so it doesn't do anything on items without a nid, like remote nodes.
- Make sure Devel module doesn't add queries to Calendar Popups.
- #292306 Make sure no error is thrown if $GLOBALS['calendar_stripes'] is empty.
- Fix day theme, there is no rows array here, it is a single rendered value.
- CCK field labels were getting lost if 'widget' was selected.
- Don't omit date fields that are not used in the date argument from being displayed on calendar nodes.
- Make sure database values with empty timezone names get defaulted to use site timezone in calendar handling.
- Views 2 moves views_query_alter() and views_pre_view() into calendar.views.inc.
- Calendar legend block should now be working correctly.
- Rework the calendar legend to incorporate imported ical node colors as well as internal colors.
- Add helper function calendar_get_node_link() to construct a node link for either an internal or external node.
- #272330 Rework css to add background colors where colors are defined and group colors together in the file.
- Add 'All day' themes for use in nodes and calendar psuedo nodes.
Version 2.0 beta4
=================
- #270318 Get date browser and calendar navigation working correctly when used in a block.
- Don't attach any displays but the right one for a given argument.
- #289981, #290328 Fixing broken handling of empty blocks that sometimes kept calendars from displaying in blocks.
- Clean up logic for creating calendar fields info.
- #268669 Improve logic for splitting multi-day nodes across calendar dates, patch by emok.
- Add new DATE_FORMAT_DATE for date-only format that is used throughout the calendar.
- Make sure week title gets translated by using date_format_date() instead of date_format().
- #289775 Day link needs a leading zero.
- Make sure calendars have a min and max date even if the date argument is not the first argument.
- Tweaked the jcalendar popup html and css a bit to keep title from popping out of the box in some themes.
- Bring the 5.2 and 6.2 calendar themes into alignment so both use the same styles and themes, including tableless back/next navigation links and themeable headers.
- #285104 Make sure calendar_colors is always an array, needed for transition to new value.
- #283902 Make sure date_format() isn't used on items with no calendar dates.
- #284760 Don't make weekno a link when there is no week view, eliminate some redundant date_format() calls.
- #276421 Use farbtastic color picker to set calendar stripes, and start process of making stripes more customizable.
- #282777 Try to make calendar creation in PHP4 more efficient to speed up creation of year calendar.
- #279195 Remove deprecated calendar_week_range().
- Set min_date_date and max_date_date in the view object so calendar can be written.
- #278267 Add a theme for the jcalendar popup.
- #259127 Remove ajax back/next navigation on mini calendar, it's not working well enough.
- #268668 Adjust comparison dates for timezone offsets to make sure multi-day events get split correctly.
- The cached ical feed cannot be used to store date objects, recreate them as needed.
- #234070 Fix broken ical title.
- #258501 Make sure calendar.inc is included when creating ical feed.
- #258515 Fix url in ical export.
- #266623 Protect against foreach() errors on empty ical feeds.
- PHP4 can't do comparisons of date objects, so alter calendar comparison code to compare formatted dates instead.
- Remove as many dependencies as possible from install files and auto-enable necessary modules.
- #272263 Make sure empty ical stream doesn't get into cache.
- #272732 Fix missing php closing tag.
- #261610 Prepare for a jQuery popup in the calendar by adding a unique id to the 'node' and altering the date theme to surpress all other dates if $node->date_id is set.
- #243172 Theme('calendar_empty') should be theme('calendar_empty_day'), patch by JohnAlbin.
- Clean up install file included files and include file paths, and auto-enable date_timezone and date_php4.
- #270818 Fix datebox theme that still defined old deprecated variable 'params'.
- #270078 Fix typo in calendar-year.tpl.php.
- #270303 Make sure iCal part of default view only gets added in if iCal is enabled.
Version 2.0 beta3
=================
- Update README.txt.
- Add rrule to template.
- Remove options from navigation, not really needed.
- Add in functions to get iCal export working.
- Get rid of calendar_clear_all() function that is not needed any more now that Views 2 has its own method for tracking settings. Also clean up related install and update code.
- #269349 Correct calendar handlers to match Views commit 120575, which changed the way handlers are structured.
Version 2.0 beta2
=================
- Fix handling of CCK dates in date argument.
- Move option to show/hide week numbers to a style setting.
- Get block view working again, remove switch calendar block because it doesn't work in this new system.
- Get the generic date argument handler pulled completely out of the Calendar module and into the Date API in a way that it can be used for any Views date field in any view.
- Rework the calendar handling to use the Date API argument in calendar displays and navigation.
- Keep the calendar displays out of the UI and instead create a default calendar view that has everything set up correctly to reduce confusion and clutter in the UI and to make it easier to create a calendar.
- Make sure month names show in year view.
- #262078 Remove deprecated function calendar_info().
- Cleanup handling of dates with timezone names in the database.
- Pass a variable to the templates to tell if this calendar is in a block or not, and use that to determine if the links are needed.
- Get the settings working for controlling the size of the day of week names, adding an option to display the full names.
- Add a separate template for the mini calendar.
Version 2.0 beta
================
- #210844 Make sure empty text displays.
- #234635 Add calendar_build_nodes() to calendar_ical export processing.
- #243712 make sure default views are retrieved as well as db views.
- #235434 Using timezone name instead of timezone object in several places.
- #233513 Fix missing $selected marker.
- #233975 Don't bypass theme function.
- #242686 Fix spelling errors.
- #240297 make sure id has a value.
- Make sure new required modules get enabled during the update.
- Fix To time in calendar, was incorrectly picking up a :59 value.
- Make sure min and max dates are in localtime.
- #225459 Fix days that span multiple days.
- #220657 Revert to using the API instead of templates for drawing the calendar.
- #186875 make sure navigation is always returned as an array so it doesn't break table theme.
- Remove database timezone handling by rolling back to previous version that used offsets instead. Based on problems noted in #218479 and #220663, we cannot count on database timezone handling to be available in MYSQL or work consistently with the timezone names that PHP uses in POSTGRES, so trying to do timezone conversions in the database is not going to work.
- #219200 Make sure views is available during install.
- #218704 Fix error in setting array variable.
- Getting rid of offsets!! Alter query code to cast ISO and UNIX dates to native datetimes and do timezone conversion in the database. Much faster and more accurate.
The offset fields can now be dropped from the Date fields since we only need the timezone name to do the conversion.
- Simplify the query a bit, but it's still very complex. We need a native datetime field so we can let the db do this the right way.
- Make sure calendar works with an argument before the calendar.
- The popup calendar datepicker needs a default value in the normal datetime format.
- Add settings option to not display year, month, day, or week view and adjust links to hide any link to hidden displays.
- Get rid of separate mini args and so mini and main calendar move together. This has been often requested and we already have too much complication in tracking various filter and non-calendar arguments in the view.
- Make sure ical dates only get shown once in views with more than one date field.
- Make sure 'today', 'future', and 'past' classes don't get applied to non-date cells.
- #216365 make sure all needed files are included in the install files.
- We can't trust the database date conversion unless we have the right offset stored in the database, so only the date-specific dates have the right values for this to work. All others must be retrieved as UTC values and converted in PHP.
- Make sure functions are available during install.
- #128602 add classes for 'past' and 'future' to date boxes, not using them by default, but available to css.
- #211568 Add setup option to show first 1, 2, or 3 letters of day names in mini calendar.
- Missing a closing div tag in the month view.
- Get rid of deprecated function date_time().
- Fix date format for day view.
- Wrong field name used to select date format.
- Set the 'today' class before incrementing the date.
- More clean up of themes to be sure both remote and local items have a reasonable display and to provide a theme to consistantly display dates.
- Fix title and url of mini calendar.
- Get iCal import working again in new version.
- Non-calendar views should now be working, so you can switch between calendar, table, list, teasers, and nodes for the display for each time period.
- Make sure $node->url is set so the link to the node works.
- Move more of the code to the .inc file.
- Clean up the date selector and add a new function to detect the calendar week from a date.
- Add a dependency on Date Timezone.
- Fix a critical typo that keeps more than one value from showing up for a day.
- Clean up theme code.
- Make the new date selector dependent on the Date Popup module.
- Rework the calendar to pull values from a template table so we can browse and navigate by calendar week. This simplifies the code and hopefully will speed up processing the calendar since the database is doing the work of constructing the calendar template instead of using PHP computations. This method is also a more accurate way of computing calendar weeks. Requires an update to populate a template table. This works because there are only 14 possible calendar templates no matter how many years you go back or forward.
- Add in the jQuery popup selector as a method to jump to different dates.
- Fix theme error in day view that repeated all previous items with each new item.
- Make sure blank nodes have the right values to create blank calendar pages.
- Standardize on use of date_format_date() to get translations done on the formatted values of date parts.
- Clean up css for month date boxes so display in Firefox and IE looks the same.
- Lost the node nid in some places which kept dates from showing up.
- Have to keep views handlers in calendar.module not in calendar_api.inc so they can be discovered when needed.
- Updating Calendar HEAD with new version of Calendar module that works with the new 5.2 Date API in Date HEAD.

View file

@ -0,0 +1,274 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public License is
intended to guarantee your freedom to share and change free software--to
make sure the software is free for all its users. This General Public License
applies to most of the Free Software Foundation's software and to any other
program whose authors commit to using it. (Some other Free Software
Foundation software is covered by the GNU Library General Public License
instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the
freedom to distribute copies of free software (and charge for this service if
you wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for
a fee, you must give the recipients all the rights that you have. You must make
sure that they, too, receive or can get the source code. And you must show
them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If the
software is modified by someone else and passed on, we want its recipients
to know that what they have is not the original, so that any problems
introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms
of this General Public License. The "Program", below, refers to any such
program or work, and a "work based on the Program" means either the
Program or any derivative work under copyright law: that is to say, a work
containing the Program or a portion of it, either verbatim or with
modifications and/or translated into another language. (Hereinafter, translation
is included without limitation in the term "modification".) Each licensee is
addressed as "you".
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running the Program is
not restricted, and the output from the Program is covered only if its contents
constitute a work based on the Program (independent of having been made
by running the Program). Whether that is true depends on what the Program
does.
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this License
and to the absence of any warranty; and give any other recipients of the
Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that you
also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that
you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in
part contains or is derived from the Program or any part thereof, to be
licensed as a whole at no charge to all third parties under the terms of this
License.
c) If the modified program normally reads commands interactively when run,
you must cause it, when started running for such interactive use in the most
ordinary way, to print or display an announcement including an appropriate
copyright notice and a notice that there is no warranty (or else, saying that
you provide a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this License.
(Exception: if the Program itself is interactive but does not normally print such
an announcement, your work based on the Program is not required to print
an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be
reasonably considered independent and separate works in themselves, then
this License, and its terms, do not apply to those sections when you distribute
them as separate works. But when you distribute the same sections as part
of a whole which is a work based on the Program, the distribution of the
whole must be on the terms of this License, whose permissions for other
licensees extend to the entire whole, and thus to each and every part
regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to
work written entirely by you; rather, the intent is to exercise the right to
control the distribution of derivative or collective works based on the
Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of a
storage or distribution medium does not bring the other work under the scope
of this License.
3. You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections 1
and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2 above
on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give
any third party, for a charge no more than your cost of physically performing
source distribution, a complete machine-readable copy of the corresponding
source code, to be distributed under the terms of Sections 1 and 2 above on
a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for
noncommercial distribution and only if you received the program in object
code or executable form with such an offer, in accord with Subsection b
above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source code
means all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation and
installation of the executable. However, as a special exception, the source
code distributed need not include anything that is normally distributed (in
either source or binary form) with the major components (compiler, kernel,
and so on) of the operating system on which the executable runs, unless that
component itself accompanies the executable.
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the
source code from the same place counts as distribution of the source code,
even though third parties are not compelled to copy the source along with the
object code.
4. You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy,
modify, sublicense or distribute the Program is void, and will automatically
terminate your rights under this License. However, parties who have received
copies, or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the
Program (or any work based on the Program), you indicate your acceptance
of this License to do so, and all its terms and conditions for copying,
distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these terms and
conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), conditions
are imposed on you (whether by court order, agreement or otherwise) that
contradict the conditions of this License, they do not excuse you from the
conditions of this License. If you cannot distribute so as to satisfy
simultaneously your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the Program at all.
For example, if a patent license would not permit royalty-free redistribution
of the Program by all those who receive copies directly or indirectly through
you, then the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and
the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system, which is implemented by public license practices. Many
people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit
geographical distribution limitation excluding those countries, so that
distribution is permitted only in or among countries not thus excluded. In such
case, this License incorporates the limitation as if written in the body of this
License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that
version or of any later version published by the Free Software Foundation. If
the Program does not specify a version number of this License, you may
choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make
exceptions for this. Our decision will be guided by the two goals of
preserving the free status of all derivatives of our free software and of
promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

View file

@ -0,0 +1,372 @@
/* calendar calendar table styles */
.calendar-calendar tr.odd, .calendar-calendar tr.even {
background-color:#fff;
}
.calendar-calendar table {
border-collapse: collapse;
border-spacing: 0;
margin:0 auto;
padding:0;
width: 100%; /* Setting at 100% causes problem in Internet Explorer. */
}
.calendar-calendar .month-view table {
border:none;
padding:0;
margin:0;
width:100%;
}
/* IE needs a little help to get the side by side tables to the right size */
.calendar-calendar .year-view td {
width:32%;
padding:1px;
border:none;
}
.calendar-calendar .year-view td table td {
width:13%;
padding:0;
}
.calendar-calendar tr {
padding: 0;
margin: 0;
background-color: white;
}
.calendar-calendar th {
color: #fff;
background-color: #ccc;
text-align: center;
margin:0;
}
.calendar-calendar th a {
font-weight: bold;
color: #fff;
background-color: #ccc;
}
.calendar-calendar td {
width: 12%; /* 14% is about 1/7 of total table width */
min-width: 12%;
border: 1px solid #ccc;
color: #777;
text-align: right;
vertical-align: top;
margin: 0;
padding:0;
}
/* simplify the mini calendar by removing borders */
.calendar-calendar .mini {
border:none;
}
/* format for the week number in the first cell */
.calendar-calendar td.week {
width:1%;
min-width:1%;
}
.calendar-calendar .week {
clear:both;
font-style: normal;
color: #555;
font-size: 0.8em;
}
.calendar-calendar .week a {
font-weight:normal;
}
/* IE6 does not support min-height, using Min-Height fast hack from http://www.dustindiaz.com/min-height-fast-hack */
.calendar-calendar .inner {
min-height:5em;
height:auto !important;
height:5em;
padding:0;
margin:0;
}
.calendar-calendar .inner div {
padding:0;
margin:0;
}
/* Make sure paragraphs buried in calendar cells use padding, not margins, for separation so the background color doesn't come through. */
.calendar-calendar .inner p {
padding:0 0 .8em 0;
margin:0;
}
.calendar-calendar td a {
font-weight: bold;
text-decoration: none;
}
.calendar-calendar td a:hover {
text-decoration: underline;
}
.calendar-calendar td.year,
.calendar-calendar td.month {
text-align: center;
}
/* format days of the week header cells */
.calendar-calendar th.days {
color: #ccc;
background-color: #224;
text-align: center;
padding:1px;
margin:0;
}
/* floating day number div */
.calendar-calendar div.day {
float: right;
text-align: center;
padding: 0.125em 0.25em 0 0.25em;
margin: 0;
background-color: #f3f3f3;
border: 1px solid gray;
border-width: 0 0 1px 1px;
clear:both;
width:1.5em;
}
/* individual node container */
.calendar-calendar div.calendar {
background-color: #fff;
border: solid 1px #ddd;
text-align: left;
margin:0 .25em .25em 0;
width: 96%;
float:right; /* needed to keep IE from hiding the floating day number */
clear:both;
}
/* No floating of day view content because there is no floating day number */
.calendar-calendar .day-view div.calendar {
float:none;
width:98%;
margin:1% 1% 0 1%;
}
.calendar-calendar div.title {
font-size:.8em;
text-align:center;
}
.calendar-calendar div.title a {
color: #000;
}
.calendar-calendar div.title a:hover {
color: #c00;
}
.calendar-calendar .content {
clear:both;
padding: 3px;
padding-left: 5px;
}
.calendar div.form-item {
white-space: normal;
}
table td.mini,
table th.mini,
table.mini td.week {
padding:0 1px 0 0;
margin:0;
}
table td.mini a {
font-weight:normal;
}
.calendar-calendar .mini-day-off {
padding:0px;
}
.calendar-calendar .mini-day-on {
padding:0px;
}
table .mini-day-on a {
text-decoration:underline;
}
.calendar-calendar .mini .title {
font-size:.8em;
}
.mini .calendar-calendar .week {
font-size:.7em;
}
.mini-row {
width:100%;
border:none;
}
.mini{
width:32%;
vertical-align:top;
}
/* formatting for the legend stripe and block */
.calendar-calendar .stripe {
height: 5px;
width: auto;
font-size:1px !important;
line-height:1px !important;
}
.calendar-calendar .day-view .stripe {
width:100%;
}
table.calendar-legend {
background-color:#ccc;
width:100%;
margin:0;
padding:0;
}
table.calendar-legend tr.odd .stripe,
table.calendar-legend tr.even .stripe {
height:12px !important;
font-size:9px !important;
line-height:10px !important;
}
.calendar-legend td {
text-align:left;
}
.calendar-empty {
font-size:1px;
line-height:1px;
}
/* formatting for the full day view */
.calendar-calendar td.calendar-agenda-hour {
font-family:serif;
text-align:right;
border:none;
border-top:1px #333 dotted;
padding-top:.25em;
width:1%;
}
.calendar-calendar td.calendar-agenda-no-hours {
min-width:1%;
}
.calendar-calendar td.calendar-agenda-hour .calendar-hour {
font-size:1.2em;
font-weight:bold;
}
.calendar-calendar td.calendar-agenda-hour .calendar-ampm {
font-size:1em;
}
.calendar-calendar td.calendar-agenda-items {
border:1px #333 dotted;
text-align:left;
}
.calendar-calendar td.calendar-agenda-items div.calendar {
width:auto;
padding:.25em;
margin:0;
}
.calendar-calendar div.calendar div.inner .calendar-agenda-empty {
width:100%;
text-align:center;
vertical-align:middle;
padding:1em 0;
background-color:#fff;
}
/* the popup date selector for jumping to a new date */
.calendar-date-select form {
text-align:right;
float:right;
width:25%;
}
.calendar-date-select div,
.calendar-date-select input,
.calendar-date-select label {
text-align:right;
padding:0;
margin:0;
float:right;
clear:both;
}
.calendar-date-select .description {
float:right;
}
.calendar-label {
font-weight:bold;
display:block;
clear:both;
}
.calendar-calendar div.date-nav {
background-color:#ccc;
color:#777;
padding:0.2em;
width:auto;
border:1px solid #ccc;
}
.calendar-calendar div.date-nav a,
.calendar-calendar div.date-nav h3 {
color:#777;
}
.calendar-calendar th.days {
background-color:#eee;
color:#777;
font-weight:bold;
border:1px solid #ccc;
}
.calendar-calendar td.empty {
background:#ccc;
border-color:#ccc;
}
.calendar-calendar table.mini td.empty {
background:#fff;
border-color:#fff;
}
.calendar-calendar td div.day {
border:1px solid #ccc;
border-top:none;
border-right:none;
margin-bottom:2px;
}
.calendar-calendar td .inner div,
.calendar-calendar td .inner div a {
background:#eee;
}
/* Set small font size for all items in calendar div, themes can override this. */
/* Use x-small instead of em to avoid multiplying effect in nested items. */
.calendar-calendar div.calendar {
border:none;
font-size:x-small;
}
.calendar-calendar td .inner div.calendar div,
.calendar-calendar td .inner div.calendar div a {
border:none;
background:#ffc;
padding:0 2px;
}
.calendar-calendar td .inner div.calendar div.calendar-more,
.calendar-calendar td .inner div.calendar div.calendar-more a {
color:#444;
background:#fff;
text-align:right;
}
.calendar-calendar td .inner .view-field,
.calendar-calendar td .inner .view-field a {
color:#444;
font-weight:normal;
}
.calendar-calendar td span.date-display-single,
.calendar-calendar td span.date-display-start,
.calendar-calendar td span.date-display-end,
.calendar-calendar td span.date-display-separator {
font-weight:bold;
}
.calendar-calendar td .inner div.day a {
color:#4b85ac;
}
.calendar-calendar tr td.today,
.calendar-calendar tr.odd td.today,
.calendar-calendar tr.even td.today {
background-color:#C3D6E4;
}
.calendar-calendar td .inner div.calendar div div.view-data-node-data-field-date-field-date-value {
border-bottom:1px solid #ccc;
}
/* The following are not used by default but are available for themes */
.calendar-calendar td.past {}
.calendar-calendar td.future {}
.calendar-calendar td.has-events {}
.calendar-calendar td.has-no-events {}

View file

@ -0,0 +1,16 @@
; $Id: calendar.info,v 1.8 2008/04/23 23:42:53 karens Exp $
name = Calendar
description = Views plugin to display views containing dates as Calendars.
dependencies[] = views
dependencies[] = date_api
dependencies[] = date_timezone
package = Date/Time
core = 6.x
; Information added by drupal.org packaging script on 2011-01-03
version = "6.x-2.4"
core = "6.x"
project = "calendar"
datestamp = "1294072550"

View file

@ -0,0 +1,157 @@
<?php
//$Id: calendar.install,v 1.13.2.12 2010/02/28 14:23:48 karens Exp $
/**
* Implementation of hook_enable().
* Reset the calendar caches.
*/
function calendar_enable() {
module_enable(array('date_api'));
if (version_compare(PHP_VERSION, '5.2', '<')) {
module_enable(array('date_php4'));
}
module_enable(array('date_timezone'));
db_query("DELETE FROM {cache_views}");
}
/**
* Implementation of hook_disable().
* Empty the calendar caches.
*/
function calendar_disable() {
db_query("DELETE FROM {cache_views}");
}
/**
* Implementation of hook_uninstall().
* Remove all traces of calendars.
*/
function calendar_uninstall() {
$ret = array();
variable_del('calendar_default_view_options');
$displays = array(
'calendar',
'calendar_attachment',
'calendar_year',
'calendar_day',
'calendar_month',
'calendar_week',
'calendar_block',
'calendar_block_view',
'calendar_ical',
);
$result = db_query("SELECT DISTINCT vid FROM {views_display} WHERE display_plugin IN ('". implode("','", $displays) ."')");
while($row = db_fetch_array($result)) {
db_query("DELETE FROM {views_view} WHERE vid = %d", $row['vid']);
db_query("DELETE FROM {views_display} WHERE vid = %d", $row['vid']);
}
db_query("DELETE FROM {cache_views}");
return $ret;
}
/**
* Implementation of hook_install().
*/
function calendar_install() {
$ret = array();
module_enable(array('date_api'));
if (version_compare(PHP_VERSION, '5.2', '<')) {
module_enable(array('date_php4'));
}
module_enable(array('date_timezone'));
// Make sure this module loads after date_api.
db_query("UPDATE {system} SET weight = 1 WHERE name = 'calendar'");
db_query("DELETE FROM {cache_views}");
return $ret;
}
function calendar_update_last_removed() {
return 5200;
}
// No longer track views info in variables now that
// Views 2 has settings we can use.
function calendar_update_6000() {
$ret = array();
// don't attempt to upgrade if views is not yet upgraded.
if (drupal_get_installed_schema_version('views', TRUE) < 6000) {
$ret = array();
drupal_set_message(t('Calendar module cannot be updated until after Views has been updated. Please return to <a href="@update-php">update.php</a> and run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
return $ret;
}
variable_del('calendar_empty_arg');
// Can't use variable_del because we don't have a reliable
// way to find the old view names.
db_query("DELETE FROM {variable} WHERE name LIKE 'calendar_%'");
cache_clear_all('variables', 'cache');
return $ret;
}
/**
* Make sure handlers for disabled Calendar iCal module don't get saved in the view.
*/
function calendar_update_6001() {
$ret = array();
// don't attempt to upgrade if views is not yet upgraded.
if (drupal_get_installed_schema_version('views', TRUE) < 6000) {
$ret = array();
drupal_set_message(t('Calendar module cannot be updated until after Views has been updated. Please return to <a href="@update-php">update.php</a> and run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
return $ret;
}
if (!module_exists('calendar_ical')) {
$ret[] = update_sql("DELETE FROM {views_display} WHERE display_plugin = 'ical'");
}
return $ret;
}
function calendar_update_6002() {
$ret = array();
// don't attempt to upgrade if views is not yet upgraded.
if (drupal_get_installed_schema_version('views', TRUE) < 6000) {
$ret = array();
drupal_set_message(t('Calendar module cannot be updated until after Views has been updated. Please return to <a href="@update-php">update.php</a> and run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
return $ret;
}
$periods = array(
'calendar_month' => 'calendar_period_1',
'calendar_year' => 'calendar_period_2',
'calendar_day' => 'calendar_period_3',
'calendar_week' => 'calendar_period_4',
'calendar_block_view' => 'calendar_period_5',
);
$result = db_query("SELECT * FROM {views_display} d LEFT JOIN {views_view} v ON d.vid = v.vid");
drupal_load('module', 'views');
while ($row = db_fetch_array($result)) {
if (in_array($row['display_plugin'], array_keys($periods))) {
$id = $row['id'];
$options = unserialize($row['display_options']);
if ($row['display_plugin'] == 'calendar_block_view') {
$options['calendar_type'] = 'month';
$options['displays'] = array('calendar_1' => 0, 'default' => 0, 'calendar_block_1' => 'calendar_block_1');
}
else {
$options['calendar_type'] = str_replace('calendar_', '', $row['display_plugin']);
$options['displays'] = array('calendar_1' => 'calendar_1', 'default' => 0, 'calendar_block_1' => 0);
}
$row['id'] = $periods[$row['id']];
$row['display_plugin'] = 'calendar_period';
$row['display_options'] = serialize($options);
db_query("UPDATE {views_display} SET id='%s', display_plugin='%s', display_options='%s' WHERE id='%s'", $row['id'], $row['display_plugin'], $row['display_options'], $id);
}
elseif ($row['display_plugin'] == 'calendar' || $row['display_plugin'] == 'calendar_block') {
db_query("UPDATE {views_display} SET id='%s' WHERE id='%s'", $row['id'] .'_1', $row['id']);
}
db_query("DELETE FROM {views_object_cache} WHERE name = '%s'", $row['name']);
}
views_invalidate_cache();
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar displays to use new handlers.');
return $ret;
}

View file

@ -0,0 +1,921 @@
<?php
// $Id: calendar.module,v 1.121.2.43 2010/12/31 16:25:43 karens Exp $
define('CALENDAR_SHOW_ALL', 0);
define('CALENDAR_HIDE_ALL', -1);
/**
* Implementation of hook_views_api().
*
* This one is used as the base to reduce errors when updating.
*/
function calendar_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'calendar') .'/includes',
);
}
/**
* @file
* Adds calendar filtering and displays to Views.
*/
/**
* Implementation of hook_help().
*/
function calendar_help($section, $arg) {
switch ($section) {
case 'admin/help#calendar':
return t("<p>View complete documentation at !link.</p>", array('!link' => 'http://drupal.org/node/120710'));
}
}
function calendar_init() {
// If the multiday module is enabled, let it control the css.
if (module_exists('calendar_multiday') || substr($_GET['q'], 0, 24) == 'admin/build/modules/list') {
return;
}
// The css for Farbtastic color picker, painless to add it here
// even though it isn't needed everywhere.
drupal_add_css('misc/farbtastic/farbtastic.css');
drupal_add_css(drupal_get_path('module', 'calendar') .'/calendar.css');
require_once('./'. drupal_get_path('module', 'calendar') .'/theme/theme.inc');
}
function calendar_theme() {
if (module_exists('calendar_multiday')) {
return array();
}
$path = drupal_get_path('module', 'calendar');
$base = array(
'file' => 'theme.inc',
'path' => "$path/theme",
);
return array(
'calendar_day_node' => $base + array(
'template' => 'calendar-day-node',
'arguments' => array('node' => NULL, 'view' => NULL),
),
'calendar_month_node' => $base + array(
'template' => 'calendar-month-node',
'arguments' => array('node' => NULL, 'view' => NULL),
),
'calendar_week_node' => $base + array(
'template' => 'calendar-week-node',
'arguments' => array('node' => NULL, 'view' => NULL),
),
'calendar_month_multiple_node' => $base + array(
'template' => 'calendar-month-multiple-node',
'arguments' => array('curday' => NULL, 'count' => NULL, 'view' => NULL, 'types' => NULL),
),
'calendar_week_multiple_node' => $base + array(
'template' => 'calendar-week-multiple-node',
'arguments' => array('curday' => NULL, 'count' => NULL, 'view' => NULL, 'types' => NULL),
),
'calendar_datebox' => $base + array(
'template' => 'calendar-datebox',
'arguments' => array(
'date' => NULL, 'view' => NULL, 'items' => NULL, 'selected' => NULL),
),
'calendar_date_combo' => $base + array(
'arguments' => array('node', 'lable', 'view'),
),
'calendar_empty_day' => $base + array(
'arguments' => array('curday', 'view'),
),
'calendar_stripe_legend' => $base + array(
'arguments' => array('stripe_labels'),
),
'calendar_stripe_stripe' => $base + array(
'arguments' => array('node'),
),
'calendar_colorpicker' => $base + array(
'arguments' => array('element'),
),
'calendar_colorfield' => $base + array(
'arguments' => array('element'),
),
'calendar_time_row_heading' => $base + array(
'arguments' => array('start_time', 'next_start_time', 'curday_date'),
),
);
}
/**
* TODO need to identify type of timezone handling needed for each date field
*/
function calendar_offset($field_name) {
$default_offset = variable_get('date_default_timezone', 0);
$configurable_zones = variable_get('configurable_timezones', 1);
}
/**
* A function to test the validity of various date parts
*/
function calendar_part_is_valid($value, $type) {
if ( !preg_match('/^[0-9]*$/', $value) ) {
return false;
}
$value = intval($value);
if ($value <= 0) return false;
switch ($type) {
case 'year':
if ($value < DATE_MIN_YEAR) return false;
break;
case 'month':
if ($value < 0 || $value > 12) return false;
break;
case 'day':
if ($value < 0 || $value > 31) return false;
break;
case 'week':
if ($value < 0 || $value > 53) return false;
}
return true;
}
/**
* implementation of hook_block()
*/
function calendar_block($op = 'list', $delta = 0) {
switch ($op) {
case 'list' :
$blocks[0]['info'] = t('Calendar Legend.');
return $blocks;
break;
case 'view' :
switch ($delta) {
case 0:
$block['subject'] = t('Calendar Legend');
$content = theme('calendar_stripe_legend');
$block['content'] = !empty($content) ? '<div class="calendar legend">'. $content .'</div>' : '';
return $block;
}
}
}
/**
* Calendar display types
*/
function calendar_display_types() {
return array('year' => t('Year'), 'month' => t('Month'), 'day' => t('Day'), 'week' => t('Week'));
}
/**
* Figure out which type of display to use,
* based on the current argument.
*
* @return year, month, day, or week.
*/
function calendar_current_type($view) {
if (!is_object($view) || !isset($view->argument) || !is_array($view->argument)) {
if (!empty($view->date_info->default_display)) {
return $view->date_info->default_display;
}
return FALSE;
}
$i = 0;
$date_handler = new date_sql_handler();
foreach ($view->argument as $argument) {
if ($argument['id'] == 'date_argument') {
$parts = array_keys($date_handler->arg_parts($view->args[$i]));
break;
}
$i++;
}
return array_pop($parts);
}
/**
* Create a stripe.
*
* @param $node - the node object
* @param $query_name - the views queryname for this date field
* @param $delta - the delta for this field, used to distinguish fields that appear more than once in the calendar
* @param $stripe - the hex code for this stripe.
* @param $label - the label to give this stripe.
*
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
* may be a better way.
*/
function calendar_node_stripe($view, &$node, $query_name, $delta, $stripe = NULL, $label = '') {
$colors = isset($view->date_info->calendar_colors) ? $view->date_info->calendar_colors : array();
if (empty($colors)) {
return;
}
$type_names = node_get_types('names');
$type = $node->raw->node_type;
if(!(isset($node->stripe))){
$node->stripe = array();
$node->stripe_label = array();
}
if (!$label && array_key_exists($type, $type_names)) {
$label = $type_names[$type];
}
if (!$stripe) {
if (array_key_exists($type, $colors)) {
$stripe = $colors[$type];
}
else {
$stripe = '';
}
}
$node->stripe[] = $stripe;
$node->stripe_label[] = $label;
$GLOBALS['calendar_stripe_labels'][][$type] = array('stripe' => $stripe, 'label' => $label);
return $stripe;
}
/**
* Create a stripe based on a taxonomy term.
*
* @param $node - the node object
* @param $query_name - the views queryname for this date field
* @param $delta - the delta for this field, used to distinguish fields that appear more than once in the calendar
* @param $stripe - the hex code for this stripe.
* @param $label - the label to give this stripe.
*
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
* may be a better way.
*/
function calendar_node_taxonomy_stripe($view, &$node, $query_name, $delta, $stripe = NULL, $label = '') {
$colors_taxonomy = isset($view->date_info->calendar_colors_taxonomy) ? $view->date_info->calendar_colors_taxonomy : array();
if (empty($colors_taxonomy)) {
return;
}
// Rename the vid added by Views to the normal name that
// taxonomy will expect, it's in the raw results.
$node->vid = $node->raw->node_vid;
$terms_for_node = taxonomy_node_get_terms($node);
if(!(isset($node->stripe))){
$node->stripe = array();
$node->stripe_label = array();
}
if (count($terms_for_node)){
foreach($terms_for_node as $term_for_node){
if (!array_key_exists($term_for_node->tid, $colors_taxonomy)) {
continue;
}
$stripe = $colors_taxonomy[$term_for_node->tid];
$stripe_label = $term_for_node->name;
$node->stripe[] = $stripe;
$node->stripe_label[] = $stripe_label;
$GLOBALS['calendar_stripe_labels'][][$term_for_node->tid] = array('stripe' => $stripe, 'label' => $stripe_label);
}
}
else {
$node->stripe[] = '';
$node->stripe_label[] = '';
}
return;
}
/**
* Create a stripe based on group.
*
* @param $node - the node object
* @param $query_name - the views queryname for this date field
* @param $delta - the delta for this field, used to distinguish fields that appear more than once in the calendar
* @param $stripe - the hex code for this stripe.
* @param $label - the label to give this stripe.
*
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
* may be a better way.
*/
function calendar_node_group_stripe($view, &$node, $query_name, $delta, $stripe = NULL, $label = '') {
$colors_group = isset($view->date_info->calendar_colors_group) ? $view->date_info->calendar_colors_group : array();
if (empty($colors_group)) {
return;
}
if (!function_exists('og_get_node_groups')) {
return;
}
$groups_for_node = og_get_node_groups($node);
if(!(isset($node->stripe))){
$node->stripe = array();
$node->stripe_label = array();
}
if (count($groups_for_node)){
foreach($groups_for_node as $gid => $group_name){
if (!array_key_exists($gid, $colors_group)) {
continue;
}
$stripe = $colors_group[$gid];
$stripe_label = $group_name;
$node->stripe[] = $stripe;
$node->stripe_label[] = $stripe_label;
$GLOBALS['calendar_stripe_labels'][][$gid] = array('stripe' => $stripe, 'label' => $stripe_label);
}
}
else {
$node->stripe[] = '';
$node->stripe_label[] = '';
}
return $stripe;
}
/**
* Helper function to figure out a group gid to use in blocks.
*
* @return an array of group nodes that are relevant.
* @todo this may need more work.
*/
function calendar_og_groups($view) {
if (!$groupnode = og_get_group_context()) {
global $user;
$groupnodes = array_keys($user->og_groups);
}
else {
$groupnodes = array($groupnode->nid);
}
return $groupnodes;
}
/**
* A selector to jump to a new date in the calendar.
*
* @param unknown_type $view
* @return unknown
*/
function calendar_date_select($view) {
return '<div class="calendar-date-select">'. drupal_get_form('calendar_date_select_form', $view) .'</div>';
}
/**
* The date selector form.
*
* @param object $view
* @return the form element
*
* @TODO is the title desired here or does it take up too much space??
*/
function calendar_date_select_form(&$form_state, $view) {
$format = date_limit_format(variable_get('date_format_short', 'm/d/Y - H:i'), array('year', 'month', 'day'));
$form['calendar_goto'] = array(
//'#title' => t('Calendar date'),
'#type' => module_exists('date_popup') ? 'date_popup' : 'date_select',
'#default_value' => date_format($view->date_info->min_date, 'Y-m-d'),
'#date_timezone' => date_default_timezone_name(),
'#date_format' => $format,
);
$form['calendar_type'] = array(
'#type' => 'hidden',
'#value' => $view->date_info->calendar_type,
);
$form['view_name'] = array(
'#type' => 'hidden',
'#value' => $view->name,
);
$form['view_url'] = array(
'#type' => 'hidden',
'#value' => $view->get_url(),
);
$pos = calendar_arg_position($view);
$form['calendar_previous_arg'] = array(
'#type' => 'hidden',
'#value' => $view->args[$pos],
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Change date'),
);
return $form;
}
function calendar_arg_position($view) {
$pos = 0;
foreach ($view->argument as $argument) {
if ($argument->definition['handler'] == 'date_api_argument_handler') {
return $pos;
}
$pos++;
}
}
/**
* Get the url for a calendar node.
*
* @param $node - a calendar node object
* @param $default - a default url to use when nothing specific is provided.
*/
function calendar_get_node_link($node, $default = NULL) {
if (isset($node->url)) {
return url($node->url, array('absolute' => TRUE));
}
elseif (empty($node->remote) && is_numeric($node->nid)) {
return url("node/$node->nid", array('absolute' => TRUE));
}
elseif (!empty($default)) {
return url($default, array('absolute' => TRUE));
}
}
function calendar_groupby_times($type = '') {
$times = array();
switch ($type) {
case 'hour':
for ($i = 0; $i <= 23; $i++) {
$times[] = date_pad($i) .':00:00';
}
break;
case 'half':
for ($i = 0; $i <= 23; $i++) {
$times[] = date_pad($i) .':00:00';
$times[] = date_pad($i) .':30:00';
}
break;
default:
break;
}
return $times;
}
/**
* Define some error messages.
*/
function calendar_errors($error) {
switch ($error) {
case 'missing_argument_default':
return t("The Date argument in this view must be set up to provide a default value set to the current date. Edit the argument, find 'Action to take if argument is not present.', choose 'Provide default argument', then select 'Current date'.");
}
}
/**
* Implementation of hook_elements.
*
* Much of the colorpicker code was adapted from the Colorpicker module.
* That module has no stable release yet nor any D6 branch.
*
* TODO Consider dropping the duplicate code and adding a dependency
* when that module is more stable, if calendar module customizations will
* work in it.
*/
function calendar_elements() {
// the Farbtastic colorpicker
$type['calendar_colorpicker'] = array(
'#attributes' => array('class' => 'calendar_colorpicker'),
'#input' => TRUE,
);
// a textfield to associate with the Farbtastic colorpicker
$type['calendar_colorfield'] = array(
'#attributes' => array('class' => 'calendar_colorfield'),
'#input' => TRUE,
'#validate' => array('calendar_validate_hex_color' => array())
);
return $type;
}
/**
* Check to make sure the user has entered a valid 6 digit hex color.
*/
function calendar_validate_hex_color($element) {
if (!$element['#required'] && empty($element['#value'])) {
return;
}
if (!preg_match('/^#(?:(?:[a-f\d]{3}){1,2})$/i', $element['#value'])) {
form_error($element, "'". check_plain($element['#value']) ."'". t(' is not a valid hex color'));
}
else {
form_set_value($element, $element['#value']);
}
}
/**
* Format calendar_colorpicker.
*/
function theme_calendar_colorpicker($element) {
$output = '';
$output .= '<div id="'. $element['#id'] .'" '. drupal_attributes($element['#attributes']) .' ></div>';
return theme('form_element', $element, $output);
}
/**
* Format calendar_color textfield.
*/
function theme_calendar_colorfield($element) {
$size = isset($element['#size']) ? ' size="' . $element['#size'] . '"' : '';
$maxlength = isset($element['#maxlength']) ? 'maxlength="'.$element['#maxlength'] .'"' : '';
$output = '';
if (isset($element['#calendar_colorpicker'])) {
$element['#attributes']['class'] .= ' edit-'. str_replace("_", "-", $element['#calendar_colorpicker']);
}
$output .= '<input type="text" name="'. $element['#name'] .'" id="'. $element['#id'] .'" '. $maxlength . $size .' value="'. check_plain($element['#value']) .'"'. drupal_attributes($element['#attributes']) .' />';
return theme('form_element', $element, $output);
}
/**
* Add link to calendar to nodes.
*
* Controlled by value of 'calendar_date_link' in the view.
*/
function calendar_link($type, $object, $teaser = FALSE) {
if ($type == 'node' && !$teaser) {
$path = variable_get('calendar_date_link_'. $object->type, NULL);
if (!empty($path)) {
return array('calendar_link' => array(
'title' => t('Calendar'),
'href' => $path,
'attributes' => array('title' => t('View the calendar.')),
));
}
}
}
/**
* Callback to remove a default calendar from the system.
*/
function calendar_remove($view_name) {
// Remove any variable that creates a default view with this name.
$calendar_options = variable_get('calendar_default_view_options', array());
if (array_key_exists($view_name, $calendar_options)) {
unset($calendar_options[$view_name]);
}
variable_set('calendar_default_view_options', $calendar_options);
// Delete it from the database, if stored there.
if ($view = views_get_view($view_name)) {
$view->delete();
}
views_invalidate_cache();
}
/**
* Formats the weekday information into table header format
*
* @ingroup event_support
* @return array with weekday table header data
*/
function calendar_week_header($view) {
$len = isset($view->date_info->style_name_size) ? $view->date_info->style_name_size : (!empty($view->date_info->mini) ? 1 : 3);
$with_week = !empty($view->date_info->style_with_weekno);
// create week header
$untranslated_days = calendar_untranslated_days();
if ($len == 99) {
$translated_days = date_week_days_ordered(date_week_days(TRUE));
}
else {
$translated_days = date_week_days_ordered(date_week_days_abbr(TRUE));
}
if ($with_week) {
$row[] = array('header' => TRUE, 'class' => "days week", 'data' => '&nbsp;');
}
foreach ($untranslated_days as $delta => $day) {
$label = $len < 3 ? drupal_substr($translated_days[$delta], 0 , $len) : $translated_days[$delta];
$row[] = array('header' => TRUE, 'class' => "days ". $day, 'data' => $label);
}
return $row;
}
/**
* Array of untranslated day name abbreviations, forced to lowercase
* and ordered appropriately for the site setting for the first day of week.
*
* The untranslated day abbreviation is used in css classes.
*/
function calendar_untranslated_days() {
$untranslated_days = date_week_days_ordered(date_week_days_untranslated());
foreach ($untranslated_days as $delta => $day) {
$untranslated_days[$delta] = strtolower(substr($day, 0, 3));
}
return $untranslated_days;
}
/**
* Take the array of items and alter it to an array of
* calendar nodes that the theme can handle.
*
* Iterate through each datefield in the view and each item
* returned by the query, and create pseudo date nodes.
*
* If there is more than one date field in the node, this will create
* multiple nodes, one each with the right calendar date for that
* field's value. If a field value has a date range that covers more than
* one day, separate nodes will be created for each day in the field's
* day range, limited to the minimum and maximum dates for the view.
*
* When we finish, we will have a distinct node for each distinct day
* and date field.
*/
function calendar_build_nodes(&$view, &$items) {
if (empty($view->date_info->min_date) || empty($view->date_info->max_date)) {
return $items;
}
// Midnights are determined based on the same timezone as the View uses
$display_timezone = date_timezone_get($view->date_info->min_date);
$display_timezone_name = timezone_name_get($display_timezone);
// Translate the view min and max dates to UTC values
// so we can compare UTC dates to the view range.
$min_utc = drupal_clone($view->date_info->min_date);
date_timezone_set($min_utc, timezone_open('UTC'));
$max_utc = drupal_clone($view->date_info->max_date);
date_timezone_set($max_utc, timezone_open('UTC'));
$min_zone_string = array(); // Will cache $min_utc-strings in various timezones
$max_zone_string = array();
$view->date_info->nodes_per_page = 0;
$type_names = node_get_types('names');
$datefields = array();
$fields = date_api_fields($view->base_table);
if (!empty($view->filter['date_filter'])) {
$date_filter = $view->filter['date_filter'];
foreach ($view->filter['date_filter']->options['date_fields'] as $name) {
$datefields[] = $fields['name'][$name]['query_name'];
}
}
if (!empty($view->argument['date_argument'])) {
$date_filter = $view->argument['date_argument'];
foreach ($view->argument['date_argument']->options['date_fields'] as $name) {
$datefields[] = $fields['name'][$name]['query_name'];
}
}
$view_fields = date_api_views_fetch_fields('node', 'field');
$field_names = (array) array_keys($fields['name']);
$nodes = array();
$i = 0;
foreach ($date_filter->options['date_fields'] as $name) {
$field = $fields['name'][$name];
$field_type = strstr($field['type'], 'string') ? 'string' : 'timestamp';
$alias = $field['query_name'];
$field_name = $field['field_name'];
$fromto = $field['fromto'];
$tz_handling = $field['tz_handling'];
$label = isset($view->field[$name]) ? $view->field[$name]['label'] : $field['field_name'];
$tz_alias = str_replace('.', '_', $field['timezone_field']);
$db_tz = date_get_timezone_db($field['tz_handling']);
$local_tz = date_get_timezone($field['tz_handling'], 'date');
$field_name = $field['field_name'];
$rrule_field = str_replace(array('_value2', '_value'), '_rrule', $alias);
// Set a flag to tell us if individual multi-day dates need to be
// split into separate nodes.
$split_dates = TRUE;
if (strstr($view->current_display, '_ical')) {
$split_dates = FALSE;
}
// If there is no field for this item, just default to the site format.
if (!isset($view->field[$field_name])) {
$format = variable_get('date_format_short', 'm/d/Y - H:i');
}
else {
if (strstr($field['type'], 'cck')) {
$format = $view->field[$field_name]->options['format'];
$cck_field_name = str_replace(array('_value2', '_value'), '', $field_name);
$format = date_formatter_format($format, $cck_field_name);
}
else {
$format = $view->field[$field_name]->options['date_format'];
$cck_field_name = NULL;
switch ($format) {
case 'long':
$format = variable_get('date_format_long', 'l, F j, Y - H:i');
break;
case 'medium':
$format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
break;
case 'custom':
$format = $view->field[$field_name]->options['custom_date_format'];
break;
case 'time ago':
break;
default:
$format = variable_get('date_format_short', 'm/d/Y - H:i');
break;
}
}
}
// set the domain part of the id
$domain = check_plain($_SERVER['SERVER_NAME']);
// If there are multiple date fields in this calendar we may get
// duplicate items from the other date fields, so add a way to
// make sure each individual date field only gets added to the
// calendar one time.
$processed = array();
$rrule_processed = array();
foreach ($items as $pos => $item) {
$delta = !empty($field['delta_field']) && !empty($item->{$field['delta_field']}) ? $item->{$field['delta_field']} : 0;
$real_field = $field_name;
if (substr($field['type'], 0, 3) == 'cck') {
$real_field = str_replace(array('_value2', '_value'), '', $field_name);
}
$id = 'calendar.'. $item->{$view->base_field} .'.'. $real_field .'.'. $delta;
// When creating iCal feeds for repeating dates we don't want all
// the multiple values, send only the first value.
if (strstr($view->current_display, '_ical')) {
if (!isset($rrule_processed[$item->nid])) {
$rrule_processed[$item->nid] = TRUE;
}
else {
continue;
}
}
if (!in_array($id, $processed) && !empty($item->calendar_fields->$alias)) {
// Create from and to date values for each item, adjusted to
// the correct timezone.
$values[0] = !empty($item->calendar_fields->$fromto[0]) ? $item->calendar_fields->$fromto[0] : $item->calendar_fields->$alias;
$values[1] = !empty($item->calendar_fields->$fromto[1]) ? $item->calendar_fields->$fromto[1] : $item->calendar_fields->$alias;
$db_tz = date_get_timezone_db($tz_handling, isset($item->$tz_alias) ? $item->$tz_alias : $display_timezone_name);
$to_zone = date_get_timezone($tz_handling, isset($item->$tz_alias) ? $item->$tz_alias : $display_timezone_name);
// Now $display_timezone determines how $item is split into
// one entry per day, while $to_zone determines how date is displayed.
// For now, use the date fields's timezone for the day splitting.
$display_timezone_name = $to_zone;
$values_display = array();
// Start date
$date = date_make_date($values[0], $db_tz, $field['sql_type']);
if ($db_tz != $to_zone) {
date_timezone_set($date, timezone_open($to_zone));
}
$values[0] = date_format($date, DATE_FORMAT_DATETIME);
if ($display_timezone_name != $to_zone) {
date_timezone_set($date, $display_timezone);
$values_display[0] = date_format($date, DATE_FORMAT_DATETIME);
}
else {
$values_display[0] = $values[0];
}
// End date
$date = date_make_date($values[1], $db_tz, $field['sql_type']);
if ($db_tz != $to_zone) {
date_timezone_set($date, timezone_open($to_zone));
}
$values[1] = date_format($date, DATE_FORMAT_DATETIME);
if ($display_timezone_name != $to_zone) {
date_timezone_set($date, $display_timezone);
$values_display[1] = date_format($date, DATE_FORMAT_DATETIME);
}
else {
$values_display[1] = $values[1];
}
// Now $values contain start and end date of a node,
// expressed as strings in the display (local) timezone.
// $values_utc does the same in UTC timezone.
// Get calendar min and max day (not time) as strings in the
// $display_timezone. Cache in $min_zone_string and $max_zone_string,
// since many items or fields typically use the samee timezone.
if (!isset($min_zone_string[$display_timezone_name])) {
$date = drupal_clone($view->date_info->min_date);
date_timezone_set($date, $display_timezone);
$min_zone_string[$display_timezone_name] = date_format($date, DATE_FORMAT_DATE);
$date = drupal_clone($view->date_info->max_date);
date_timezone_set($date, $display_timezone);
$max_zone_string[$display_timezone_name] = date_format($date, DATE_FORMAT_DATE);
}
// Create a node for each date within the field's date range,
// limited to the view's date range (regarding only day, not time).
$now = max($min_zone_string[$display_timezone_name], substr($values_display[0], 0, 10));
$to = min($max_zone_string[$display_timezone_name], substr($values_display[1], 0, 10));
$next = date_make_date($now, $display_timezone);
if ($display_timezone_name != $to_zone) {
// Make $start and $end (derived from $node) use the timezone $to_zone, just as $values[..] do
date_timezone_set($next, timezone_open($to_zone));
}
if (empty($to)) {
$to = $now;
}
// $now and $next are midnight (in display timezone) on the first day where node will occur.
// $to is midnight on the last day where node will occur.
// All three were limited by the min-max date range of the view.
while ($now <= $to) {
$node = drupal_clone($item);
// Make sure the pseudo node has the same properties a
// regular node would have.
if (isset($node->node_title) && !isset($node->title)) {
$node->title = $node->node_title;
}
if (isset($node->node_type) && !isset($node->type)) {
$node->type = $node->node_type;
}
$exceptions = array('format_interval', 'time ago');
$node->label = $label;
$node->format = $format;
if (!in_array($node->format, $exceptions)) {
if (!isset($formats[$format])) {
$formats[$format] = date_limit_format($format, array('hour', 'minute', 'second'));
$node->format_time = $formats[$format];
}
}
else {
$node->format_time = '';
}
$node->url = calendar_get_node_link($node);
//$node->$fromto[0] = $values[0];
//$node->$fromto[1] = $values[1];
// Flag which datefield this node is using, in case
// there are multiple date fields in the view.
$node->datefield = $alias;
// If there are other datefields in the View, get rid
// of them in this pseudo node. There should only be one
// date in each calendar node.
foreach ($node as $key => $val) {
if ($key != $alias && in_array($key, $datefields)) {
unset($node->$key);
foreach ($fields['name'] as $other_fields) {
// If the unused date has other fields, unset them, too.
if ($other_fields['query_name'] == $key) {
foreach ($other_fields['related_fields'] as $related_field) {
$key2 = str_replace('.', '_', $related_field);
unset($node->$key2);
}
}
}
}
}
// If we don't deconstruct dates into individual date parts,
// use date values as-is.
if (!$split_dates) {
$node->calendar_start = $values[0];
$node->calendar_end = $values[1];
}
// Split dates get intersection of current day and the node
// value's duration (as strings in $to_zone timezone)
else {
// Get start and end of current day
$start = date_format($next, DATE_FORMAT_DATETIME);
date_modify($next, '+1 day');
date_modify($next, '-1 second');
$end = date_format($next, DATE_FORMAT_DATETIME);
$node->calendar_start = $values[0] < $start ? $start : $values[0];
$node->calendar_end = !empty($values[1]) ? ($values[1] > $end ? $end : $values[1]) : $node->calendar_start;
}
$node->date_start = date_create($values[0], timezone_open($to_zone));
$node->date_end = date_create(!empty($values[1]) ? $values[1] : $values[0], timezone_open($to_zone));;
// Make date objects
$node->calendar_start_date = date_create($node->calendar_start, timezone_open($to_zone));
$node->calendar_end_date = date_create($node->calendar_end, timezone_open($to_zone));
// Change string timezones into
// calendar_start and calendar_end are UTC dates as formatted strings
$node->calendar_start = date_format($node->calendar_start_date, DATE_FORMAT_DATETIME);
$node->calendar_end = date_format($node->calendar_end_date, DATE_FORMAT_DATETIME);
if (substr($real_field, 0, 9) == 'field_') {
$cck_field = content_fields($cck_field_name);
$granularity = $cck_field['granularity'];
$increment = $cck_field['widget']['increment'];
}
else {
$granularity = 'second';
$increment = 1;
}
$node->calendar_all_day = date_is_all_day($node->calendar_end, $node->calendar_end, $granularity, $increment);
// Flag all day values specifically set in date.
$all_day_field = str_replace(array('_value2', '_value'), '_all_day', $node->datefield);
if (!empty($all_day_field) && !empty($item->$all_day_field)) {
$node->calendar_all_day = TRUE;
}
unset($node->calendar_fields);
if (isset($node) && (empty($node->calendar_start))) {
// if no date for the node and no date in the item
// there is no way to display it on the calendar
unset($node);
}
else {
calendar_node_stripe($view, $node, $alias, $alias);
calendar_node_taxonomy_stripe($view, $node, $alias, $alias);
calendar_node_group_stripe($view, $node, $alias, $alias);
$node->date_id = $id .'.'. $pos;
$nodes[] = $node;
unset($node);
}
$processed[] = $id;
if ($split_dates) {
date_modify($next, '+1 second');
$now = date_format($next, DATE_FORMAT_DATE);
}
else {
break;
}
}
}
}
}
return $nodes;
}

View file

@ -0,0 +1,55 @@
<?php
// $Id: calendar-view-ical.tpl.php,v 1.1.2.5 2010/11/21 12:25:12 karens Exp $
/**
* $calname
* The name of the calendar.
* $site_timezone
* The name of the site timezone.
* $events
* An array with the following information about each event:
*
* $event['uid'] - a unique id for the event (usually the url).
* $event['summary'] - the name of the event.
* $event['start'] - the formatted start date of the event.
* $event['end'] - the formatted end date of the event.
* $event['rrule'] - the RRULE of the event, if any.
* $event['timezone'] - the formatted timezone name of the event, if any.
* $event['url'] - the url for the event.
* $event['location'] - the name of the event location.
* $event['description'] - a description of the event.
*
* Note that there are empty spaces after RRULE, URL, LOCATION, etc
* that are needed to make sure we get the required line break.
*
*/
?>
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-WR-CALNAME: <?php print $calname . "\r\n"; ?>
PRODID:-//Drupal iCal API//EN
<?php foreach($events as $event): ?>
BEGIN:VEVENT
UID:<?php print($event['uid'] . "\r\n") ?>
SUMMARY:<?php print($event['summary'] . "\r\n") ?>
DTSTAMP:<?php print($current_date . "Z\r\n") ?>
DTSTART:<?php print($event['start'] . "Z\r\n") ?>
<?php if (!empty($event['end'])): ?>
DTEND:<?php print($event['end'] . "Z\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['rrule'])) : ?>
<?php print($event['rrule'] . "\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['url'])): ?>
URL;VALUE=URI:<?php print($event['url'] . "\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['location'])): ?>
LOCATION:<?php print($event['location'] . "\r\n") ?>
<?php endif; ?>
<?php if (!empty($event['description'])) : ?>
DESCRIPTION:<?php print($event['description'] . "\r\n") ?>
<?php endif; ?>
END:VEVENT
<?php endforeach; ?>
END:VCALENDAR

View file

@ -0,0 +1,17 @@
; $Id: calendar_ical.info,v 1.1.2.1 2008/09/05 11:03:42 karens Exp $
name = Calendar iCal
description = Adds ical functionality to Calendar views.
dependencies[] = views
dependencies[] = date_api
dependencies[] = calendar
package = Date/Time
core = 6.x
; Information added by drupal.org packaging script on 2011-01-03
version = "6.x-2.4"
core = "6.x"
project = "calendar"
datestamp = "1294072550"

View file

@ -0,0 +1,54 @@
<?php
// $Id: calendar_ical.install,v 1.1.2.6 2010/02/28 14:23:48 karens Exp $
/**
* Implementation of hook_install().
*/
function calendar_ical_install() {
db_query("UPDATE {system} SET weight = 1 WHERE name = 'calendar_ical'");
}
/**
* Make sure handlers for disabled Calendar iCal module don't get saved in the view.
*/
function calendar_ical_uninstall() {
$displays = array(
'ical',
);
db_query("DELETE FROM {views_display} WHERE display_plugin IN ('". implode("','", $displays) ."')");
db_query("DELETE FROM {cache_views}");
}
function calendar_ical_enable() {
db_query("DELETE FROM {cache_views}");
}
/**
* Make sure handlers for disabled Calendar iCal module don't get saved in the view.
*/
function calendar_ical_disable() {
db_query("DELETE FROM {cache_views}");
}
function calendar_ical_update_last_removed() {
return 1;
}
function calendar_ical_update_6000() {
$ret = array();
$result = db_query("SELECT * FROM {views_display} d LEFT JOIN {views_view} v ON d.vid = v.vid");
drupal_load('module', 'views');
while ($row = db_fetch_array($result)) {
if ($row['display_plugin'] == 'ical') {
$options = unserialize($row['display_options']);
$options['displays'] = array('calendar_1' => 'calendar_1', 'default' => 0, 'calendar_block_1' => 'calendar_block_1');
$row['display_plugin'] = 'calendar_period';
$row['display_options'] = serialize($options);
db_query("UPDATE {views_display} SET id='%s', display_plugin='%s', display_options='%s' WHERE id='%s'", 'calendar_ical_1', 'calendar_ical', $row['display_options'], $row['id']);
db_query("DELETE FROM {views_object_cache} WHERE name = '%s'", $row['name']);
}
}
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar ical displays to use new handlers and ids.');
views_invalidate_cache();
return $ret;
}

View file

@ -0,0 +1,32 @@
<?php
// $Id: calendar_ical.module,v 1.1.2.6 2008/11/24 15:48:15 karens Exp $
/**
* Implementation of hook_views_api().
*
* This one is used as the base to reduce errors when updating.
*/
function calendar_ical_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'calendar_ical'),
);
}
/**
* @file
* Adds ical functionality to Calendar.
*/
function calendar_ical_theme() {
return array(
'calendar_ical_icon' => array(
'arguments' => array('url'),
),
);
}
function theme_calendar_ical_icon($url) {
if ($image = theme('image', drupal_get_path('module', 'date_api') .'/images/ical16x16.gif', t('Add to calendar'), t('Add to calendar'))) {
return '<div style="text-align:right"><a href="'. check_url($url) .'" class="ical-icon" title="ical">'. $image .'</a></div>';
}
}

View file

@ -0,0 +1,82 @@
<?php
//$Id: calendar_ical.views.inc,v 1.1.2.6 2009/02/16 23:46:22 karens Exp $
//views_include_handlers();
/**
* Implementation of hook_views_plugins
*/
function calendar_ical_views_plugins() {
$path = drupal_get_path('module', 'calendar_ical');
$views_path = drupal_get_path('module', 'views');
require_once "./$path/theme.inc";
$data = array(
'module' => 'calendar_ical', // This just tells our themes are elsewhere.
'display' => array(
// Parents are not really displays, just needed so the files can
// be included.
'parent' => array(
'no ui' => TRUE,
'handler' => 'views_plugin_display',
'path' => "$views_path/plugins",
'parent' => '',
),
'page' => array(
'no ui' => TRUE,
'handler' => 'views_plugin_display_page',
'path' => "$views_path/plugins",
'parent' => 'parent',
),
'calendar_ical' => array(
'title' => t('iCal feed'),
'help' => t('Display the view as an iCal feed.'),
'handler' => 'calendar_plugin_display_ical',
'path' => "$path",
'parent' => 'page',
'uses hook menu' => TRUE,
'theme' => 'views_view',
'no ui' => TRUE,
'no remove' => TRUE,
'use ajax' => FALSE,
'use pager' => FALSE,
'accept attachments' => FALSE,
'admin' => t('iCal feed'),
'help topic' => 'display-ical',
),
),
'style' => array(
'parent' => array(
// this isn't really a display but is necessary so the file can
// be included.
'no ui' => TRUE,
'handler' => 'views_plugin_style',
'path' => "$views_path/plugins",
'parent' => '',
),
'rss' => array(
// this isn't really a display but is necessary so the file can
// be included.
'no ui' => TRUE,
'handler' => 'views_plugin_style_rss',
'path' => "$views_path/plugins",
'parent' => 'parent',
),
'ical' => array(
'title' => t('iCal feed'),
'help' => t('Generates an iCal feed from a view.'),
'handler' => 'calendar_plugin_style_ical',
'path' => "$path",
'theme' => 'calendar_view_ical',
'theme file' => 'theme.inc',
'theme path' => "$path",
'parent' => 'rss',
'uses row plugin' => FALSE,
'uses fields' => TRUE,
'uses row plugin' => FALSE,
'uses options' => TRUE,
'type' => 'ical',
'even empty' => TRUE,
),
),
);
return $data;
}

View file

@ -0,0 +1,115 @@
<?php
//$Id: calendar_ical_admin.inc,v 1.1.2.2 2008/10/02 20:23:49 karens Exp $
/**
* @file
* Setup and admin functions.
*
* Moved to a separate file so they're not parsed when not needed.
*/
/**
* Setup Calendar feeds.
*
* @todo - control of the stripe color is not yet implemented.
*/
function _calendar_ical_setup_form($view_name) {
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_ical.inc');
$form = array();
$view = views_get_view($view_name);
$period = drupal_map_assoc(array(0, 3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
$form['calendar_ical_expire_'. $view->name] = array(
'#type' => 'select', '#title' => t('Expire iCal cache'),
'#default_value' => variable_get('calendar_ical_expire_'. $view->name, 9676800), '#options' => $period,
'#description' => t('iCal feeds are cached to improve performance. Set an expiration time for cached feeds.')
);
$empty_feed = array(0 => array('name' => '', 'url' => '', 'type' => 'ical', 'stripe' => 0));
$form[$view->name] = array(
'#type' => 'fieldset',
'#title' => t('iCal Feeds'),
'#description' => t('Use this section to set up iCal feeds that should be displayed in this calendar. They will be shown along with any internal items that match the calendar criteria.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#tree' => TRUE,
);
// One empty input form will be added after any existing items.
$view_feeds = array_merge((array) variable_get('calendar_feeds_'. $view->name, $empty_feed), $empty_feed);
foreach ($view_feeds as $delta => $feed) {
$form[$view->name][$delta] = array(
'type' => array(
'#title' => t('Feed type'),
'#type' => 'hidden',
'#value' => 'ical',
),
'name' => array(
'#title' => t('Name'),
'#type' => 'textfield',
'#default_value' => $feed['name'],
'#description' => t('The name of a feed to include in this calendar.'),
),
'url' => array(
'#title' => t('Url'),
'#type' => 'textarea',
'#rows' => 2,
'#default_value' => $feed['url'],
'#description' => t("The external feed url or internal file path and name. Change 'webcal://' to 'http://'."),
),
'calendar_colorpicker' => array(
'#type' => 'calendar_colorpicker',
'#title' => t('Stripe color'),
),
'stripe' => array(
'#type' => 'calendar_colorfield',
'#default_value' => isset($feed['stripe']) ? $feed['stripe'] : '#ffffff',
'#calendar_colorpicker' => $view_name .'-'. $delta .'-calendar-colorpicker',
'#description' => t("The hex color value (like #ffffff) to use for this feed's calendar stripe."),
),
);
}
$form['view_name'] = array(
'#type' => 'hidden',
'#value' => $view->name,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}
/**
* Save requested values.
*/
function calendar_ical_setup_form_submit($form_id, $form_values) {
$view_name = $form_values['view_name'];
foreach ($form_values as $value_name => $value) {
if ($value_name == 'calendar_ical_expire_'. $view_name) {
variable_set('calendar_ical_expire_'. $view_name, $value);
}
elseif (is_array($value)) {
foreach ($value as $delta => $item) {
// Don't save empty values.
if (trim($item['url']) == '' || trim($item['name']) == '') {
unset($value[$delta]);
}
else {
// Replace 'webcal' protocol with http protocol.
$item['url'] = str_replace('webcal:', 'http:', $item['url']);
// Don't save invalid urls.
$events = date_ical_import($item['url']);
if (!is_array($events)) {
unset($value[$delta]);
}
else {
$value[$delta]['url'] = $item['url'];
}
}
}
variable_set('calendar_feeds_'. $value_name, $value);
}
}
cache_clear_all('calendar_feeds_'. $view->name, calendar_ical_cache(), TRUE);
}

View file

@ -0,0 +1,218 @@
<?php
// $Id: calendar_plugin_display_ical.inc,v 1.1.2.5 2008/11/25 16:12:36 karens Exp $
/**
* The plugin that handles a feed, such as RSS or atom.
*
* For the most part, feeds are page displays but with some subtle differences.
*/
class calendar_plugin_display_ical extends views_plugin_display_page {
function get_style_type() { return 'ical'; }
function uses_breadcrumb() { return FALSE; }
/**
* Feeds do not go through the normal page theming mechanism. Instead, they
* go through their own little theme function and then return NULL so that
* Drupal believes that the page has already rendered itself...which it has.
*/
function execute() {
$output = $this->view->render();
if (empty($output)) {
return drupal_not_found();
}
print $output;
}
function preview() {
return '<pre>' . check_plain($this->view->render()) . '</pre>';
}
/**
* Instead of going through the standard views_view.tpl.php, delegate this
* to the style handler.
*/
function render() {
return $this->view->style_plugin->render($this->view->result);
}
function defaultable_sections($section = NULL) {
if (in_array($section, array('style_options', 'style_plugin', 'row_options', 'row_plugin',))) {
return FALSE;
}
$sections = parent::defaultable_sections($section);
// Tell views our sitename_title option belongs in the title section.
if ($section == 'title') {
$sections[] = 'sitename_title';
}
elseif (!$section) {
$sections['title'][] = 'sitename_title';
}
return $sections;
}
function option_definition() {
$options = parent::option_definition();
$options['displays'] = array('default' => array());
// Overrides for standard stuff:
$options['style_plugin']['default'] = 'rss';
$options['style_options']['default'] = array('mission_description' => FALSE, 'description' => '');
$options['sitename_title']['default'] = FALSE;
$options['row_plugin']['default'] = '';
$options['defaults']['default']['style_plugin'] = FALSE;
$options['defaults']['default']['style_options'] = FALSE;
$options['defaults']['default']['row_plugin'] = FALSE;
$options['defaults']['default']['row_options'] = FALSE;
return $options;
}
function options_summary(&$categories, &$options) {
// It is very important to call the parent function here:
parent::options_summary($categories, $options);
// Since we're childing off the 'page' type, we'll still *call* our
// category 'page' but let's override it so it says feed settings.
$categories['page'] = array(
'title' => t('iCal settings'),
);
if ($this->get_option('sitename_title')) {
$options['title']['value'] = t('Using the site name');
}
// I don't think we want to give feeds menus directly.
unset($options['menu']);
$displays = array_filter($this->get_option('displays'));
if (count($displays) > 1) {
$attach_to = t('Multiple displays');
}
else if (count($displays) == 1) {
$display = array_shift($displays);
if (!empty($this->view->display[$display])) {
$attach_to = $this->view->display[$display]->display_title;
}
}
if (!isset($attach_to)) {
$attach_to = t('None');
}
$options['displays'] = array(
'category' => 'page',
'title' => t('Attach to'),
'value' => $attach_to,
);
}
/**
* Provide the default form for setting options.
*/
function options_form(&$form, &$form_state) {
// It is very important to call the parent function here.
parent::options_form($form, $form_state);
switch ($form_state['section']) {
case 'title':
$title = $form['title'];
// A little juggling to move the 'title' field beyond our checkbox.
unset($form['title']);
$form['sitename_title'] = array(
'#type' => 'checkbox',
'#title' => t('Use the site name for the title'),
'#default_value' => $this->get_option('sitename_title'),
);
$form['title'] = $title;
$form['title']['#process'] = array('views_process_dependency');
$form['title']['#dependency'] = array('edit-sitename-title' => array(FALSE));
break;
case 'displays':
$form['#title'] .= t('Attach to');
$displays = array();
foreach ($this->view->display as $display_id => $display) {
if (!empty($display->handler) && $display->handler->accept_attachments()) {
$displays[$display_id] = $display->display_title;
}
}
$form['displays'] = array(
'#type' => 'checkboxes',
'#description' => t('The ical icon will be shown only on the selected displays.'),
'#options' => $displays,
'#default_value' => $this->get_option('displays'),
);
break;
case 'path':
$form['path']['#description'] = t('This view will be displayed by visiting this path on your site. It is recommended that the path be something like "path/%/%/ical", putting one % in the path for each argument you have defined in the view.');
break;
}
}
/**
* Perform any necessary changes to the form values prior to storage.
* There is no need for this function to actually store the data.
*/
function options_submit($form, &$form_state) {
// It is very important to call the parent function here:
parent::options_submit($form, $form_state);
switch ($form_state['section']) {
case 'title':
$this->set_option('sitename_title', $form_state['values']['sitename_title']);
break;
case 'displays':
$this->set_option($form_state['section'], $form_state['values'][$form_state['section']]);
break;
}
}
/**
* Attach to another view.
*/
function attach_to($display_id) {
$displays = $this->get_option('displays');
if (empty($displays[$display_id])) {
return;
}
// Defer to the feed style; it may put in meta information, and/or
// attach a feed icon.
$plugin = $this->get_plugin();
if ($plugin) {
$clone = $this->view->clone_view();
$clone->set_display($this->display->id);
$clone->build_title();
$plugin->attach_to($display_id, $this->get_path(), $clone->get_title());
}
}
/**
* Display validation.
*/
function validate() {
$errors = parent::validate();
$arguments = $this->display->handler->get_option('arguments');
$filters = $this->display->handler->get_option('filters');
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
if (empty($this->view->date_info->arg_missing)) {
$errors[] = t("A Calendar period display will not work without a Date argument or a Date filter.");
}
$this->view->date_info->arg_missing = TRUE;
}
if (array_key_exists('date_argument', $arguments) &&
($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date')) {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
return $errors;
}
}

View file

@ -0,0 +1,254 @@
<?php
// $Id: calendar_plugin_style_ical.inc,v 1.1.2.17 2009/04/28 22:47:29 karens Exp $
/**
* Default style plugin to render an iCal feed.
*/
class calendar_plugin_style_ical extends views_plugin_style_rss {
function init(&$view, &$display) {
parent::init($view, $display);
$fields = $display->handler->default_display->options['fields'];
$this->options['fields'] = $fields;
}
function query() {
// We need these values for the iCal feed.
$this->view->query->add_field('node', 'title');
$this->view->query->add_field('node', 'type');
parent::query();
}
function attach_to($display_id, $path, $title) {
$display = $this->view->display[$display_id]->handler;
$url_options = array();
$input = $this->view->get_exposed_input();
if ($input) {
$url_options['query'] = $input;
}
// TODO adjust this to pick up default values when no arg is set?
$url = url($this->view->get_url(NULL, $path), $url_options);
if (empty($this->view->feed_icon)) {
$this->view->feed_icon = '';
}
$this->view->feed_icon .= theme('calendar_ical_icon', $url);
drupal_add_link(array(
'rel' => 'alternate',
'type' => 'application/calendar',
'title' => $title,
'href' => $url
));
}
/**
* Set default options
*/
function options(&$options) {
parent::options($options);
$options['summary_field'] = 'title';
$options['description_field'] = '';
$options['location_field'] = '';
$options['fields'] = array();
}
function option_definition() {
$options = parent::option_definition();
$options['summary_field'] = array('default' => '', 'translatable' => TRUE);
$options['description_field'] = array('default' => '', 'translatable' => TRUE);
$options['location_field'] = array('default' => '', 'translatable' => TRUE);
return $options;
}
function options_form(&$form, &$form_state) {
$options = array('' => '');
foreach ($this->options['fields'] as $field) {
$handler = views_get_handler($field['table'], $field['field'], 'field');
$options[$field['field']] = $handler->ui_name();
}
$form['#prefix'] = '<div class="form-item">'. t("Map the View fields to the values they should represent in the iCal feed. Only fields that have been added to the view are available to use in this way. You can add additional fields to the view and mark them 'Exclude from display' if you only want them in the iCal feed.") .'</div>';
$form['summary_field'] = array(
'#type' => 'select',
'#title' => t('Title'),
'#default_value' => !empty($this->options['summary_field']) ? $this->options['summary_field'] : 'title',
'#options' => $options,
'#required' => TRUE,
);
$form['description_field'] = array(
'#type' => 'select',
'#title' => t('Description'),
'#default_value' => $this->options['description_field'],
'#options' => $options,
);
$form['location_field'] = array(
'#type' => 'select',
'#title' => t('Location'),
'#default_value' => $this->options['location_field'],
'#options' => $options,
);
}
/**
* Style validation.
*/
function validate() {
$errors = parent::validate();
$style = $this->display->display_options['style_plugin'];
$arguments = $this->display->handler->get_option('arguments');
$filters = $this->display->handler->get_option('filters');
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
if (empty($this->view->date_info->arg_missing)) {
$errors[$style] = t("The @style style requires a Date argument or a Date filter.", array('@style' => $style));
}
$this->view->date_info->arg_missing = TRUE;
}
if (array_key_exists('date_argument', $arguments) &&
($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date')) {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
if (empty($this->options['summary_field'])) {
$errors[] = $errors[$style] = t("The @style style requires a Title field for the iCal export.", array('@style' => $style));
}
// Make sure date fields are not set up to 'Group multiple values'
// in the calendar style.
if ($style == 'calendar_style') {
$view_fields = date_api_fields($this->view->base_table);
$view_fields = $view_fields['name'];
$fields = $this->display->handler->get_option('fields');
foreach ($fields as $column => $field) {
$field_name = $field['table'] .".". $field['field'];
if (!empty($field['multiple'])) {
$cck_fields = content_fields();
$real_name = $view_fields[$field_name]['real_field_name'];
if ($cck_fields[$real_name]['multiple'] && !empty($field['multiple']['group'])) {
$errors[] = t("The date field '@field' used by the display '@display_title' cannot be set to 'Group multiple values'.", array('@field' => $view_fields[$field_name]['label'], '@display_title' => $this->display->display_title));
}
}
}
}
return $errors;
}
function render() {
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
// Transfer the style options to the view object so they
// can be easily accessed in the theme.
$style_options = $this->options;
$this->view->date_info->summary_field = $style_options['summary_field'];
$this->view->date_info->description_field = $style_options['description_field'];
$this->view->date_info->location_field = $style_options['location_field'];
// Evaluate our argument values and figure out which
// calendar display we need to create.
$i = 0;
foreach ($this->view->argument as $id => $argument) {
if ($argument->field == 'date_argument') {
// TODO Decide if we want to provide a date here or not.
// Adding this now is to prevent fatal errors later if the
// view is used in unexpected ways without a date being set.
if (empty($argument->min_date)) {
$value = $argument->get_default_argument();
$range = $argument->date_handler->arg_range($value);
$argument->min_date = $range[0];
$argument->max_date = $range[1];
}
$this->view->date_info->granularity = !empty($argument->granularity) ? $argument->granularity : $argument->options['granularity'];
$this->view->date_info->date_arg = !empty($this->view->args) ? $this->view->args[$argument->position] : '';
$this->view->date_info->date_arg_pos = $i;
$this->view->date_info->year = isset($argument->year) ? $argument->year : NULL;
$this->view->date_info->month = isset($argument->month) ? $argument->month: NULL;
$this->view->date_info->day = isset($argument->day) ? $argument->day : NULL;
$this->view->date_info->week = isset($argument->week) ? $argument->week : NULL;
$this->view->date_info->min_date = $argument->min_date;
$this->view->date_info->max_date = $argument->max_date;
// Stop after the first date argument, if there is more than one.
break;
}
$i++;
}
// The ical display might have date filters instead of arguments.
// If we missed getting a min date from date arguments, try date filters.
if (empty($this->view->date_info->min_date)) {
foreach ($this->view->filter as $id => $filter) {
if ($filter->field == 'date_filter') {
// TODO Decide if we want to provide a date here or not.
// Adding this now is to prevent fatal errors later if the
// view is used in unexpected ways without a date being set.
if (empty($filter->min_date)) {
$value = $filter->default_value('value');
$range = $filter->date_handler->arg_range($value);
$filter->min_date = $range[0];
$filter->max_date = $range[1];
}
$this->view->date_info->granularity = !empty($filter->granularity) ? $filter->granularity : $filter->options['granularity'];
$this->view->date_info->year = isset($filter->year) ? $filter->year : NULL;
$this->view->date_info->month = isset($filter->month) ? $filter->month: NULL;
$this->view->date_info->day = isset($filter->day) ? $filter->day : NULL;
$this->view->date_info->week = isset($filter->week) ? $filter->week : NULL;
$this->view->date_info->min_date = $filter->min_date;
$this->view->date_info->max_date = $filter->max_date;
if (empty($this->view->date_info->date_fields)) {
$this->view->date_info->date_fields = array();
}
$this->view->date_info->date_fields = array_merge($this->view->date_info->date_fields, array_keys($filter->options['date_fields']));
// Stop after the first date filter, if there is more than one.
break;
}
}
$i++;
}
// Render each field into an output array.
$items = array();
$calendar_fields = date_api_fields($this->view->base_table);
$calendar_fields = array_keys($calendar_fields['alias']);
foreach ($this->view->result as $num => $row) {
$items[$num] = $row;
// Store the raw date values before formatting the results.
foreach ($row as $key => $value) {
if (in_array($key, $calendar_fields)) {
$items[$num]->calendar_fields->$key = $value;
}
}
foreach ($this->view->field as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($field) && is_object($field)) {
$field_output = $field->theme($row);
$items[$num]->{$field_alias} = $field_output;
}
}
}
// Massage the resulting items into formatted calendar items.
$items = calendar_build_nodes($this->view, $items);
// Merge in items from other sources.
foreach (module_implements('calendar_add_items') as $module) {
$function = $module .'_calendar_add_items';
if (function_exists($function)) {
if ($feeds = $function($this->view)) {
foreach ($feeds as $feed) {
$items = $feed;
}
}
}
}
return theme($this->theme_functions(), $this->view, $this->options, $items);
}
}

View file

@ -0,0 +1,81 @@
<?php
// $Id: theme.inc,v 1.1.2.15 2010/11/21 11:00:56 karens Exp $
/**
* Preprocess an ical feed
*/
function template_preprocess_calendar_view_ical(&$vars) {
global $base_url;
global $language;
$view = &$vars['view'];
$options = &$vars['options'];
$items = &$vars['rows'];
$style = &$view->style_plugin;
// Figure out which display which has a path we're using for this feed. If there isn't
// one, use the global $base_url
$link_display = $view->display_handler->get_link_display();
// Compare the link to the default home page; if it's the default home page, just use $base_url.
if (empty($vars['link'])) {
$vars['link'] = $base_url;
}
// Keep devel module from appending queries to ical export.
$GLOBALS['devel_shutdown'] = FALSE;
drupal_set_header('Content-Type: text/calendar; charset=utf-8');
drupal_set_header('Content-Disposition: attachment; filename="calendar.ics"; ');
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_ical.inc');
require_once('./'. drupal_get_path('module', 'date_api') .'/theme/theme.inc');
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
$events = array();
// Get the alias name for each of our data fields.
foreach ($view->field as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
foreach (array('summary_field', 'description_field', 'location_field') as $data) {
if ($field->field == $view->date_info->$data) {
$$data = $field_alias;
}
}
}
// A summary field is required, default to the title.
if (empty($summary_field) || $summary_field == 'node_title') {
$summary_field = 'title';
}
foreach ($items as $node) {
// We cannot process an event that is missing the summary info.
if (empty($node->$summary_field)) {
continue;
}
// Allow modules to affect item fields
node_invoke_nodeapi($node, 'ical item');
unset($node->view);
$rrule_field = str_replace(array('_value2', '_value'), '_rrule', $node->datefield);
$event = array();
$event['summary'] = strip_tags($node->$summary_field);
$event['start'] = $node->calendar_start_date;
$event['end'] = $node->calendar_end_date;
$event['description'] = !empty($description_field) && !empty($node->$description_field) ? $node->$description_field : '';
$event['location'] = !empty($location_field) && !empty($node->$location_field) ? $node->$location_field : '';
$event['url'] = !empty($node->url) ? $node->url : (is_numeric($node->nid) ? url("node/$node->nid", array('absolute' => TRUE)) : $node->nid);
$event['uid'] = !empty($node->date_id) ? $node->date_id : $event['url'];
$event['rrule'] = !empty($rrule_field) && !empty($node->$rrule_field) ? $node->$rrule_field : '';
$events[$event['uid']] = $event;
/* force UTC timezone */
date_timezone_set($event['start'], timezone_open('UTC'));
date_timezone_set($event['end'], timezone_open('UTC'));
}
$headertitle = filter_xss_admin($view->get_title());
$title = variable_get('site_name', 'Drupal');
$description = $headertitle . ($title ? ' | '. $title : '');
$vars['calname'] = $description;
$vars['events'] = $events;
template_preprocess_date_vcalendar($vars);
}

View file

@ -0,0 +1,117 @@
# $Id: calendar_ical.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
#
# Czech translation of Calendar (6.x-2.2)
# Copyright (c) 2010 by the Czech translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (6.x-2.2)\n"
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
"PO-Revision-Date: 2010-10-07 16:49+0000\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
msgid "Title"
msgstr "Nadpis"
msgid "Submit"
msgstr "Uložit"
msgid "Description"
msgstr "Popis"
msgid "Name"
msgstr "Jméno"
msgid "Url"
msgstr "Url"
msgid "Location"
msgstr "Místo"
msgid "Feed type"
msgstr "Typ zdroje"
msgid "Expire iCal cache"
msgstr "Expirace iCal mezipaměti."
msgid ""
"iCal feeds are cached to improve performance. Set an expiration time "
"for cached feeds."
msgstr ""
"Pro zlepšení výkonu jsou iCal zdroje ukládány do mezipaměti. "
"Nastavte čas expirace."
msgid "iCal Feeds"
msgstr "iCal zdroje (Feeds)"
msgid ""
"Use this section to set up iCal feeds that should be displayed in this "
"calendar. They will be shown along with any internal items that match "
"the calendar criteria."
msgstr ""
"Tato sekce slouží pro nastavení iCal zdrojů, které budou v "
"kalendáři zobrazeny. Data načtená ze zdrojů budou součástí "
"všech interních položek, které odpovídají kritériím "
"kalendáře."
msgid "The name of a feed to include in this calendar."
msgstr "Název zdroje, který má být zahrnut do kalendáře."
msgid ""
"The external feed url or internal file path and name. Change "
"'webcal://' to 'http://'."
msgstr ""
"URL externího zdroje nebo interní cesta a jméno souboru. Změňte "
"'webcal://' na 'http://'."
msgid "Add to calendar"
msgstr "Přidat do kalendáře"
msgid "Calendar iCal"
msgstr "Kalendář iCal"
msgid "Attach to"
msgstr "Přiložit k"
msgid "Stripe color"
msgstr "Barva pruhu"
msgid ""
"The hex color value (like #ffffff) to use for this feed's calendar "
"stripe."
msgstr ""
"Barva v šestnáctkovém zápisu (např. #ffffff), která se má "
"použít pro tento pruh."
msgid "Adds ical functionality to Calendar views."
msgstr "Přidá podporu iCal zdrojů do kalendářových pohledů."
msgid "Multiple displays"
msgstr "Více zobrazení"
msgid "Using the site name"
msgstr "Použití jména webu"
msgid "Use the site name for the title"
msgstr "Jako název použít název webu"
msgid "iCal feed"
msgstr "iCal zdroj"
msgid "Display the view as an iCal feed."
msgstr "Zobrazit výstup z pohledu jako iCal zdroj."
msgid "Generates an iCal feed from a view."
msgstr "Jako výstup z pohledu generovat iCal zdroj."
msgid "iCal settings"
msgstr "Nastavení pro iCal"
msgid "The ical icon will be shown only on the selected displays."
msgstr "Ikona ical bude viditelná pouze u vybraných zobrazení."
msgid ""
"This view will be displayed by visiting this path on your site. It is "
"recommended that the path be something like \"path/%/%/ical\", putting "
"one % in the path for each argument you have defined in the view."
msgstr ""
"Na zde definované adrese bude zobrazen konfigurovaný pohled. Je "
"vhodné, aby adresa měla tvar \"path/%/%/ical\", kde % reprezentuje "
"jednotlivé argumenty."
msgid ""
"A Calendar period display will not work without a Date argument or a "
"Date filter."
msgstr ""
"Pokud nebude definován argument s datumem nebo datumový filtr, potom "
"nebude zobrazení časového intervalu (period display) pracovat."
msgid ""
"Map the View fields to the values they should represent in the iCal "
"feed. Only fields that have been added to the view are available to "
"use in this way. You can add additional fields to the view and mark "
"them 'Exclude from display' if you only want them in the iCal feed."
msgstr ""
"Namapujte hodnoty z iCal zdroje na relevantní pole. Mapovat lze pouze "
"ta pole, která byla přidána v konfiguraci pohledu (view). Pokud si "
"přejete pracovat s poli pouze v rámci mapování s výhodou můžete "
"použít volby 'nezobrazovat' ('Exclude from display')."
msgid "The @style style requires a Date argument or a Date filter."
msgstr "Styl @style vyžaduje argument nebo filtr typu \"datum\"."
msgid "The @style style requires a Title field for the iCal export."
msgstr "Styl @style vyžaduje pole 'Nadpis' pro iCal export."

View file

@ -0,0 +1,70 @@
# Hungarian translation of Calendar (all releases)
# Copyright (c) 2009 by the Hungarian translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (all releases)\n"
"POT-Creation-Date: 2009-11-10 16:39+0000\n"
"PO-Revision-Date: 2009-11-10 14:07+0000\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
msgid "Title"
msgstr "Cím"
msgid "Description"
msgstr "Leírás"
msgid "Location"
msgstr "Hely"
msgid "Attach to"
msgstr "Csatolás ehhez"
msgid "Multiple displays"
msgstr "Öszzetett képernyők"
msgid "Using the site name"
msgstr "Használva a webhely nevét"
msgid "Use the site name for the title"
msgstr "A webhely nevét használja címnek"
msgid "iCal feed"
msgstr "iCal hírcsatorna"
msgid "Display the view as an iCal feed."
msgstr "Nézet megjelenítése iCal hírcsatornaként."
msgid "Generates an iCal feed from a view."
msgstr "iCal hírcsatorna előállítása nézetből."
msgid "iCal settings"
msgstr "iCal beállításai"
msgid "The ical icon will be shown only on the selected displays."
msgstr "Az ical ikon csak a kiválasztott képernyőkön fog megjelenni."
msgid ""
"This view will be displayed by visiting this path on your site. It is "
"recommended that the path be something like \"path/%/%/ical\", putting "
"one % in the path for each argument you have defined in the view."
msgstr ""
"Ez a nézet ezen az útvonalon lesz megtekinthető az oldalon. "
"Javasolt az elérési út „path/%/%/ical” szerű megadása, "
"egy-egy % jelet elhelyezve az elérési útban minden, a nézetben "
"meghatározott argumentumhoz."
msgid ""
"A Calendar period display will not work without a Date argument or a "
"Date filter."
msgstr ""
"Naptári időszak képernyő nem működik egy Dátum argumentum vagy "
"egy Dátum szűrő nélkül."
msgid ""
"Map the View fields to the values they should represent in the iCal "
"feed. Only fields that have been added to the view are available to "
"use in this way. You can add additional fields to the view and mark "
"them 'Exclude from display' if you only want them in the iCal feed."
msgstr ""
"Leképezi a View mezőket az iCal hírcsatornában ábrázolandó "
"értékekre. Ezen a módon csak a nézethez hozzáadott mezők lesznek "
"elérhetőek. További mezőket lehet hozzáadni a nézethez, amiket "
"„Megjelenítésből kizárt”-nak kell jelölni, ha azokat csak az "
"iCal hírcsatornában kívánjuk megjeleníteni."
msgid "The @style style requires a Date argument or a Date filter."
msgstr ""
"@style stílushoz szükséges egy Dátum argumentum vagy egy Dátum "
"szűrő."
msgid "The @style style requires a Title field for the iCal export."
msgstr "@style stílusnak szüksége van egy Cím mezőre az iCal exporthoz."

View file

@ -0,0 +1,169 @@
# $Id: calendar_ical.pot,v 1.1.2.2 2009/02/17 11:06:21 karens Exp $
#
# LANGUAGE translation of Drupal (general)
# Copyright YEAR NAME <EMAIL@ADDRESS>
# Generated from files:
# calendar_ical.views.inc,v 1.1.2.6 2009/02/16 23:46:22 karens
# calendar_ical_admin.inc,v 1.1.2.2 2008/10/02 20:23:49 karens
# calendar_plugin_display_ical.inc,v 1.1.2.5 2008/11/25 16:12:36 karens
# calendar_plugin_style_ical.inc,v 1.1.2.13 2009/02/16 11:39:37 karens
# calendar_ical.module,v 1.1.2.6 2008/11/24 15:48:15 karens
# calendar_ical.info,v 1.1.2.1 2008/09/05 11:03:42 karens
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2009-02-17 05:03-0600\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: calendar_ical.views.inc:30;42;64
msgid "iCal feed"
msgstr ""
#: calendar_ical.views.inc:31
msgid "Display the view as an iCal feed."
msgstr ""
#: calendar_ical.views.inc:65
msgid "Generates an iCal feed from a view."
msgstr ""
#: calendar_ical_admin.inc:22
msgid "Expire iCal cache"
msgstr ""
#: calendar_ical_admin.inc:24
msgid "iCal feeds are cached to improve performance. Set an expiration time for cached feeds."
msgstr ""
#: calendar_ical_admin.inc:30
msgid "iCal Feeds"
msgstr ""
#: calendar_ical_admin.inc:31
msgid "Use this section to set up iCal feeds that should be displayed in this calendar. They will be shown along with any internal items that match the calendar criteria."
msgstr ""
#: calendar_ical_admin.inc:42
msgid "Feed type"
msgstr ""
#: calendar_ical_admin.inc:47
msgid "Name"
msgstr ""
#: calendar_ical_admin.inc:50
msgid "The name of a feed to include in this calendar."
msgstr ""
#: calendar_ical_admin.inc:53
msgid "Url"
msgstr ""
#: calendar_ical_admin.inc:57
msgid "The external feed url or internal file path and name. Change 'webcal://' to 'http://'."
msgstr ""
#: calendar_ical_admin.inc:61
msgid "Stripe color"
msgstr ""
#: calendar_ical_admin.inc:67
msgid "The hex color value (like #ffffff) to use for this feed's calendar stripe."
msgstr ""
#: calendar_ical_admin.inc:77
msgid "Submit"
msgstr ""
#: calendar_plugin_display_ical.inc:81
msgid "iCal settings"
msgstr ""
#: calendar_plugin_display_ical.inc:85
msgid "Using the site name"
msgstr ""
#: calendar_plugin_display_ical.inc:93
msgid "Multiple displays"
msgstr ""
#: calendar_plugin_display_ical.inc:103
msgid "None"
msgstr ""
#: calendar_plugin_display_ical.inc:108;135
msgid "Attach to"
msgstr ""
#: calendar_plugin_display_ical.inc:127
msgid "Use the site name for the title"
msgstr ""
#: calendar_plugin_display_ical.inc:144
msgid "The ical icon will be shown only on the selected displays."
msgstr ""
#: calendar_plugin_display_ical.inc:150
msgid "This view will be displayed by visiting this path on your site. It is recommended that the path be something like \"path/%/%/ical\", putting one % in the path for each argument you have defined in the view."
msgstr ""
#: calendar_plugin_display_ical.inc:203
msgid "A Calendar period display will not work without a Date argument or a Date filter."
msgstr ""
#: calendar_plugin_style_ical.inc:70
msgid "Map the View fields to the values they should represent in the iCal feed. Only fields that have been added to the view are available to use in this way. You can add additional fields to the view and mark them 'Exclude from display' if you only want them in the iCal feed."
msgstr ""
#: calendar_plugin_style_ical.inc:74
msgid "Title"
msgstr ""
#: calendar_plugin_style_ical.inc:81
msgid "Description"
msgstr ""
#: calendar_plugin_style_ical.inc:87
msgid "Location"
msgstr ""
#: calendar_plugin_style_ical.inc:107
msgid "The @style style requires a Date argument or a Date filter."
msgstr ""
#: calendar_plugin_style_ical.inc:120
msgid "The @style style requires a Title field for the iCal export."
msgstr ""
#: calendar_plugin_style_ical.inc:134
msgid "The date field '@field' used by the display '@display_title' cannot be set to 'Group multiple values'."
msgstr ""
#: calendar_ical.module:29;29
msgid "Add to calendar"
msgstr ""
#: calendar_ical.module:0
msgid "calendar_ical"
msgstr ""
#: calendar_ical.info:0
msgid "Calendar iCal"
msgstr ""
#: calendar_ical.info:0
msgid "Adds ical functionality to Calendar views."
msgstr ""
#: calendar_ical.info:0
msgid "Date/Time"
msgstr ""

View file

@ -0,0 +1,803 @@
/** Overlapping week items **/
.calendar-calendar tr.holder {
height : 0px;
display: table-row !important;
display : none;
}
.calendar-calendar .week-view .full div.item-wrapper,
.calendar-calendar .day-view .full div.item-wrapper {
background-color: none;
border:0px;
float:none;
margin:0px;
width : 100%;
margin-top : -24px;
}
.calendar-calendar td .inner div,
.calendar-calendar td .inner div a {
background : none;
}
.calendar-calendar .week-view .full div.single-day div.weekview,
.calendar-calendar .day-view .full div.single-day div.dayview {
background : #FFD8C0;
width : auto;
padding : 0px 3px;
overflow : hidden;
}
.calendar-calendar .week-view .full div.single-day div.weekview,
.calendar-calendar .day-view .full div.single-day div.dayview {
border : 1px solid #E39364;
}
.calendar-calendar .week-view .header-body-divider,
.calendar-calendar .week-view .single-day-footer,
.calendar-calendar .day-view .single-day-footer,
.calendar-calendar .day-view .header-body-divider {
background : #eeeeee;
border-left : 1px solid #CCCCCC;
border-right : 1px solid #CCCCCC;
font-size : 1px;
height : 4px;
line-height : 1px;
}
.calendar-calendar .week-view #multi-day-container,
.calendar-calendar .week-view #single-day-container,
.calendar-calendar .day-view #multi-day-container,
.calendar-calendar .day-view #single-day-container {
position : relative;
background : #ffffff;
overflow-y : scroll;
overflow-x : hidden;
border-left : 1px solid #CCCCCC;
border-bottom : 1px solid #CCCCCC;
}
.calendar-calendar .week-view #multi-day-container,
.calendar-calendar .day-view #multi-day-container {
border-top : 1px solid #CCCCCC;
}
.calendar-calendar .week-view #week-header-container,
.calendar-calendar .day-view #day-header-container {
width : 100%;
background : #ffffff;
border-bottom : 1px solid #CCCCCC;
}
.calendar-calendar .week-view #multi-day-container,
.calendar-calendar .day-view #multi-day-container {
height : 57px;
}
.calendar-calendar .week-view #multi-day-container .expand {
height : 100%;
}
.calendar-calendar .week-view #multi-day-container table,
.calendar-calendar .day-view #multi-day-container table {
height : 100%;
}
.calendar-calendar .week-view #multi-day-container table td,
.calendar-calendar .day-view #multi-day-container table td {
border-top : 0px;
border-bottom : 0px;
vertical-align : top;
}
.calendar-calendar .week-view #single-day-container,
.calendar-calendar .day-view #single-day-container {
border-top : 1px solid #CCCCCC;
height : 500px;
}
.calendar-calendar .week-view #single-day-container table td,
.calendar-calendar .day-view #single-day-container table td {
padding : 0px;
border-top : 0px;
border-bottom : 0px;
}
.calendar-calendar .week-view #single-day-container table td.first,
.calendar-calendar .day-view #single-day-container table td.first {
border-left : 0px;
}
.calendar-calendar .week-view #single-day-container table td.last,
.calendar-calendar .day-view #single-day-container table td.last {
border-right : 0px;
}
.calendar-calendar .week-view #single-day-container div.first,
.calendar-calendar .day-view #single-day-container div.first {
border-top : 0px;
}
.calendar-calendar .week-view #single-day-container div.last,
.calendar-calendar .day-view #single-day-container div.last {
border-bottom : 0px;
}
.calendar-calendar .week-view table.full {
table-layout : fixed;
width : 925px;
margin : 0px;
}
.calendar-calendar .day-view table.full {
table-layout : fixed;
width : 923px;
margin : 0px;
}
.calendar-calendar td.calendar-agenda-hour .calendar-hour,
.calendar-calendar td.calendar-agenda-hour .calendar-ampm,
.calendar-calendar .week-view .full div.calendar-agenda-hour span,
.calendar-calendar .day-view .full div.calendar-agenda-hour span {
font-size : .8em;
font-weight : normal;
margin-right: 0px;
}
.calendar-calendar .week-view .full div.calendar-agenda-hour,
.calendar-calendar .day-view .full div.calendar-agenda-hour,
.calendar-calendar .week-view .full div.calendar-agenda-items,
.calendar-calendar .day-view .full div.calendar-agenda-items {
width : 100%;
height : 47px;
border-top : 1px solid #cccccc;
}
.calendar-calendar .week-view .full .calendar-agenda-hour div,
.calendar-calendar .day-view .full .calendar-agenda-hour div {
margin-top : 10px;
}
.calendar-calendar .day-view .full td.calendar-time-holder,
.calendar-calendar .week-view .full td.calendar-time-holder {
width : 50px;
padding : 0px;
border : 0px;
}
.calendar-calendar .week-view .full td.calendar-day-holder {
padding : 0px;
border : 0px;
width : 125px;
}
.calendar-calendar .day-view .full td.calendar-day-holder {
padding : 0px;
border : 0px;
width : 873px;
}
.calendar-calendar .week-view .full div.single-day,
.calendar-calendar .day-view .full div.single-day {
padding : 0px;
}
.calendar-calendar .week-view .full div.single-day .inner,
.calendar-calendar .day-view .full div.single-day .inner {
position : absolute;
z-index : 1;
}
.calendar-calendar .week-view .full td.multi-day {
padding : 1px 2px 0px 2px;
}
.calendar-calendar .day-view .full td.multi-day div.dayview,
.calendar-calendar .week-view .full td.multi-day div.weekview {
height : 22px !important;
}
.calendar-calendar .day-view .full td.multi-day .calendar.dayview .view-field,
.calendar-calendar .week-view .full td.multi-day .calendar.weekview .view-field {
display : inline;
}
.calendar-calendar .week-view .full td.multi-day .inner .weekview .continuation {
height : 22px;
padding-top: 0px;
margin-right : 3px;
}
.calendar-calendar .week-view .full td.multi-day .inner .weekview .continues,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .cutoff,
.calendar-calendar .day-view .full td.multi-day .inner .dayview .continues,
.calendar-calendar .day-view .full td.multi-day .inner .dayview .cutoff {
height : 22px;
padding-top: 0px;
}
.calendar-calendar .week-view div.single-day .view-item,
.calendar-calendar .day-view div.single-day .view-item {
position : absolute;
width : 100%;
background : none;
text-align : left;
z-index : 1;
}
.calendar-calendar .week-view div.single-day .half-hour,
.calendar-calendar .day-view div.single-day .half-hour {
font-size : 1px;
height : 23px;
width : 100%;
position :relative;
z-index : 0;
top : 0px;
border-bottom : 1px dotted #cccccc;
}
.calendar-calendar .week-view div.single-day .view-item .calendar,
.calendar-calendar .day-view div.single-day .view-item .calendar {
margin : 0px;
}
.calendar-calendar .week-view div.single-day .view-item .contents,
.calendar-calendar .day-view div.single-day .view-item .contents {
overflow : hidden;
}
.calendar-calendar div.single-day .o_0 .view-item {
top : 0px;
}
.calendar-calendar div.single-day .o_1 .view-item {
top : 12px;
}
.calendar-calendar div.single-day .o_2 .view-item {
top : 24px;
}
.calendar-calendar div.single-day .o_3 .view-item {
top : 36px;
}
.calendar-calendar div.single-day .o_4 .view-item {
top : 40px;
}
.calendar-calendar div.single-day .d_1 .view-item .calendar {
height : 10px;
}
.calendar-calendar div.single-day .d_2 .view-item .calendar {
height : 22px;
}
.calendar-calendar div.single-day .d_3 .view-item .calendar {
height : 34px;
}
.calendar-calendar div.single-day .d_4 .view-item .calendar {
height : 46px;
}
.calendar-calendar div.single-day .d_5 .view-item .calendar {
height : 58px;
}
.calendar-calendar div.single-day .d_6 .view-item .calendar {
height : 70px;
}
.calendar-calendar div.single-day .d_7 .view-item .calendar {
height : 82px;
}
.calendar-calendar div.single-day .d_8 .view-item .calendar {
height : 94px;
}
.calendar-calendar div.single-day .d_9 .view-item .calendar {
height : 106px;
}
.calendar-calendar div.single-day .d_10 .view-item .calendar {
height : 118px;
}
.calendar-calendar div.single-day .d_11 .view-item .calendar {
height : 130px;
}
.calendar-calendar div.single-day .d_12 .view-item .calendar {
height : 142px;
}
.calendar-calendar div.single-day .d_13 .view-item .calendar {
height : 154px;
}
.calendar-calendar div.single-day .d_14 .view-item .calendar {
height : 166px;
}
.calendar-calendar div.single-day .d_15 .view-item .calendar {
height : 178px;
}
.calendar-calendar div.single-day .d_16 .view-item .calendar {
height : 190px;
}
.calendar-calendar div.single-day .d_17 .view-item .calendar {
height : 202px;
}
.calendar-calendar div.single-day .d_18 .view-item .calendar {
height : 214px;
}
.calendar-calendar div.single-day .d_19 .view-item .calendar {
height : 226px;
}
.calendar-calendar div.single-day .d_20 .view-item .calendar {
height : 238px;
}
.calendar-calendar div.single-day .d_21 .view-item .calendar {
height : 250px;
}
.calendar-calendar div.single-day .d_22 .view-item .calendar {
height : 262px;
}
.calendar-calendar div.single-day .d_23 .view-item .calendar {
height : 274px;
}
.calendar-calendar div.single-day .d_24 .view-item .calendar {
height : 286px;
}
.calendar-calendar div.single-day .d_25 .view-item .calendar {
height : 298px;
}
.calendar-calendar div.single-day .d_26 .view-item .calendar {
height : 310px;
}
.calendar-calendar div.single-day .d_27 .view-item .calendar {
height : 322px;
}
.calendar-calendar div.single-day .d_28 .view-item .calendar {
height : 334px;
}
.calendar-calendar div.single-day .d_29 .view-item .calendar {
height : 346px;
}
.calendar-calendar div.single-day .d_30 .view-item .calendar {
height : 358px;
}
.calendar-calendar div.single-day .d_31 .view-item .calendar {
height : 370px;
}
.calendar-calendar div.single-day .d_32 .view-item .calendar {
height : 382px;
}
.calendar-calendar div.single-day .d_33 .view-item .calendar {
height : 394px;
}
.calendar-calendar div.single-day .d_34 .view-item .calendar {
height : 406px;
}
.calendar-calendar div.single-day .d_35 .view-item .calendar {
height : 418px;
}
.calendar-calendar div.single-day .d_36 .view-item .calendar {
height : 430px;
}
.calendar-calendar div.single-day .d_37 .view-item .calendar {
height : 442px;
}
.calendar-calendar div.single-day .d_38 .view-item .calendar {
height : 454px;
}
.calendar-calendar div.single-day .d_39 .view-item .calendar {
height : 466px;
}
.calendar-calendar div.single-day .d_40 .view-item .calendar {
height : 478px;
}
.calendar-calendar div.single-day .d_41 .view-item .calendar {
height : 490px;
}
.calendar-calendar div.single-day .d_42 .view-item .calendar {
height : 502px;
}
.calendar-calendar div.single-day .d_43 .view-item .calendar {
height : 514px;
}
.calendar-calendar div.single-day .d_44 .view-item .calendar {
height : 526px;
}
.calendar-calendar div.single-day .d_45 .view-item .calendar {
height : 538px;
}
.calendar-calendar div.single-day .d_46 .view-item .calendar {
height : 550px;
}
.calendar-calendar div.single-day .d_47 .view-item .calendar {
height : 562px;
}
.calendar-calendar div.single-day .d_48 .view-item .calendar {
height : 574px;
}
.calendar-calendar div.single-day .d_49 .view-item .calendar {
height : 586px;
}
.calendar-calendar div.single-day .d_50 .view-item .calendar {
height : 598px;
}
.calendar-calendar div.single-day .d_51 .view-item .calendar {
height : 610px;
}
.calendar-calendar div.single-day .d_52 .view-item .calendar {
height : 622px;
}
.calendar-calendar div.single-day .d_53 .view-item .calendar {
height : 634px;
}
.calendar-calendar div.single-day .d_54 .view-item .calendar {
height : 646px;
}
.calendar-calendar div.single-day .d_55 .view-item .calendar {
height : 658px;
}
.calendar-calendar div.single-day .d_56 .view-item .calendar {
height : 670px;
}
.calendar-calendar div.single-day .d_57 .view-item .calendar {
height : 682px;
}
.calendar-calendar div.single-day .d_58 .view-item .calendar {
height : 694px;
}
.calendar-calendar div.single-day .d_59 .view-item .calendar {
height : 706px;
}
.calendar-calendar div.single-day .d_60 .view-item .calendar {
height : 718px;
}
.calendar-calendar div.single-day .d_61 .view-item .calendar {
height : 730px;
}
.calendar-calendar div.single-day .d_62 .view-item .calendar {
height : 742px;
}
.calendar-calendar div.single-day .d_63 .view-item .calendar {
height : 754px;
}
.calendar-calendar div.single-day .d_64 .view-item .calendar {
height : 766px;
}
.calendar-calendar div.single-day .d_65 .view-item .calendar {
height : 778px;
}
.calendar-calendar div.single-day .d_66 .view-item .calendar {
height : 790px;
}
.calendar-calendar div.single-day .d_67 .view-item .calendar {
height : 802px;
}
.calendar-calendar div.single-day .d_68 .view-item .calendar {
height : 814px;
}
.calendar-calendar div.single-day .d_69 .view-item .calendar {
height : 826px;
}
.calendar-calendar div.single-day .d_70 .view-item .calendar {
height : 838px;
}
.calendar-calendar div.single-day .d_71 .view-item .calendar {
height : 850px;
}
.calendar-calendar div.single-day .d_72 .view-item .calendar {
height : 862px;
}
.calendar-calendar div.single-day .d_73 .view-item .calendar {
height : 874px;
}
.calendar-calendar div.single-day .d_74 .view-item .calendar {
height : 886px;
}
.calendar-calendar div.single-day .d_75 .view-item .calendar {
height : 898px;
}
.calendar-calendar div.single-day .d_76 .view-item .calendar {
height : 910px;
}
.calendar-calendar div.single-day .d_77 .view-item .calendar {
height : 922px;
}
.calendar-calendar div.single-day .d_78 .view-item .calendar {
height : 934px;
}
.calendar-calendar div.single-day .d_79 .view-item .calendar {
height : 946px;
}
.calendar-calendar div.single-day .d_80 .view-item .calendar {
height : 958px;
}
.calendar-calendar div.single-day .d_81 .view-item .calendar {
height : 970px;
}
.calendar-calendar div.single-day .d_82 .view-item .calendar {
height : 982px;
}
.calendar-calendar div.single-day .d_83 .view-item .calendar {
height : 994px;
}
.calendar-calendar div.single-day .d_84 .view-item .calendar {
height : 1006px;
}
.calendar-calendar div.single-day .d_85 .view-item .calendar {
height : 1018px;
}
.calendar-calendar div.single-day .d_86 .view-item .calendar {
height : 1030px;
}
.calendar-calendar div.single-day .d_87 .view-item .calendar {
height : 1042px;
}
.calendar-calendar div.single-day .d_88 .view-item .calendar {
height : 1054px;
}
.calendar-calendar div.single-day .d_89 .view-item .calendar {
height : 1066px;
}
.calendar-calendar div.single-day .d_90 .view-item .calendar {
height : 1078px;
}
.calendar-calendar div.single-day .d_91 .view-item .calendar {
height : 1090px;
}
.calendar-calendar div.single-day .d_92 .view-item .calendar {
height : 1102px;
}
.calendar-calendar div.single-day .d_93 .view-item .calendar {
height : 1114px;
}
.calendar-calendar div.single-day .d_94 .view-item .calendar {
height : 1128px;
}
.calendar-calendar div.single-day .d_95 .view-item .calendar {
height : 1140px;
}
.calendar-calendar div.single-day .d_96 .view-item .calendar {
height : 1152px;
}
.calendar-calendar .week-view div.single-day .i_0 .view-item .calendar {
margin-left : 0px;
width : 55px;
}
.calendar-calendar .week-view div.single-day .i_1 .view-item .calendar {
margin-left : 15px;
width : 102px;
}
.calendar-calendar .week-view div.single-day .i_2 .view-item .calendar {
margin-left : 23px;
width : 94px;
}
.calendar-calendar .week-view div.single-day .i_3 .view-item .calendar {
margin-left : 29px;
width : 88px;
}
.calendar-calendar .week-view div.single-day .i_4 .view-item .calendar {
margin-left : 40px;
width : 77px;
}
.calendar-calendar .week-view div.single-day .i_5 .view-item .calendar {
margin-left : 50px;
width : 67px;
}
.calendar-calendar .week-view div.single-day .i_6 .view-item .calendar {
margin-left : 60px;
width : 57px;
}
.calendar-calendar .week-view div.single-day .i_7 .view-item .calendar {
margin-left : 67px;
width : 50px;
}
.calendar-calendar .week-view div.single-day .i_8 .view-item .calendar {
margin-left : 75px;
width : 42px;
}
.calendar-calendar .week-view div.single-day .i_9 .view-item .calendar {
margin-left : 90px;
width : 27px;
}
.calendar-calendar .week-view div.single-day .i_0.md_0 .view-item .calendar {
width : 115px !important;
width : auto;
}
.calendar-calendar .week-view div.single-day .i_0.md_1 .view-item .calendar {
width : 75px !important;
width : auto;
}
.calendar-calendar .day-view div.single-day .i_0 .view-item .calendar {
margin-left : 2px;
width : 210px !important;
width : 838px;
}
.calendar-calendar .day-view div.single-day .i_1 .view-item .calendar {
margin-left : 90px;
width : 750px;
}
.calendar-calendar .day-view div.single-day .i_2 .view-item .calendar {
margin-left : 180px;
width : 660px;
}
.calendar-calendar .day-view div.single-day .i_3 .view-item .calendar {
margin-left : 270px;
width : 570px;
}
.calendar-calendar .day-view div.single-day .i_4 .view-item .calendar {
margin-left : 360px;
width : 480px;
}
.calendar-calendar .day-view div.single-day .i_5 .view-item .calendar {
margin-left : 450px;
width : 390px;
}
.calendar-calendar .day-view div.single-day .i_6 .view-item .calendar {
margin-left : 540px;
width : 300px;
}
.calendar-calendar .day-view div.single-day .i_7 .view-item .calendar {
margin-left : 630px;
width : 210px;
}
.calendar-calendar .day-view div.single-day .i_8 .view-item .calendar {
margin-left : 720px;
width : 120px;
}
.calendar-calendar .day-view div.single-day .i_9 .view-item .calendar {
margin-left : 810px;
width : 30px;
}
.calendar-calendar .day-view div.single-day .i_0.md_0 .view-item .calendar {
width : 838px !important;
width : auto;
}
.calendar-calendar .day-view div.single-day .i_0.md_1 .view-item .calendar {
width : 419px !important;
width : auto;
}
.calendar-calendar .day-view div.single-day .i_0.md_2 .view-item .calendar {
width : 350px !important;
width : auto;
}
.single-day-footer .grippie,
.header-body-divider .grippie {
overflow: hidden;
background: #eee url(/misc/grippie.png) no-repeat center 2px;
cursor: s-resize;
height : 3px;
}

View file

@ -0,0 +1,852 @@
/* calendar calendar table styles */
.calendar-calendar tr.odd, .calendar-calendar tr.even {
background-color:#fff;
}
.calendar-calendar table {
border-collapse: collapse;
border-spacing: 0;
margin:0 auto;
padding:0;
width: 100%; /* Setting at 100% causes problem in Internet Explorer. */
}
.calendar-calendar .month-view table {
border:none;
padding:0;
margin:0;
width:100%;
}
/* IE needs a little help to get the side by side tables to the right size */
.calendar-calendar .year-view td {
width:32%;
padding:1px;
border:none;
}
.calendar-calendar .year-view td table td {
width:13%;
padding:0;
}
.calendar-calendar tr {
padding: 0;
margin: 0;
background-color: white;
}
.calendar-calendar th {
text-align: center;
margin:0;
}
.calendar-calendar th a {
font-weight: bold;
}
.calendar-calendar td {
width: 12%; /* 14% is about 1/7 of total table width */
min-width: 12%;
border: 1px solid #ccc;
color: #777;
text-align: right;
vertical-align: top;
margin: 0;
padding:0;
}
/* simplify the mini calendar by removing borders */
.calendar-calendar .mini {
border:none;
}
/* format for the week number in the first cell */
.calendar-calendar td.week {
width:1%;
min-width:1%;
}
.calendar-calendar .week {
clear:both;
font-style: normal;
color: #555;
font-size: 0.8em;
}
.calendar-calendar .week a {
font-weight:normal;
}
/* IE6 does not support min-height, using Min-Height fast hack from http://www.dustindiaz.com/min-height-fast-hack */
.calendar-calendar .inner {
height:auto !important;
height:5em;
padding:0;
margin:0;
}
.calendar-calendar .inner div {
padding:0;
margin:0;
}
/* Make sure paragraphs buried in calendar cells use padding, not margins, for separation so the background color doesn't come through. */
.calendar-calendar .inner p {
padding:0 0 .8em 0;
margin:0;
}
.calendar-calendar td a {
font-weight: bold;
text-decoration: none;
}
.calendar-calendar td a:hover {
text-decoration: underline;
}
.calendar-calendar td.year,
.calendar-calendar td.month {
text-align: center;
}
/* format days of the week header cells */
.calendar-calendar th.days {
color: #ccc;
background-color: #224;
text-align: center;
padding:1px;
margin:0;
}
/* floating day number div */
.calendar-calendar div.day {
float: right;
text-align: center;
padding: 0.125em 0.25em 0 0.25em;
margin: 0;
background-color: #f3f3f3;
border: 1px solid gray;
border-width: 0 0 1px 1px;
clear:both;
width:1.5em;
}
/* individual node container */
.calendar-calendar div.calendar {
background-color: #fff;
border: solid 1px #ddd;
text-align: left;
margin:0 .25em .25em 0;
width: 96%;
float:right; /* needed to keep IE from hiding the floating day number */
clear:both;
}
/* No floating of day view content because there is no floating day number */
.calendar-calendar .day-view div.calendar {
float:none;
width:98%;
margin:1% 1% 0 1%;
}
.calendar-calendar div.title {
font-size:.8em;
text-align:center;
}
.calendar-calendar div.title a {
color: #000;
}
.calendar-calendar div.title a:hover {
color: #c00;
}
.calendar-calendar .content {
clear:both;
padding: 3px;
padding-left: 5px;
}
.calendar div.form-item {
white-space: normal;
}
table td.mini,
table th.mini,
table.mini td.week {
padding:0 1px 0 0;
margin:0;
}
table td.mini a {
font-weight:normal;
}
.calendar-calendar .mini-day-off {
padding:0px;
}
.calendar-calendar .mini-day-on {
padding:0px;
}
table .mini-day-on a {
text-decoration:underline;
}
.calendar-calendar .mini .title {
font-size:.8em;
}
.mini .calendar-calendar .week {
font-size:.7em;
}
.mini-row {
width:100%;
border:none;
}
.mini{
width:32%;
vertical-align:top;
}
/* formatting for the legend stripe and block */
.calendar-calendar .stripe {
height: 5px;
width: auto;
font-size:1px !important;
line-height:1px !important;
}
.calendar-calendar .day-view .stripe {
width:100%;
}
table.calendar-legend {
background-color:#ccc;
width:100%;
margin:0;
padding:0;
}
table.calendar-legend tr.odd .stripe,
table.calendar-legend tr.even .stripe {
height:12px !important;
font-size:9px !important;
line-height:10px !important;
}
.calendar-legend td {
text-align:left;
}
.calendar-empty {
font-size:1px;
line-height:1px;
}
/* formatting for the full day view */
.calendar-calendar td.calendar-agenda-hour {
text-align:right;
border:none;
border-top:1px solid #CCCCCC;
padding-top:.25em;
width:1%;
}
.calendar-calendar td.calendar-agenda-no-hours {
min-width:1%;
}
.calendar-calendar td.calendar-agenda-hour .calendar-hour {
font-size:1.2em;
font-weight:bold;
}
.calendar-calendar td.calendar-agenda-hour .calendar-ampm {
font-size:1em;
}
.calendar-calendar td.calendar-agenda-items {
border:1px solid #CCCCCC;
text-align:left;
}
.calendar-calendar td.calendar-agenda-items div.calendar {
width:auto;
padding:.25em;
margin:0;
}
.calendar-calendar div.calendar div.inner .calendar-agenda-empty {
width:100%;
text-align:center;
vertical-align:middle;
padding:1em 0;
background-color:#fff;
}
/* the popup date selector for jumping to a new date */
.calendar-date-select form {
text-align:right;
float:right;
width:25%;
}
.calendar-date-select div,
.calendar-date-select input,
.calendar-date-select label {
text-align:right;
padding:0;
margin:0;
float:right;
clear:both;
}
.calendar-date-select .description {
float:right;
}
.calendar-label {
font-weight:bold;
display:block;
clear:both;
}
.calendar-calendar div.date-nav {
background-color:#ccc;
color:#777;
padding:0.2em;
width:auto;
border:1px solid #ccc;
}
.calendar-calendar div.date-nav a,
.calendar-calendar div.date-nav h3 {
color:#777;
text-decoration:none;
}
.calendar-calendar th.days {
background-color:#eee;
color:#777;
font-weight:bold;
border:1px solid #ccc;
}
.calendar-calendar td.empty {
background:#ccc;
border-color:#ccc;
}
.calendar-calendar table.mini td.empty {
background:#fff;
border-color:#fff;
}
.calendar-calendar td div.day {
border:1px solid #ccc;
border-top:none;
border-right:none;
margin-bottom:2px;
}
.calendar-calendar td .inner div,
.calendar-calendar td .inner div a {
background:#eee;
}
/* Set small font size for all items in calendar div, themes can override this. */
/* Use x-small instead of em to avoid multiplying effect in nested items. */
.calendar-calendar div.calendar {
border:none;
font-size:x-small;
}
.calendar-calendar td .inner div.calendar div,
.calendar-calendar td .inner div.calendar div a {
border:none;
background:#ffc;
padding:0;
}
.calendar-calendar td .inner div.calendar div.calendar-more,
.calendar-calendar td .inner div.calendar div.calendar-more a {
color:#444;
background:#fff;
text-align:right;
}
.calendar-calendar td .inner .view-field,
.calendar-calendar td .inner .view-field a {
color:#444;
font-weight:normal;
}
.calendar-calendar td span.date-display-single,
.calendar-calendar td span.date-display-start,
.calendar-calendar td span.date-display-end,
.calendar-calendar td span.date-display-separator {
font-weight:bold;
}
.calendar-calendar td .inner div.day a {
color:#4b85ac;
}
.calendar-calendar tr td.today,
.calendar-calendar tr.odd td.today,
.calendar-calendar tr.even td.today {
background-color:#C3D6E4;
}
.calendar-calendar td .inner div.calendar div div.view-data-node-data-field-date-field-date-value {
}
/* The following are not used by default but are available for themes */
.calendar-calendar td.past {}
.calendar-calendar td.future {}
.calendar-calendar td.has-events {}
.calendar-calendar td.has-no-events {}
/* Multi day styles */
.calendar-calendar tbody {
border-top : none;
}
.calendar-calendar .month-view .full .inner,
.calendar-calendar .week-view .full .multi-day .inner {
height : auto;
min-height : auto;
}
.calendar-calendar .week-view .full .calendar-agenda-hour
.calendar-calendar .month-view .full .single-day .inner .view-item {
float : left;
width : 100%;
}
.calendar-calendar .week-view .full .calendar-agenda-hour {
width : 6%;
min-width : 0px;
padding-right : 2px;
}
.calendar-calendar .week-view .full .days {
width : 13%;
}
.calendar-calendar .month-view .full div.calendar,
.calendar-calendar .week-view .full div.calendar,
.calendar-calendar .day-view div.calendar {
width : auto;
}
.calendar-calendar .month-view .full tr.date-box,
.calendar-calendar .month-view .full tr.date-box td,
.calendar-calendar .month-view .full tr.multi-day,
.calendar-calendar .month-view .full tr.multi-day td {
height : 19px;
max-height : 19px;
}
.calendar-calendar .month-view .full tr.single-day .no-entry,
.calendar-calendar .month-view .full tr.single-day .no-entry .inner {
height : 44px !important;
line-height : 44px;
font-size : 1px;
}
.calendar-calendar .month-view .full tr.single-day .noentry-multi-day,
.calendar-calendar .month-view .full tr.single-day .noentry-multi-day .inner {
height : 22px !important;
line-height : 22px;
font-size : 1px;
}
.calendar-calendar .month-view .full td,
.calendar-calendar .week-view .full td,
.calendar-calendar .day-view td {
vertical-align: top;
padding :1px 2px 0 2px
}
.calendar-calendar .month-view .full td.date-box {
height : 1%;
border-bottom: 0px;
padding-bottom : 2px;
}
.calendar-calendar .month-view .full .week {
font-size : inherit;
}
.calendar-calendar .month-view .full .week a,
.calendar-calendar .week-view .full .week a {
color:#4b85ac;
}
.calendar-calendar .month-view .full td .inner div.day,
.calendar-calendar .month-view .full td .inner div.day a {
border :none;
background : none;
margin-bottom: 0px;
}
.calendar-calendar .month-view .full td.date-box .inner,
.calendar-calendar .week-view .full td.date-box .inner {
min-height : inherit;
}
.calendar-calendar .month-view .full td.multi-day,
.calendar-calendar .week-view .full td.multi-day {
border-top: 0px;
border-bottom: 0px;
}
.calendar-calendar .week-view .full .first td.multi-day {
border-top : 1px solid #CCCCCC;
}
.calendar-calendar .month-view .full td.single-day {
border-top: 0px;
}
.calendar-calendar .month-view .full td.multi-day .inner,
.calendar-calendar .week-view .full td.multi-day .inner,
.calendar-calendar .day-view .full td.multi-day .inner {
min-height : inherit;
width : auto;
position : relative;
}
.calendar-calendar .month-view .full td.multi-day.no-entry {
min-height : 0px;
}
.calendar-calendar .month-view .full td.single-day .calendar-empty,
.calendar-calendar .month-view .full td.single-day.empty,
.calendar-calendar .month-view .full td.date-box.empty {
background : #F4F4F4;
}
.calendar-calendar .month-view .full td.single-day .inner div,
.calendar-calendar .month-view .full td.single-day .inner div a ,
.calendar-calendar .month-view .full td.multi-day .inner div,
.calendar-calendar .month-view .full td.multi-day .inner div a ,
.calendar-calendar .month-view .full td .inner div.calendar.monthview div,
.calendar-calendar .month-view .full td .inner div.calendar.monthview div a,
.calendar-calendar .week-view .full td.single-day .inner div,
.calendar-calendar .week-view .full td.single-day .inner div a ,
.calendar-calendar .week-view .full td.multi-day .inner div,
.calendar-calendar .week-view .full td.multi-day .inner div a ,
.calendar-calendar .week-view .full td .inner div.calendar.weekview div,
.calendar-calendar .week-view .full td .inner div.calendar.weekview div a,
.calendar-calendar .day-view .full td .inner div.view-item,
.calendar-calendar .day-view .full td .inner div.calendar div,
.calendar-calendar .day-view .full td .inner div.calendar div a {
background : none;
}
.calendar-calendar .day-view .full td .inner div.calendar div,
.calendar-calendar .day-view .full td .inner div.calendar div a {
margin : 0px 3px;
}
.calendar-calendar .day-view .full td .inner div.calendar div.stripe {
margin : 0px;
}
.calendar-calendar .month-view .full tr td.today,
.calendar-calendar .month-view .full tr.odd td.today,
.calendar-calendar .month-view .full tr.even td.today {
background: none;
border-left :2px solid #7C7F12;
border-right :2px solid #7C7F12;
}
.calendar-calendar .month-view .full td.date-box.today {
border-width : 2px 2px 0px 2px;
border-style: solid;
border-color : #7C7F12;
}
.calendar-calendar .month-view .full tr td.single-day.today {
border-bottom :2px solid #7C7F12;
}
.calendar-calendar .month-view .full tr td.multi-day.starts-today {
border-left :2px solid #7C7F12;
}
.calendar-calendar .month-view .full tr td.multi-day.ends-today {
border-right :2px solid #7C7F12;
}
.calendar-calendar .month-view .full tr td.multi-day,
.calendar-calendar .month-view .full tr td.single-day {
border-top : 0px;
}
.calendar-calendar .month-view .full tr td.multi-day,
.calendar-calendar .month-view .full tr td.date-box {
border-bottom : 0px;
}
.calendar-calendar .month-view .full .inner .monthview,
.calendar-calendar .week-view .full .inner .weekview,
.calendar-calendar .day-view .full .inner .dayview {
-moz-border-radius : 5px;
border-radius : 5px;
width : auto;
float : none;
display : block;
margin : .25em auto;
position : relative;
}
.calendar-calendar .month-view .full td.single-day div.monthview,
.calendar-calendar .week-view .full td.single-day div.weekview,
.calendar-calendar .day-view .full td.single-day div.dayview {
background : #FFD8C0;
width : auto;
padding : 0px 3px;
overflow : hidden;
}
.calendar-calendar .month-view .full td.single-day .calendar-more div.monthview {
background : none;
}
.calendar-calendar .day-view td div.dayview {
padding : 0px;
}
.calendar-calendar .month-view .full td.multi-day div.monthview,
.calendar-calendar .week-view .full td.multi-day div.weekview,
.calendar-calendar .day-view .full td.multi-day div.dayview {
background : #74a5d7;
height : 1.9em;
overflow : hidden;
margin : 0px auto;
color : #ffffff;
position : relative;
}
.calendar-calendar .week-view .full td.multi-day div.weekview {
height : 3.5em;
}
.calendar-calendar .month-view .full td.multi-day .inner .view-field,
.calendar-calendar .month-view .full td.multi-day .inner .view-field a,
.calendar-calendar .week-view .full td.multi-day .inner .view-field,
.calendar-calendar .week-view .full td.multi-day .inner .view-field a,
.calendar-calendar .day-view .full td.multi-day .inner .view-field,
.calendar-calendar .day-view .full td.multi-day .inner .view-field a {
color : #ffffff;
}
.calendar-calendar .full td.multi-day .calendar .view-field,
.calendar-calendar .full td.single-day .calendar .view-field {
}
.calendar-calendar .day-view .full td.multi-day div.dayview,
.calendar-calendar .week-view .full td.multi-day div.weekview {
margin-bottom: 2px;
}
.calendar-calendar .month-view .full td.multi-day .calendar.monthview .view-field {
white-space: nowrap;
float : left;
margin-right : 3px;
}
.calendar-calendar .week-view .full td.multi-day .calendar.weekview .view-field {
white-space: nowrap;
display : inline;
margin-right : 3px;
}
.calendar-calendar .day-view .full td.multi-day .calendar.weekview .view-field {
display : block;
}
.calendar-calendar .month-view .full td.multi-day .calendar.monthview .contents,
.calendar-calendar .week-view .full td.multi-day .calendar.weekview .contents {
position : absolute;
width : 3000px;
left: 5px;
}
.calendar-calendar .day-view td .stripe,
.calendar-calendar .month-view .full td .stripe,
.calendar-calendar .week-view .full td .stripe {
-moz-border-radius : 5px 5px 0px 0px;
border-radius : 5px 5px 0px 0px;
left: 0px;
top : 0px;
position:absolute;
width : 100%;
height :3px;
z-index : 2;
}
.calendar-calendar .full td.single-day .continuation,
.calendar-calendar .full td.single-day .continues,
.calendar-calendar .full td.single-day .cutoff {
display : none;
}
.calendar-calendar .month-view .full td.multi-day .inner .monthview .continuation,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .continuation {
float :left;
margin-right : 3px;
height : 1.9em;
}
.calendar-calendar .week-view .full td.multi-day .inner .weekview .continuation {
height : 2.75em;
padding-top: 0.75em;
margin-right : 8px;
}
.calendar-calendar .month-view .full td.multi-day .inner .monthview .continues,
.calendar-calendar .month-view .full td.multi-day .inner .monthview .cutoff,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .continues,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .cutoff {
position:absolute;
right : 0px !important;
right : -1px;
width : 10px;
text-align: left;
background : #74a5d7;
-moz-border-radius : 0px 5px 5px 0px;
border-radius : 0px 5px 5px 0px;
height : 1.9em;
padding-left: 6px;
z-index : 1;
}
.calendar-calendar .week-view .full td.multi-day .inner .weekview .continues,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .cutoff {
height : 2.75em;
padding-top: 0.75em;
}
.calendar-calendar .month-view .full td.multi-day .inner .monthview .cutoff,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .cutoff {
width : 8px;
padding-left: 0px;
}
.calendar-calendar .week-view .full td.multi-day {
padding : 2px;
}
.calendar-calendar .week-view td.single-day div.calendar {
width : 100%;
padding-left:0px;
padding-right : 0px;
}
.calendar-calendar .week-view .full tr.last td.multi-day {
border-bottom:1px solid #CCCCCC;
}
/* Restyle Header */
.view-content .calendar-calendar {
position : relative;
margin-top : 5px;
float:left;
width: 100%;
}
.view-content .calendar-calendar .links {
display : block;
}
.view-content .calendar-calendar ul.links {
margin-bottom: 3px;
}
.view-content .calendar-calendar ul {
position : absolute;
top : 8px ;
line-height : inherit;
z-index : 1;
}
.view-content .calendar-calendar li {
float : left;
line-height : inherit ;
margin-left : 10px ;
}
.view-content .calendar-calendar li a {
text-decoration : underline ;
line-height : inherit ;
}
.view-content .calendar-calendar .date-nav {
background-color : transparent ;
border : 0px ;
height : 30px;
height : auto ;
min-height : 30px;
}
.view-content .calendar-calendar .date-prev a,
.view-content .calendar-calendar .date-next a {
text-decoration : none ;
color : inherit ;
font-size : 12px;
}
.view-content .calendar-calendar .date-nav a:hover {
text-decoration : underline ;
}
.view-content .calendar-calendar .date-prev {
-moz-border-radius:5px 0 0 5px;
border-radius:5px 0 0 5px;
background:none repeat scroll 0 0 #dfdfdf;
float:none;
padding:5px 0;
position:absolute;
right:60px;
text-align:right;
top:0px;
width:auto;
z-index : 1;
font-size : 12px;
}
div.block .view-content .calendar-calendar .date-prev {
left:0;
right:auto;
}
.view-content .calendar-calendar .date-prev span {
margin-left : 10px;
font-style : bold;
}
.view-content .calendar-calendar .date-heading {
position : relative;
width : 100%;
top : 0px;
text-align : center;
z-index : 0;
float : none;
}
.view-content .calendar-calendar .date-heading h3 {
line-height : 30px ;
font-size : 1.7em ;
}
.view-content .calendar-calendar .date-next {
-moz-border-radius:0px 5px 5px 0px;
border-radius:0px 5px 5px 0px;
background:none repeat scroll 0 0 #dfdfdf;
float:none;
padding:5px 0;
position:absolute;
right:0px;
text-align:right;
top:0px;
width:auto;
z-index : 1;
font-size : 12px;
}
.view-content .calendar-calendar .date-next span {
margin-right : 10px;
font-style : bold;
}
.view-content:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.attachment .calendar-calendar {
margin-top : 20px ;
clear : both;
}
.calendar-calendar th a,
.attachment .calendar-calendar th {
background-color : transparent ;
border : 0px ;
}
.attachment .calendar-calendar th.calendar-agenda-hour {
color : #777777;
font-weight : bold;
text-align : right;
}
.view-calendar .feed-icon {
margin-top : 5px;
}

View file

@ -0,0 +1,15 @@
; $Id: calendar_multiday.info,v 1.1.2.2 2011/01/03 12:28:47 karens Exp $
name = Calendar Multiday
description = "Use the calendar multiday display as an alternative to the standard display. (BETA version)"
dependencies[] = calendar
dependencies[] = views
core = 6.x
php = 5.2
package = Date/Time
; Information added by drupal.org packaging script on 2011-01-03
version = "6.x-2.4"
core = "6.x"
project = "calendar"
datestamp = "1294072550"

View file

@ -0,0 +1,12 @@
<?php
/**
* Enabling and disabling this module requires that the registry be rebuilt.
*/
function calendar_multiday_enable() {
drupal_flush_all_caches();
}
function calendar_multiday_disable() {
drupal_flush_all_caches();
}

View file

@ -0,0 +1,90 @@
<?php
// $Id: calendar_multiday.module,v 1.1.2.2 2010/12/31 16:25:43 karens Exp $
/**
* Implementation of hook_views_api().
*
* This one is used as the base to reduce errors when updating.
*/
function calendar_multiday_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'calendar_multiday'),
);
}
/**
* @file
* Adds calendar filtering and displays to Views.
*/
function calendar_multiday_init() {
if (substr($_GET['q'], 0, 24) == 'admin/build/modules/list') {
return;
}
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar_multiday.css');
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/theme/theme.inc');
}
function calendar_multiday_theme() {
$path = drupal_get_path('module', 'calendar_multiday');
$base = array(
'file' => 'theme.inc',
'path' => "$path/theme",
);
return array(
'calendar_day_node' => $base + array(
'template' => 'calendar-day-node',
'arguments' => array('node' => NULL, 'view' => NULL),
),
'calendar_month_node' => $base + array(
'template' => 'calendar-month-node',
'arguments' => array('node' => NULL, 'view' => NULL),
),
'calendar_week_node' => $base + array(
'template' => 'calendar-week-node',
'arguments' => array('node' => NULL, 'view' => NULL),
),
'calendar_month_multiple_node' => $base + array(
'template' => 'calendar-month-multiple-node',
'arguments' => array('curday' => NULL, 'count' => NULL, 'view' => NULL, 'types' => NULL),
),
'calendar_week_multiple_node' => $base + array(
'template' => 'calendar-week-multiple-node',
'arguments' => array('curday' => NULL, 'count' => NULL, 'view' => NULL, 'types' => NULL),
),
'calendar_datebox' => $base + array(
'template' => 'calendar-datebox',
'arguments' => array(
'date' => NULL, 'view' => NULL, 'items' => NULL, 'selected' => NULL),
),
'calendar_date_combo' => $base + array(
'arguments' => array('node', 'lable', 'view'),
),
'calendar_empty_day' => $base + array(
'arguments' => array('curday', 'view'),
),
'calendar_stripe_legend' => $base + array(
'arguments' => array('stripe_labels'),
),
'calendar_stripe_stripe' => $base + array(
'arguments' => array('node'),
),
'calendar_colorpicker' => $base + array(
'arguments' => array('element'),
),
'calendar_colorfield' => $base + array(
'arguments' => array('element'),
),
'calendar_time_row_heading' => $base + array(
'arguments' => array('start_time', 'next_start_time', 'curday_date'),
),
'calendar_month_col' => $base + array(
'template' => 'calendar-month-col',
'arguments' => array('item' => NULL),
),
'calendar_month_row' => $base + array(
'template' => 'calendar-month-row',
'arguments' => array('inner' => NULL, 'class' => NULL, 'iehint' => NULL),
),
);
}

View file

@ -0,0 +1,87 @@
// $Id: calendar_overlap.js,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/*
* Create the splitter, set the viewport size, and set the position of the scrollbar to the first item.
*/
Drupal.behaviors.calendarSetScroll = function (context) {
// Make multi-day resizable - stolen/borrowed from textarea.js
$('.header-body-divider:not(.header-body-divider-processed)').each(function() {
var divider = $(this).addClass('header-body-divider-processed');
var start_y = divider.offset().top;
// Add the grippie icon
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
function startDrag(e) {
start_y = divider.offset().top;
$(document).mousemove(performDrag).mouseup(endDrag);
return false;
}
function performDrag(e) {
var offset = e.pageY - start_y;
var mwc = $('#multi-day-container');
var sdc = $('#single-day-container');
var mwc_height = mwc.height();
var sdc_height = sdc.height();
var max_height = mwc_height + sdc_height;
mwc.height(Math.min(max_height,Math.max(0,mwc_height + offset)));
sdc.height(Math.min(max_height,Math.max(0,sdc_height - offset)));
start_y = divider.offset().top;
return false;
}
function endDrag(e) {
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
}
});
$('.single-day-footer:not(.single-day-footer-processed)').each(function() {
var divider = $(this).addClass('single-day-footer-processed');
var start_y = divider.offset().top;
// Add the grippie icon
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
function startDrag(e) {
start_y = divider.offset().top;
$(document).mousemove(performDrag).mouseup(endDrag);
return false;
}
function performDrag(e) {
var offset = e.pageY - start_y;
var sdc = $('#single-day-container');
sdc.height(Math.max(0,sdc.height() + offset));
start_y = divider.offset().top;
return false;
}
function endDrag(e) {
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
}
});
// Size the window
calendar_resizeViewport();
}
// Scroll the viewport to the first item
function calendar_scrollToFirst() {
if ($('div.first_item').size() > 0 ) {
var y = $('div.first_item').offset().top - $('#single-day-container').offset().top ;
$('#single-day-container').scrollTop(y);
}
}
// Size the single day view
function calendar_resizeViewport() {
// Size of the browser window
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
var top = $('#single-day-container').offset().top;
// Give it a 20 pixel margin at the bottom
$('#single-day-container').height(viewportHeight - top - 20);
}

View file

@ -0,0 +1,619 @@
<?php
//$Id: calendar.inc,v 1.1.2.4 2011/01/02 00:00:56 karens Exp $
/**
* Build calendar
*
* @param unknown_type $view
* @param unknown_type $items
* @return themed table
*/
function calendar_build_calendar($view, $items) {
// Remove nodes outside the selected date range.
$values = array();
foreach ($items as $delta => $item) {
if (empty($item->calendar_start_date) || empty($item->calendar_end_date)) {
continue;
}
$item_start = date_format($item->calendar_start_date, DATE_FORMAT_DATE);
$item_end = date_format($item->calendar_end_date, DATE_FORMAT_DATE);
if (($item_start >= $view->date_info->min_date_date && $item_start <= $view->date_info->max_date_date)
|| ($item_end >= $view->date_info->min_date_date && $item_end <= $view->date_info->max_date_date)) {
$values[$item_start][date_format($item->date_start, 'H:i:s')][] = $item;
}
}
$items = $values;
ksort($items);
$rows = array();
$curday = drupal_clone($view->date_info->min_date);
switch ($view->date_info->granularity) {
case 'year':
$rows = array();
$view->date_info->mini = TRUE;
for ($i = 1; $i <= 12; $i++) {
$rows[$i] = calendar_build_mini_month($curday, $view, $items);
}
$view->date_info->mini = FALSE;
break;
case 'month':
$rows = ($view->date_info->mini) ? calendar_build_mini_month($curday, $view, $items) : calendar_build_month($curday, $view, $items);
break;
case 'day':
$rows = calendar_build_day($curday, $view, $items);
break;
case 'week':
$rows = calendar_build_week($curday, $view, $items);
// Merge the day names in as the first row.
$rows = array_merge(array(calendar_week_header($view)), $rows);
break;
}
return $rows;
}
/**
* Build one month.
*/
function calendar_build_mini_month(&$curday, $view, $items) {
$month = date_format($curday, 'n');
date_modify($curday, '-' . strval(date_format($curday, 'j')-1) . ' days');
$rows = array();
do {
$rows = array_merge($rows, calendar_build_mini_week($curday, $view, $items, TRUE));
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$curday_month = date_format($curday, 'n');
} while ($curday_month == $month && $curday_date <= $view->date_info->max_date_date);
// Merge the day names in as the first row.
$rows = array_merge(array(calendar_week_header($view)), $rows);
return $rows;
}
/**
* Build one month.
*/
function calendar_build_month(&$curday, $view, $items) {
$month = date_format($curday, 'n');
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$weekdays = calendar_untranslated_days($items, $view);
date_modify($curday, '-' . strval(date_format($curday, 'j')-1) . ' days');
$rows = array();
do {
$init_day = clone($curday);
$today = date_format(date_now(date_default_timezone_name()), DATE_FORMAT_DATE);
$month = date_format($curday, 'n');
$week = date_week($curday_date);
$first_day = variable_get('date_first_day', 0);
$week_rows = calendar_build_week($curday, $view, $items, TRUE);
$multiday_buckets = $week_rows['multiday_buckets'];
$singleday_buckets = $week_rows['singleday_buckets'];
$total_rows = $week_rows['total_rows'];
// Theme each row
$output = "";
$final_day = clone($curday);
$iehint = 0;
$max_multirow_cnt = 0;
$max_singlerow_cnt = 0;
for ($i = 0; $i < $total_rows + 1; $i++) {
$inner = "";
// If we're displaying the week number, add it as the
// first cell in the week.
if ($i == 0 && !empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', 'week'))) {
$url = $view->get_path() .'/'. $view->date_info->year .'-W'. $week;
if (!empty($view->date_info->display_types['week'])) {
$weekno = l($week, $url, array('query' => !empty($view->date_info->append) ? $view->date_info->append : ''));
}
else {
// Do not link week numbers, if Week views are disabled.
$weekno = $week;
}
$item = array(
'entry' => $weekno,
'colspan' => 1,
'rowspan' => $total_rows + 1,
'id' => $view->name . '-weekno-' . $curday_date,
'class' => 'week'
);
$inner .= theme('calendar_month_col', $item);
}
$curday = clone($init_day);
// move backwards to the first day of the week
$day_wday = date_format($curday, 'w');
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
for ( $wday = 0; $wday < 7; $wday++) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$class = strtolower($weekdays[$wday]);
$item = NULL;
$in_month = !($curday_date < $view->date_info->min_date_date || $curday_date > $view->date_info->max_date_date || date_format($curday, 'n') != $month);
// Add the datebox
if ($i == 0) {
$count = $in_month ? intval(count($multiday_buckets[$wday]) + count($singleday_buckets[$wday])) : FALSE;
$item = array(
'entry' => theme('calendar_datebox', $curday_date, $view, $items, $count),
'colspan' => 1,
'rowspan' => 1,
'class' => 'date-box',
'date' => $curday_date,
'id' => $view->name . '-' . $curday_date . '-date-box'
);
$item['class'] .= ($curday_date == $today && $in_month ? ' today' : '') .
($curday_date < $today ? ' past' : '') .
($curday_date > $today ? ' future' : '');
}
else {
$index = $i - 1;
$multi_count = count($multiday_buckets[$wday]);
// Process multiday buckets first. If there is a multiday-bucket item in this row...
if ($index < $multi_count) {
// If this item is filled with either a blank or an entry...
if ($multiday_buckets[$wday][$index]['filled']) {
// Add item and add class
$item = $multiday_buckets[$wday][$index];
$item['class'] = 'multi-day';
$item['date'] = $curday_date;
// Is this an entry?
if (!$multiday_buckets[$wday][$index]['avail']) {
// If the item either starts or ends on today,
// then add tags so we can style the borders
if ($curday_date == $today && $in_month) {
$item['class'] .= ' starts-today';
}
// Calculate on which day of this week this item ends on..
$end_day = clone($curday);
$span = $item['colspan'] - 1;
date_modify($end_day, '+' . $span .' day');
$endday_date = date_format($end_day, DATE_FORMAT_DATE);
// If it ends today, add class
if ($endday_date == $today && $in_month) {
$item['class'] .= ' ends-today';
}
}
}
// If this is an acutal entry, add classes regarding the state of the
// item
if ($multiday_buckets[$wday][$index]['avail']) {
$item['class'] .= ' ' . $wday . ' ' . $index . ' no-entry ' . ($curday_date == $today && $in_month ? ' today' : '') .
($curday_date < $today ? ' past' : '') .
($curday_date > $today ? ' future' : '');
}
// Else, process the single day bucket - we only do this once per day
}
elseif ($index == $multi_count) {
$single_day_cnt = 0;
// If it's empty, add class
if (count($singleday_buckets[$wday]) == 0) {
$single_days = "&nbsp;";
if ($max_multirow_cnt == 0 ) {
$class = ($multi_count > 0 ) ? 'single-day no-entry noentry-multi-day' : 'single-day no-entry';
}
else {
$class = 'single-day';
}
}
else {
$single_days = "";
foreach ($singleday_buckets[$wday] as $day) {
foreach ($day as $event) {
$single_day_cnt++;
$single_days .= (isset($event['more_link'])) ? '<div class="calendar-more">' . $event['entry'] . '</div>' : $event['entry'];
}
}
$class = 'single-day';
}
$rowspan = $total_rows - $index;
// Add item...
$item = array(
'entry' => $single_days,
'colspan' => 1,
'rowspan' => $rowspan,
'class' => $class,
'date' => $curday_date,
'id' => $view->name . '-' . $curday_date . '-' . $index
);
// Hack for ie to help it properly space single day rows
if ($rowspan > 1 && $in_month && $single_day_cnt > 0) {
$max_multirow_cnt = max($max_multirow_cnt, $single_day_cnt);
}
else {
$max_singlerow_cnt = max($max_singlerow_cnt, $single_day_cnt);
}
// If the singlerow is bigger than the multi-row, then null out
// ieheight - I'm estimating that a single row is twice the size of
// multi-row. This is really the best that can be done with ie
if ($max_singlerow_cnt >= $max_multirow_cnt || $max_multirow_cnt <= $multi_count / 2 ) {
$iehint = 0;
}
elseif ($rowspan > 1 && $in_month && $single_day_cnt > 0) {
$iehint = max($iehint, $rowspan - 1); // How many rows to adjust for?
}
// Set the class
$item['class'] .= ($curday_date == $today && $in_month ? ' today' : '') .
($curday_date < $today ? ' past' : '') .
($curday_date > $today ? ' future' : '');
}
}
// If there isn't an item, then add empty class
if ($item != NULL) {
if (!$in_month) {
$item['class'] .= ' empty';
}
// Style this entry - it will be a <td>.
$inner .= theme('calendar_month_col', $item);
}
date_modify($curday, '+1 day');
}
if ($i == 0) {
$output .= theme('calendar_month_row', $inner, 'date-box', $iehint);
}
elseif ($i == $total_rows) {
$output .= theme('calendar_month_row', $inner, 'single-day', $iehint);
$iehint = 0;
$max_singlerow_cnt = 0;
$max_multirow_cnt = 0;
}
else {
// Style all the columns into a row
$output .= theme('calendar_month_row', $inner, 'multi-day');
}
}
$curday = $final_day;
// Add the row into the row array....
$rows[] = array('data' => $output);
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$curday_month = date_format($curday, 'n');
} while ($curday_month == $month && $curday_date <= $view->date_info->max_date_date);
// Merge the day names in as the first row.
$rows = array_merge(array(calendar_week_header($view)), $rows);
return $rows;
}
/**
* Build one week row.
*/
function calendar_build_mini_week(&$curday, $view, $items, $check_month = FALSE) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$weekdays = calendar_untranslated_days($items, $view);
$today = date_format(date_now(date_default_timezone_name()), DATE_FORMAT_DATE);
$month = date_format($curday, 'n');
$week = date_week($curday_date);
$first_day = variable_get('date_first_day', 0);
// move backwards to the first day of the week
$day_wday = date_format($curday, 'w');
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
$curday_date = date_format($curday, DATE_FORMAT_DATE);
// If we're displaying the week number, add it as the
// first cell in the week.
if (!empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', 'week'))) {
$url = date_real_url($view, NULL, $view->date_info->year .'-W'. $week);
if (!empty($view->date_info->display_types['week'])) {
$weekno = l($week, $url, array('query' => !empty($view->date_info->append) ? $view->date_info->append : ''));
}
else {
// Do not link week numbers, if Week views are disabled.
$weekno = $week;
}
$rows[$week][] = array(
'data' => $weekno,
'id' => $view->name . '-weekno-' . $curday_date,
'class' => 'week');
}
for ($i = 0; $i < 7; $i++) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$class = strtolower($weekdays[$i] . ' mini');
if ($check_month && ($curday_date < $view->date_info->min_date_date || $curday_date > $view->date_info->max_date_date || date_format($curday, 'n') != $month)) {
$class .= ' empty';
$content = array(
'date' => '',
'datebox' => '',
'empty' => theme('calendar_empty_day', $curday_date, $view),
'link' => '',
'all_day' => array(),
'items' => array(),
);
}
else {
$content = calendar_build_day($curday, $view, $items);
$class .= ($curday_date == $today ? ' today' : '') .
($curday_date < $today ? ' past' : '') .
($curday_date > $today ? ' future' : '') .
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
}
$rows[$week][] = array(
'data' => $content,
'class' => $class, 'id' => $view->name . '-' . $curday_date);
date_modify($curday, '+1 day');
}
return $rows;
}
/**
* Build one week row.
*/
function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$weekdays = calendar_untranslated_days($items, $view);
$month = date_format($curday, 'n');
$first_day = variable_get('date_first_day', 0);
// Set up buckets
$total_rows = 0;
$multiday_buckets = array( array(), array(), array(), array(), array(), array(), array());
$singleday_buckets = array( array(), array(), array(), array(), array(), array(), array());
// move backwards to the first day of the week
$day_wday = date_format($curday, 'w');
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
$curday_date = date_format($curday, DATE_FORMAT_DATE);
for ($i = 0; $i < 7; $i++) {
if ($check_month && ($curday_date < $view->date_info->min_date_date || $curday_date > $view->date_info->max_date_date || date_format($curday, 'n') != $month)) {
$class = strtolower($weekdays[$i]) .' empty';
$singleday_buckets[$i][][] = array(
'entry' => theme('calendar_empty_day', $curday_date, $view),
'item' => NULL
);
}
else {
calendar_build_week_day($curday, $view, $items, $i, $multiday_buckets, $singleday_buckets);
}
$total_rows = max(count($multiday_buckets[$i]) + 1, $total_rows);
date_modify($curday, '+1 day');
$curday_date = date_format($curday, DATE_FORMAT_DATE);
}
$rows = array(
'multiday_buckets' => $multiday_buckets,
'singleday_buckets' => $singleday_buckets,
'total_rows' => $total_rows);
return $rows;
}
/**
* Build the contents of a single day for the $rows results.
*/
function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_buckets, &$singleday_buckets) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$max_events = !empty($view->date_info->style_max_items) ? $view->date_info->style_max_items : 0;
$hide = !empty($view->date_info->style_max_items_behavior) ? ($view->date_info->style_max_items_behavior == 'hide') : FALSE;
$multiday_theme = ($view->date_info->style_multiday_theme == '1');
$cur_cnt = 0;
$total_cnt = 0;
$types = array();
// If we are hiding, count before processing further
if ($max_events != CALENDAR_SHOW_ALL) {
foreach ($items as $date => $day) {
if ($date == $curday_date) {
foreach ($day as $time => $hour) {
foreach ($hour as $key => $item) {
$total_cnt++;
$types[$item->type] = $item;
}
}
}
}
}
// If we haven't already exceeded the max or we'll showing all, then process the items
if ($max_events == CALENDAR_SHOW_ALL || !$hide || $total_cnt <= $max_events) {
// Count currently filled items
foreach ($multiday_buckets[$wday] as $bucket) {
if (!$bucket['avail']) {
$cur_cnt++;
}
}
foreach ($items as $date => $day) {
if ($date == $curday_date) {
$count = 0;
ksort($day);
foreach ($day as $time => $hour) {
foreach ($hour as $key => $item) {
$count++;
// Can we add an item?
if ($max_events == CALENDAR_SHOW_ALL || $cur_cnt <= $max_events) {
$all_day = $item->calendar_start_date == $item->calendar_end_date;
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
// Parse out date part
$start_ydate = date_format($item->date_start, DATE_FORMAT_DATE);
$end_ydate = date_format($item->date_end, DATE_FORMAT_DATE);
$cur_ydate = date_format($curday, DATE_FORMAT_DATE);
$is_multi_day = ($start_ydate < $cur_ydate || $end_ydate > $cur_ydate);
// Does this event span multi-days?
if ($multiday_theme && ($is_multi_day || $all_day)) {
// If this the first day of the week, or is the start date of the multi-day event,
// then record this item, otherwise skip over
$day_no = date_format($curday, 'd');
if ($wday == 0 || $start_ydate == $cur_ydate || ($view->date_info->granularity == 'month' && $day_no == 1) || ($all_day && !$is_multi_day)) {
$cur_cnt++;
// Calculate the colspan for this event
// If the last day of this event exceeds the end of the current month or week,
// truncate the remaining days
$diff = date_difference($view->date_info->max_date, $curday, 'days');
$remaining_days = ($view->date_info->granularity == 'month') ? min(6 - $wday, $diff) : $diff - 1;
// The bucket_cnt defines the colspan. colspan = bucket_cnt + 1
$days = date_difference($curday, $item->date_end, 'days');
$bucket_cnt = max(0, min($days, $remaining_days));
// See if there is an avaiable slot to add an event. This will allow
// an event to precede a row filled up by a previous day event
$avail = FALSE;
$bucket_index = count($multiday_buckets[$wday]);
for ($i = 0; $i < $bucket_index; $i++) {
if ($multiday_buckets[$wday][$i]['avail']) {
$bucket_index = $i;
break;
}
}
// Add continuation attributes
$item->continuation = ($item->date_start < $curday);
$item->continues = ( $days > $bucket_cnt );
// Assign the item to the available bucket
$multiday_buckets[$wday][$bucket_index] = array(
'colspan' => $bucket_cnt + 1,
'rowspan' => 1,
'filled' => TRUE,
'avail' => FALSE,
'all_day' => $all_day,
'item' => $item,
'wday' => $wday,
'entry' => theme($theme, $item, $view)
);
// Block out empty buckets for the next days in this event for this week
for ($i = 0; $i < $bucket_cnt; $i++) {
$bucket = &$multiday_buckets[$i + $wday + 1];
$bucket_row_count = count($bucket);
$row_diff = $bucket_index - $bucket_row_count;
// Fill up the preceding buckets - these are available for future
// events
for ( $j = 0; $j < $row_diff; $j++) {
$bucket[($bucket_row_count + $j) ] = array(
'entry' => '&nbsp;',
'colspan' => 1,
'rowspan' => 1,
'filled' => TRUE,
'avail' => TRUE,
'wday' => $wday,
'item' => NULL
);
}
$bucket[$bucket_index] = array(
'filled' => FALSE,
'avail' => FALSE
);
}
}
}
else {
$cur_cnt++;
// Assign to single day bucket
$singleday_buckets[$wday][$time][] = array(
'entry' => theme($theme, $item, $view),
'item' => $item,
'colspan' => 1,
'rowspan' => 1,
'filled' => TRUE,
'avail' => FALSE,
'wday' => $wday,
);
}
}
else {
break; // exceeded count
}
}
}
}
}
}
// Add a more link if necessary
if ($max_events != CALENDAR_SHOW_ALL && $total_cnt > 0 && $cur_cnt < $total_cnt) {
$singleday_buckets[$wday][][] = array(
'entry' => theme('calendar_'. $view->date_info->calendar_type .'_multiple_node', $curday_date, $total_cnt, $view, $types),
'more_link' => TRUE,
'item' => NULL
);
}
}
/**
* Build the contents of a single day for the $rows results.
*/
function calendar_build_day($curday, $view, $items) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$selected = FALSE;
$max_events = !empty($view->date_info->style_max_items) ? $view->date_info->style_max_items : 0;
$types = array();
$inner = array();
$all_day = array();
$empty = '';
$link = '';
$count = 0;
foreach ($items as $date => $day) {
if ($date == $curday_date) {
$count = 0;
$selected = TRUE;
ksort($day);
foreach ($day as $time => $hour) {
foreach ($hour as $key => $item) {
$count++;
$types[$item->type] = $item;
if (!$view->date_info->mini && ($max_events == CALENDAR_SHOW_ALL || $count <= $max_events || ($count > 0 && $max_events == CALENDAR_HIDE_ALL))) {
// Theme the item here unless this is a 'Day' or 'Week' view.
// Day and week views need to do more processing before rendering
// the item, so just past them the unrendered item.
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
if ($item->calendar_all_day) {
$all_day[] = in_array($view->date_info->calendar_type, array('day', 'week')) ? $item : theme($theme, $item, $view);
}
else {
$key = date_format($item->date_start, 'H:i:s');
$inner[$key][] = in_array($view->date_info->calendar_type, array('day', 'week')) ? $item : theme($theme, $item, $view);
}
}
}
}
}
}
ksort($inner);
if (empty($inner) && empty($all_day)) {
$empty = theme('calendar_empty_day', $curday_date, $view);
}
// We have hidden events on this day, use the theme('calendar_multiple_') to show a link.
if ($max_events != CALENDAR_SHOW_ALL && $count > 0 && $count > $max_events && $view->date_info->calendar_type != 'day' && !$view->date_info->mini) {
if ($view->date_info->style_max_items_behavior == 'hide' || $max_events == CALENDAR_HIDE_ALL) {
$all_day = array();
$inner = array();
}
$link = theme('calendar_'. $view->date_info->calendar_type .'_multiple_node', $curday_date, $count, $view, $types);
}
$content = array(
'date' => $curday_date,
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
'empty' => $empty,
'link' => $link,
'all_day' => $all_day,
'items' => $inner,
);
return $content;
}

View file

@ -0,0 +1,19 @@
<?php
// $Id: calendar-datebox.tpl.php,v 1.1.2.2 2010/12/31 14:16:12 karens Exp $
/**
* @file
* Template to display the date box in a calendar.
*
* - $view: The view.
* - $granularity: The type of calendar this box is in -- year, month, day, or week.
* - $mini: Whether or not this is a mini calendar.
* - $class: The class for this box -- mini-on, mini-off, or day.
* - $day: The day of the month.
* - $date: The current date, in the form YYYY-MM-DD.
* - $link: A formatted link to the calendar day view for this day.
* - $url: The url to the calendar day view for this day.
* - $selected: Whether or not this day has any items.
* - $items: An array of items for this day.
*/
?>
<div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print !empty($selected) ? $link : $day; ?> </div>

View file

@ -0,0 +1,58 @@
<?php
// $Id: calendar-day-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
/**
* @file
* Template to display a view item as a calendar day node.
*
* $node
* A node object for this calendar item. Note this is
* not a complete node object, but it will have $node->nid
* that you can use to load the full object, and
* $node->type to tell the content type of the node.
*
* $fields
* An array of information for every field selected in the 'Fields'
* section of this view, formatted as requested in the View setup.
*
* Calendar info for this individual calendar item is in local time --
* the user timezone where configurable timezones are allowed and set,
* otherwise the site timezone. If this item has extends over more than
* one day, it has been broken apart into separate nodes for each calendar
* date and calendar_start will be no earlier than the start of
* the current day and calendar_end will be no later than the end
* of the current day.
*
* $calendar_start - A formatted datetime start date for this item.
* i.e. '2008-05-12 05:26:15'.
* $calendar_end - A formatted datetime end date for this item,
* the same as the start date except for fields that have from/to
* fields defined, like Date module dates.
* $calendar_start_date - a PHP date object for the start time.
* $calendar_end_date - a PHP date object for the end time.
*
* You can use PHP date functions on the date object to display date
* information in other ways, like:
*
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
*
* @see template_preprocess_calendar_day_node.
*/
$node_class = (isset($node->class)) ? ' ' . $node->class : '';
?>
<div class="item<?php print $node_class?>">
<div class="view-item view-item-<?php print $view->name ?>">
<div class="calendar dayview">
<?php print theme('calendar_stripe_stripe', $node); ?>
<div class="<?php print $node->date_id ?> contents">
<?php foreach ($fields as $field): ?>
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
<?php if ($field['label']): ?>
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
<?php endif; ?>
<?php print $field['data']; ?>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,135 @@
<?php
// $Id: calendar-day-overlap.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a calendar day, grouped by time with overlapping items
*
* @see template_preprocess_calendar_day.
*
* $rows: The rendered data for this day.
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
* $rows['datebox'] - the formatted datebox for this day.
* $rows['empty'] - empty text for this day, if no items were found.
* $rows['all_day'] - an array of formatted all day items.
* $rows['items'] - an array of timed items for the day.
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
* $rows['items'][$time_period][$column]['values'] - An array of formatted
* items for a time period and field column.
*
* $view: The view.
* $columns: an array of column names.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
* The width of the columns is dynamically set using <col></col>
* based on the number of columns presented. The values passed in will
* work to set the 'hour' column to 10% and split the remaining columns
* evenly over the remaining 90% of the table.
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="day-view">
<div id="multi-day-container">
<table class="full">
<tbody>
<tr class="holder">
<td class="calendar-time-holder"></td>
<td class="calendar-day-holder"></td>
</tr>
<tr>
<td class="<?php print $agenda_hour_class ?> first">
<span class="calendar-hour"><?php print date_t('All day', 'datetime') ?></span>
</td>
<td class="calendar-agenda-items multi-day last">
<?php foreach ($columns as $column): ?>
<div class="calendar">
<div class="inner">
<?php print isset($rows['all_day'][$column]) ? implode($rows['all_day'][$column]) : '&nbsp;';?>
</div>
</div>
<?php endforeach; ?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="header-body-divider">&nbsp;</div>
<div id="single-day-container">
<script>
try {
// Hide container while it renders... Degrade w/o javascript support
$('#single-day-container').css('visibility','hidden');
}catch(e){
// swallow
}
</script>
<table class="full">
<tbody>
<tr class="holder">
<td class="calendar-time-holder"></td>
<td class="calendar-day-holder"></td>
</tr>
<tr>
<td class="first">
<?php $is_first = TRUE; ?>
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
<?php
if ($time_cnt == 0) {
$class = 'first ';
}
elseif ($time_cnt == count($start_times) - 1) {
$class = 'last ';
}
else {
$class = '';
} ?>
<div class="<?php print $class?>calendar-agenda-hour">
<span class="calendar-hour"><?php print $hour['hour']; ?></span>
<span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
</div>
<?php endforeach; ?>
</td>
<td class="last">
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
<?php
if ($time_cnt == 0) {
$class = 'first ';
}
elseif ($time_cnt == count($start_times) - 1) {
$class = 'last ';
}
else {
$class = '';
} ?>
<div class="<?php print $class?>calendar-agenda-items single-day">
<div class="half-hour">&nbsp;</div>
<?php if ($is_first && isset($hour['values'][$column])) :?>
<div class="calendar item-wrapper first_item">
<?php $is_first = FALSE; ?>
<?php else : ?>
<div class="calendar item-wrapper">
<?php endif; ?>
<div class="inner">
<?php print isset($hour['values'][$column]) ? implode($hour['values'][$column]) : '&nbsp;'; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="single-day-footer">&nbsp;</div>
</div></div>
<script>
try {
// Size and position the viewport inline so there are no delays
calendar_resizeViewport();
calendar_scrollToFirst();
$('#single-day-container').css('visibility','visible');
}catch(e){
// swallow
}
</script>

View file

@ -0,0 +1,81 @@
<?php
// $Id: calendar-day.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a calendar day, grouped by time
* and optionally organized into columns by a field value.
*
* @see template_preprocess_calendar_day.
*
* $rows: The rendered data for this day.
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
* $rows['datebox'] - the formatted datebox for this day.
* $rows['empty'] - empty text for this day, if no items were found.
* $rows['all_day'] - an array of formatted all day items.
* $rows['items'] - an array of timed items for the day.
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
* $rows['items'][$time_period][$column]['values'] - An array of formatted
* items for a time period and field column.
*
* $view: The view.
* $columns: an array of column names.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
* The width of the columns is dynamically set using <col></col>
* based on the number of columns presented. The values passed in will
* work to set the 'hour' column to 10% and split the remaining columns
* evenly over the remaining 90% of the table.
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="day-view">
<table class="full">
<col width="<?php print $first_column_width?>"></col>
<thead>
<?php foreach ($columns as $column): ?>
<col width="<?php print $column_width; ?>%"></col>
<?php endforeach; ?>
<tr>
<th class="calendar-dayview-hour"><?php print $by_hour_count > 0 ? t('Time') : ''; ?></th>
<?php foreach ($columns as $column): ?>
<th class="calendar-agenda-items"><?php print $column; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<td class="<?php print $agenda_hour_class ?>">
<span class="calendar-hour"><?php print $by_hour_count > 0 ? date_t('All day', 'datetime') : ''; ?></span>
</td>
<?php foreach ($columns as $column): ?>
<td class="calendar-agenda-items multi-day">
<div class="calendar">
<div class="inner">
<?php print isset($rows['all_day'][$column]) ? implode($rows['all_day'][$column]) : '&nbsp;';?>
</div>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php foreach ($rows['items'] as $hour): ?>
<tr>
<td class="calendar-agenda-hour">
<span class="calendar-hour"><?php print $hour['hour']; ?></span>
<span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
</td>
<?php foreach ($columns as $column): ?>
<td class="calendar-agenda-items single-day">
<div class="calendar">
<div class="inner">
<?php print isset($hour['values'][$column]) ? implode($hour['values'][$column]) : '&nbsp;'; ?>
</div>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,26 @@
<?php
// $Id: calendar-main.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display calendar navigation and links.
*
* @see template_preprocess_calendar_main.
*
* $view: The view.
* $calendar_links: Array of formatted links to other calendar displays - year, month, week, day.
* $calendar_popup: The popup calendar date selector.
* $display_type: year, month, day, or week.
* $mini: Whether this is a mini view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar">
<?php if (!empty($calendar_popup)) print $calendar_popup;?>
<?php if (!empty($calendar_add_date)) print $calendar_add_date; ?>
<?php if (empty($block)) print theme('links', $calendar_links);?>
<?php print theme('date_navigation', $view) ?>
</div>

View file

@ -0,0 +1,47 @@
<?php
// $Id: calendar-mini.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a mini calendar month.
*
* @see template_preprocess_calendar_mini.
*
* $day_names: An array of the day of week names for the table header.
* $rows: An array of data for each day of the week.
* $view: The view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
* $show_title: If the title should be displayed. Normally false since the title is incorporated
* into the navigation, but sometimes needed, like in the year view of mini calendars.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="month-view">
<?php if ($view->date_info->show_title): ?>
<?php print theme('date_navigation', $view); ?>
<?php endif; ?>
<table class="mini">
<thead>
<tr>
<?php foreach ($day_names as $cell): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ((array) $rows as $row): ?>
<tr>
<?php foreach ($row as $cell): ?>
<td id="<?php print $cell['id']; ?>" class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,16 @@
<?php
// $Id: calendar-month-col.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a column
*
* - $item: The item to render within a td element.
*/
$id = (isset($item['id'])) ? 'id="' . $item['id'] . '" ' : '';
$date = (isset($item['date'])) ? 'date="' . $item['date'] . '" ' : '';
?>
<td <?php print $id?>class="<?php print $item['class'] ?>" colspan="<?php print $item['colspan'] ?>" rowspan="<?php print $item['rowspan'] ?>"<?php print $date ?>>
<div class="inner">
<?php print $item['entry'] ?>
</div>
</td>

View file

@ -0,0 +1,28 @@
<?php
// $Id: calendar-month-multiple-node.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a summary of the days items as a calendar month node.
*
*
* @see template_preprocess_calendar_month_multiple_node.
*/
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="calendar monthview" id="<?php print $curday ?>">
<?php foreach ($types as $type): ?>
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<?php print theme('calendar_stripe_stripe', $type); ?>
<?php endif; ?>
<?php endforeach; ?>
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<div class="multiple-events">
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
</div>
</div>
<?php else: ?>
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
<?php endif; ?>
</div>
</div>

View file

@ -0,0 +1,64 @@
<?php
// $Id: calendar-month-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
/**
* @file
* Template to display a view item as a calendar month node.
*
* $node
* A node object for this calendar item. Note this is
* not a complete node object, but it will have $node->nid
* that you can use to load the full object, and
* $node->type to tell the content type of the node.
*
* $fields
* An array of information for every field selected in the 'Fields'
* section of this view, formatted as requested in the View setup.
*
* Calendar info for this individual calendar item is in local time --
* the user timezone where configurable timezones are allowed and set,
* otherwise the site timezone. If this item has extends over more than
* one day, it has been broken apart into separate nodes for each calendar
* date and calendar_start will be no earlier than the start of
* the current day and calendar_end will be no later than the end
* of the current day.
*
* $calendar_start - A formatted datetime start date for this item.
* i.e. '2008-05-12 05:26:15'.
* $calendar_end - A formatted datetime end date for this item,
* the same as the start date except for fields that have from/to
* fields defined, like Date module dates.
* $calendar_start_date - a PHP date object for the start time.
* $calendar_end_date - a PHP date object for the end time.
*
* You can use PHP date functions on the date object to display date
* information in other ways, like:
*
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
*
* @see template_preprocess_calendar_month_node.
*/
$index = 0;
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="calendar monthview">
<?php print theme('calendar_stripe_stripe', $node); ?>
<div class="<?php print $node->date_id ?> contents">
<?php foreach ($fields as $field): ?>
<?php if ($index++ == 0 && (isset($node->continuation) && $node->continuation)) : ?>
<div class="continuation">&laquo;</div>
<?php endif;?>
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
<?php if ($field['label']): ?>
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
<?php endif; ?>
<?php print $field['data']; ?>
</div>
<?php endforeach; ?>
</div>
<?php if (isset($node->continues) && $node->continues) : ?>
<div class="continues">&raquo;</div>
<?php else : ?>
<div class="cutoff">&nbsp;</div>
<?php endif;?>
</div>
</div>

View file

@ -0,0 +1,18 @@
<?php
// $Id: calendar-month-row.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a row
*
* - $inner: The rendered string of the row's contents.
*/
$attrs = ($class) ? 'class="' . $class . '"': '';
$attrs .= ($iehint > 0) ? ' iehint="' . $iehint . '"' : '';
?>
<?php if ($attrs != ''):?>
<tr <?php print $attrs?>>
<?php else:?>
<tr>
<?php endif;?>
<?php print $inner ?>
</tr>

View file

@ -0,0 +1,57 @@
<?php
// $Id: calendar-month.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a calendar month.
*
* @see template_preprocess_calendar_month.
*
* $day_names: An array of the day of week names for the table header.
* $rows: An array of data for each day of the week.
* $view: The view.
* $calendar_links: Array of formatted links to other calendar displays - year, month, week, day.
* $display_type: year, month, day, or week.
* $block: Whether or not this calendar is in a block.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $date_id: a css id that is unique for this date,
* it is in the form: calendar-nid-field_name-delta
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="month-view">
<table class="full">
<thead>
<tr>
<?php foreach ($day_names as $cell): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php
foreach ((array) $rows as $row) {
print $row['data'];
} ?>
</tbody>
</table>
</div></div>
<script>
try {
// ie hack to make the single day row expand to available space
if ($.browser.msie ) {
var multiday_height = $('tr.multi-day')[0].clientHeight; // Height of a multi-day row
$('tr[iehint]').each(function(index) {
var iehint = this.getAttribute('iehint');
// Add height of the multi day rows to the single day row - seems that 80% height works best
var height = this.clientHeight + (multiday_height * .8 * iehint);
this.style.height = height + 'px';
});
}
}catch(e){
// swallow
}
</script>

View file

@ -0,0 +1,27 @@
<?php
// $Id: calendar-week-multiple-node.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a summary of the days items as a calendar week node.
*
* @see template_preprocess_calendar_week_multiple_node.
*/
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="calendar weekview" id="<?php print $curday ?>">
<?php foreach ($types as $type): ?>
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<?php print theme('calendar_stripe_stripe', $type); ?>
<?php endif; ?>
<?php endforeach; ?>
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<div class="multiple-events">
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
</div>
</div>
<?php else: ?>
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
<?php endif; ?>
</div>
</div>

View file

@ -0,0 +1,64 @@
<?php
// $Id: calendar-week-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
/**
* @file
* Template to display a view item as a calendar week node.
*
* $node
* A node object for this calendar item. Note this is
* not a complete node object, but it will have $node->nid
* that you can use to load the full object, and
* $node->type to tell the content type of the node.
*
* $fields
* An array of information for every field selected in the 'Fields'
* section of this view, formatted as requested in the View setup.
*
* Calendar info for this individual calendar item is in local time --
* the user timezone where configurable timezones are allowed and set,
* otherwise the site timezone. If this item has extends over more than
* one day, it has been broken apart into separate nodes for each calendar
* date and calendar_start will be no earlier than the start of
* the current day and calendar_end will be no later than the end
* of the current day.
*
* $calendar_start - A formatted datetime start date for this item.
* i.e. '2008-05-12 05:26:15'.
* $calendar_end - A formatted datetime end date for this item,
* the same as the start date except for fields that have from/to
* fields defined, like Date module dates.
* $calendar_start_date - a PHP date object for the start time.
* $calendar_end_date - a PHP date object for the end time.
*
* You can use PHP date functions on the date object to display date
* information in other ways, like:
*
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
*
* @see template_preprocess_calendar_week_node.
*/
$index = 0;
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="calendar weekview">
<?php print theme('calendar_stripe_stripe', $node); ?>
<div class="<?php print $node->date_id ?> contents">
<?php foreach ($fields as $field): ?>
<?php if ($index++ == 0 && (isset($node->continuation) && $node->continuation)) : ?>
<div class="continuation">&laquo;</div>
<?php endif;?>
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
<?php if ($field['label']): ?>
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
<?php endif; ?>
<?php print $field['data']; ?>
</div>
<?php endforeach; ?>
</div>
<?php if (isset($node->continues) && $node->continues) : ?>
<div class="continues">&raquo;</div>
<?php else : ?>
<div class="cutoff">&nbsp;</div>
<?php endif;?>
</div>
</div>

View file

@ -0,0 +1,188 @@
<?php
// $Id: calendar-week-overlap.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a calendar week with overlapping items
*
* @see template_preprocess_calendar_week.
*
* $day_names: An array of the day of week names for the table header.
* $rows: The rendered data for this week.
*
* For each day of the week, you have:
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
* $rows['datebox'] - the formatted datebox for this day.
* $rows['empty'] - empty text for this day, if no items were found.
* $rows['all_day'] - an array of formatted all day items.
* $rows['items'] - an array of timed items for the day.
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
*
* $view: The view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
//dsm($rows);
//dsm($items);
?>
<div class="calendar-calendar"><div class="week-view">
<div id="header-container">
<table class="full">
<tbody>
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
<tr>
<th class="calendar-agenda-hour">&nbsp;</th>
<?php foreach ($day_names as $cell): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endforeach; ?>
</tr>
</tbody>
</table>
</div>
<div id="multi-day-container">
<table class="full">
<tbody>
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
<?php for ($i = 0; $i < $multiday_rows; $i++): ?>
<?php
$colpos = 0;
$rowclass = "all-day";
if( $i == 0) {
$rowclass .= " first";
}
if( $i == $multiday_rows - 1) {
$rowclass .= " last";
}
?>
<tr class="<?php print $rowclass?>">
<?php if($i == 0 && ($by_hour_count > 0 || !empty($start_times))) :?>
<td class="<?php print $agenda_hour_class ?>" rowspan="<?php print $multiday_rows?>">
<span class="calendar-hour"><?php print date_t('All day', 'datetime')?></span>
</td>
<?php endif; ?>
<?php for($j = 0; $j < 6; $j++): ?>
<?php $cell = (empty($all_day[$j][$i])) ? NULL : $all_day[$j][$i]; ?>
<?php if($cell != NULL && $cell['filled'] && $cell['wday'] == $j): ?>
<?php for($k = $colpos; $k < $cell['wday']; $k++) : ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
<?php endfor;?>
<td colspan="<?php print $cell['colspan']?>" class="calendar-agenda-items multi-day">
<div class="inner">
<?php print $cell['entry']?>
</div>
</td>
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
<?php endif; ?>
<?php endfor; ?>
<?php for($j = $colpos; $j < 7; $j++) : ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
<?php endfor;?>
</tr>
<?php endfor; ?>
<?php if ($multiday_rows == 0) :?>
<tr>
<td class="<?php print $agenda_hour_class ?>">
<span class="calendar-hour"><?php print date_t('All day', 'datetime')?></span>
</td>
<?php for($j = 0; $j < 6; $j++): ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
<?php endfor; ?>
</tr>
<?php endif; ?>
<tr class="expand">
<td class="<?php print $agenda_hour_class ?>">
<span class="calendar-hour">&nbsp;</span>
</td>
<?php for($j = 0; $j < 6; $j++): ?>
<td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
<?php endfor; ?>
</tr>
</thead>
</table>
</div>
<div class="header-body-divider">&nbsp;</div>
<div id="single-day-container">
<script>
try {
// Hide container while it renders... Degrade w/o javascript support
$('#single-day-container').css('visibility','hidden');
}catch(e){
// swallow
}
</script>
<table class="full">
<tbody>
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
<tr>
<?php for ($index = 0; $index < 8; $index++): ?>
<?php if ($index == 0 ): ?>
<td class="first">
<?php elseif ($index == 7 ) : ?>
<td class="last">
<?php else : ?>
<td>
<?php endif; ?>
<?php foreach ($start_times as $time_cnt => $start_time): ?>
<?php
if ($time_cnt == 0) {
$class = 'first ';
}
elseif ($time_cnt == count($start_times) - 1) {
$class = 'last ';
}
else {
$class = '';
} ?>
<?php if( $index == 0 ): ?>
<?php $time = $items[$start_time];?>
<div class="<?php print $class?>calendar-agenda-hour">
<span class="calendar-hour"><?php print $time['hour']; ?></span>
<span class="calendar-ampm"><?php print $time['ampm']; ?></span>
</div>
<?php else: ?>
<div class="<?php print $class?>calendar-agenda-items single-day">
<div class="half-hour">&nbsp;</div>
<div class="calendar item-wrapper">
<div class="inner">
<?php if(!empty($items[$start_time]['values'][$index - 1])) :?>
<?php foreach($items[$start_time]['values'][$index - 1] as $item) :?>
<?php if (isset($item['is_first']) && $item['is_first']) :?>
<div class="item <?php print $item['class']?> first_item">
<?php else : ?>
<div class="item <?php print $item['class']?>">
<?php endif; ?>
<?php print $item['entry'] ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach;?>
</td>
<?php endfor;?>
</tr>
</tbody>
</table>
</div>
<div class="single-day-footer">&nbsp;</div>
</div></div>
<script>
try {
// Size and position the viewport inline so there are no delays
calendar_resizeViewport();
calendar_scrollToFirst();
// Show it now that it is complete and positioned
$('#single-day-container').css('visibility','visible');
}catch(e){
// swallow
}
</script>

View file

@ -0,0 +1,124 @@
<?php
// $Id: calendar-week.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a calendar week.
*
* @see template_preprocess_calendar_week.
*
* $day_names: An array of the day of week names for the table header.
* $rows: The rendered data for this week.
*
* For each day of the week, you have:
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
* $rows['datebox'] - the formatted datebox for this day.
* $rows['empty'] - empty text for this day, if no items were found.
* $rows['all_day'] - an array of formatted all day items.
* $rows['items'] - an array of timed items for the day.
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
*
* $view: The view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
//dsm($rows);
//dsm($items);
$index = 0;
?>
<div class="calendar-calendar"><div class="week-view">
<table class="full">
<thead>
<tr>
<?php if($by_hour_count > 0 || !empty($start_times)) :?>
<th class="calendar-agenda-hour"><?php print t('Time')?></th>
<?php endif;?>
<?php foreach ($day_names as $cell): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php for ($i = 0; $i < $multiday_rows; $i++): ?>
<?php
$colpos = 0;
$rowclass = "all-day";
if( $i == 0) {
$rowclass .= " first";
}
if( $i == $multiday_rows - 1) {
$rowclass .= " last";
}
?>
<tr class="<?php print $rowclass?>">
<?php if($i == 0 && ($by_hour_count > 0 || !empty($start_times))) :?>
<td class="<?php print $agenda_hour_class ?>" rowspan="<?php print $multiday_rows?>">
<span class="calendar-hour"><?php print date_t('All day', 'datetime')?></span>
</td>
<?php endif; ?>
<?php for($j = 0; $j < 6; $j++): ?>
<?php $cell = (empty($all_day[$j][$i])) ? NULL : $all_day[$j][$i]; ?>
<?php if($cell != NULL && $cell['filled'] && $cell['wday'] == $j): ?>
<?php for($k = $colpos; $k < $cell['wday']; $k++) : ?>
<td class="multi-day no-entry"><div class="inner">&nbsp;</div></td>
<?php endfor;?>
<td colspan="<?php print $cell['colspan']?>" class="multi-day">
<div class="inner">
<?php print $cell['entry']?>
</div>
</td>
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
<?php endif; ?>
<?php endfor; ?>
<?php for($j = $colpos; $j < 7; $j++) : ?>
<td class="multi-day no-entry"><div class="inner">&nbsp;</div></td>
<?php endfor;?>
</tr>
<?php endfor; ?>
<?php foreach ($items as $time): ?>
<tr class="not-all-day">
<td class="calendar-agenda-hour">
<span class="calendar-hour"><?php print $time['hour']; ?></span>
<span class="calendar-ampm"><?php print $time['ampm']; ?></span>
</td>
<?php $curpos = 0; ?>
<?php foreach ($columns as $index => $column): ?>
<?php $colpos = (isset($time['values'][$column][0])) ? $time['values'][$column][0]['wday'] : $index; ?>
<?php for ($i = $curpos; $i < $colpos; $i++): ?>
<td class="calendar-agenda-items single-day">
<div class="calendar">
<div class="inner">&nbsp</div>
</div>
</td>
<?php endfor; ?>
<?php $curpos = $colpos + 1;?>
<td class="calendar-agenda-items single-day">
<div class="calendar">
<div class="inner">
<?php if(!empty($time['values'][$column])) :?>
<?php foreach($time['values'][$column] as $item) :?>
<?php print $item['entry'] ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</td>
<?php endforeach; ?>
<?php for ($i = $curpos; $i < 7; $i++): ?>
<td class="calendar-agenda-items single-day">
<div class="calendar">
<div class="inner">&nbsp</div>
</div>
</td>
<?php endfor; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,27 @@
<?php
// $Id: calendar-year.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
/**
* @file
* Template to display a view as a calendar year.
*
* @see template_preprocess_calendar_year.
*
* $view: The view.
* $months: An array with a formatted month calendar for each month of the year.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="year-view">
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
<tbody>
<tr><td><?php print $months[1] ?></td><td><?php print $months[2] ?></td><td><?php print $months[3] ?></td></tr>
<tr><td><?php print $months[4] ?></td><td><?php print $months[5] ?></td><td><?php print $months[6] ?></td></tr>
<tr><td><?php print $months[7] ?></td><td><?php print $months[8] ?></td><td><?php print $months[9] ?></td></tr>
<tr><td><?php print $months[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,972 @@
<?php
// $Id: theme.inc,v 1.1.2.4 2011/01/03 12:28:48 karens Exp $
/**
* Display a calendar navigation and links
*/
function template_preprocess_calendar_main(&$vars) {
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
$view = $vars['view'];
$result = (array) $view->result;
$options = $view->style_plugin->options;
$handler = $view->style_plugin;
$vars['display_type'] = $view->date_info->granularity;
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
$view->date_info->mini = isset($view->date_info->mini) ? $view->date_info->mini : $view->date_info->granularity == 'year';
$url = $view->get_url();
$view->date_info->url = $url;
$arg = $view->date_info->date_arg;
$displays = $view->date_info->display_types;
// Set up the links to other calendar views.
$current_date = $view->date_info->min_date;
if (!empty($date->info->day)) {
$current_date = date_make_date($date_info->date_arg .' 00:00:00');
}
elseif (!empty($view->date_info->week)) {
$week = date_week_range($view->date_info->week, $view->date_info->year);
$current_date = $week[0];
}
elseif (!empty($view->date_info->month)) {
$current_date = date_make_date($view->date_info->year .'-'. date_pad($view->date_info->month) .'-01 00:00:00');
}
else {
$current_date = date_make_date($view->date_info->year .'-01-01 00:00:00');
}
if (empty($view->date_info->month) || $view->date_info->month == $view->argument['date_argument']->options['wildcard']) {
$view->date_info->month = date_format($current_date, 'm');
}
if (empty($view->date_info->day) || $view->date_info->day == $view->argument['date_argument']->options['wildcard']) {
$view->date_info->day = date_format($current_date, 'd');
}
if (empty($view->date_info->week) || $view->date_info->week == $view->argument['date_argument']->options['wildcard']) {
$view->date_info->week = date_week($view->date_info->year .'-'. date_pad($view->date_info->month) .'-'. date_pad($view->date_info->day));
}
$calendar_links = array();
$base = array('attributes' => array('rel' => 'nofollow'));
if (!empty($displays['year'])) {
$calendar_links[] = $base + array('title' => date_t('Year', 'datetime'), 'href' => date_real_url($view, 'year'));
}
if (!empty($displays['month'])) {
$calendar_links[] = $base + array('title' => date_t('Month', 'datetime'), 'href' => date_real_url($view, 'month'));
}
if (!empty($displays['week'])) {
$calendar_links[] = $base + array('title' => date_t('Week', 'datetime'), 'href' => date_real_url($view, 'week'));
}
if (!empty($displays['day'])) {
$calendar_links[] = $base + array('title' => date_t('Day', 'datetime'), 'href' => date_real_url($view, 'day'));
}
$vars['calendar_links'] = $calendar_links;
// If the Date Popup module is enabled, add a popup date selector.
if (!empty($view->date_info->calendar_popup)) {
$vars['calendar_popup'] = '<div class="clear-block">'. calendar_date_select($view) .'</div>';
}
// If an 'Add new ... link is provided, add it here.
// the query will bring the user back here after adding the node.
if (!empty($view->date_info->calendar_date_link) && user_access('create '. $view->date_info->calendar_date_link .' content')) {
$name = node_get_types('name', $view->date_info->calendar_date_link);
$href = 'node/add/'. str_replace('_', '-', $view->date_info->calendar_date_link);
$query = 'destination='. $view->date_info->url;
$vars['calendar_links'][] = $base + array(
'title' => t('Add+'),
'href' => $href,
'query' => $query,
);
}
$vars['view'] = $view;
$vars['mini'] = !empty($view->date_info->mini);
$vars['block'] = !empty($view->date_info->block);
$vars['block_identifier'] = date_block_identifier($view);
}
/**
* Display a view as a calendar.
*
* This preprocessor does all the work needed for all types of calendar
* views and the template takes care of displaying links to related views.
*/
function template_preprocess_calendar(&$vars) {
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
$view = $vars['view'];
// Make sure we only run through this function one time.
if (!empty($view->date_info->calendar_processed)) {
return;
}
$result = (array) $view->result;
$options = $view->style_plugin->options;
$handler = $view->style_plugin;
$fields = $view->field;
// Render each field into an output array. We have to do the rendering
// here because we don't apppear to have full access to the view
// handlers in the theme functions.
$items = array();
$calendar_fields = date_api_fields($view->base_table);
$calendar_fields = array_keys($calendar_fields['alias']);
foreach ($result as $num => $row) {
$copy = drupal_clone($row);
$items[$num] = $row;
$items[$num]->raw = $copy;
$items[$num]->calendar_fields = new stdClass();
foreach ($row as $key => $value) {
if (in_array($key, $calendar_fields)) {
$items[$num]->calendar_fields->$key = $value;
}
}
foreach ($fields as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($field) && is_object($field)) {
// Theme the copy instead of the original row so duplicate date
// fields each get a fresh copy of the original data to theme.
$items[$num]->{$field_alias} = $field->theme($copy);
}
}
foreach ($fields as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($field->options['exclude'])) {
if (isset($items[$num]->{$field_alias})) unset($items[$num]->{$field_alias});
}
}
}
$vars['display_type'] = $view->date_info->granularity;
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
// Massage the resulting items into formatted calendar items.
$items = calendar_build_nodes($view, $items);
// Merge in items from other sources.
foreach (module_implements('calendar_add_items') as $module) {
$function = $module .'_calendar_add_items';
if (function_exists($function)) {
if ($feeds = $function($view)) {
foreach ($feeds as $feed) {
$items = $feed;
}
}
}
}
$view->date_info->mini = isset($view->date_info->mini) ? $view->date_info->mini : $view->date_info->granularity == 'year';
// Create the calendar day names and rows.
$rows = calendar_build_calendar($view, $items);
$vars['items'] = $items;
$vars['rows'] = $rows;
$view->date_info->calendar_processed = TRUE;
$vars['view'] = $view;
$vars['mini'] = !empty($view->date_info->mini);
$vars['block'] = !empty($view->date_info->block);
}
/**
* Display a month view.
*/
function template_preprocess_calendar_month(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
template_preprocess_calendar($vars);
$view = $vars['view'];
$rows = $vars['rows'];
if (sizeof($rows) > 1) {
$day_names = array_shift($rows);
}
else {
$day_names = $rows;
$rows = array();
}
$month_rows = $rows;
foreach ($rows as $weekno => $row) {
foreach ($row as $day => $data) {
$cell = $data['data'];
// If this cell is already rendered, like the weekno column,
// move to the next item.
if (!is_array($cell)) {
$month_rows[$weekno][$day]['data'] = $cell;
continue;
}
$data = $cell['datebox'];
if ($cell['empty']) {
$data .= $cell['empty'];
}
else {
$data .= implode($cell['all_day']);
foreach ($cell['items'] as $hour => $item) {
$data .= implode($item);
}
$data .= $cell['link'];
}
if ($view->date_info->mini) {
$month_rows[$weekno][$day]['data'] = $data;
}
else {
$month_rows[$weekno][$day]['data'] = '<div class="inner">'. $data .'</div>';
}
}
}
$vars['rows'] = $month_rows;
$vars['day_names'] = $day_names;
$vars['display_type'] = $view->date_info->granularity;
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
}
/**
* Display a mini month view.
*/
function template_preprocess_calendar_mini(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
template_preprocess_calendar_month($vars);
$view = $vars['view'];
$view->date_info->show_title = !empty($view->date_info->show_title) ? $view->date_info->show_title : FALSE;
$vars['show_title'] = $view->date_info->show_title;
$vars['view'] = $view;
}
/**
* Display a year view.
*/
function template_preprocess_calendar_year(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
$vars['view']->date_info->style_with_weekno = FALSE;
template_preprocess_calendar($vars);
// Get the url of the year view and remove the year argument from it.
// TODO clean this up in case there is another arg that looks like
// the year to make sure only the year gets removed.
$view = $vars['view'];
$year = date_format($view->date_info->min_date, 'Y');
// Construct a calendar for each month, adjusting the $view passed
// to the theme so it will produce the right results.
$view = drupal_clone($vars['view']);
$rows = $vars['rows'];
$months = array();
foreach ($rows as $month => $month_rows) {
$view->date_info->month = $month;
$view->date_info->granularity = 'month';
$view->date_info->mini = TRUE;
$view->date_info->hide_nav = TRUE;
$view->date_info->show_title = TRUE;
$view->date_info->url = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month));
$view->date_info->min_date = date_make_date($view->date_info->year .'-'. date_pad($month) .'-01 00:00:00', date_default_timezone_name());
$view->date_info->max_date = drupal_clone($view->date_info->min_date);
date_modify($view->date_info->max_date, '+1 month');
date_modify($view->date_info->max_date, '-1 second');
$months[$month] = theme('calendar_mini', $view, $vars['options'], $month_rows);
}
$vars['months'] = $months;
$vars['view']->date_info->hide_nav = FALSE;
$vars['view']->date_info->granularity = 'year';
}
/**
* Display a day overlap view.
*/
function template_preprocess_calendar_day_overlap(&$vars) {
template_preprocess_calendar_day($vars);
}
/**
* Display a day view.
*/
function template_preprocess_calendar_day(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
$vars['view']->style_with_weekno = FALSE;
template_preprocess_calendar($vars);
$view = $vars['view'];
$rows = $vars['rows'];
$item_count = 0;
$by_hour_count = 0;
$grouping_field = $view->date_info->style_groupby_field;
$display_overlap = $view->date_info->style_theme_style == '1';
// Add optional css
if ($display_overlap) {
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
$overlapped_items = array();
}
// If we're not grouping by time, move all items into the 'all day' array.
if (empty($view->date_info->style_groupby_times)) {
// Items are already grouped into times, so we need to process each time-group.
foreach ($rows['items'] as $time => $items) {
foreach ($items as $item) {
$rows['all_day'][] = $item;
}
}
$rows['items'] = array();
}
$columns = array();
// Move all_day items into the right columns and render them.
$grouped_items = array();
foreach ($rows['all_day'] as $item) {
if (isset($item->{$grouping_field})) {
$column = $item->{$grouping_field};
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
if (!in_array($column, $columns)) {
$columns[] = $column;
}
}
else {
$column = t('Items');
}
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
$grouped_items[$column][] = theme($theme, $item, $view);
$item_count++;
}
$vars['rows']['all_day'] = $grouped_items;
// Moved timed items into the right columns and render them.
$start_times = $view->date_info->style_groupby_times;
$show_empty_times = $view->date_info->style_show_empty_times;
$end_start_time = '23:59:59';
$start_time = array_shift($start_times);
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
$grouped_items = array();
foreach ($rows['items'] as &$items) {
foreach ($items as &$item) {
$time = date_format($item->date_start, 'H:i:s');
if (isset($item->{$grouping_field})) {
$column = $item->{$grouping_field};
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
if (!in_array($column, $columns)) {
$columns[] = $column;
}
}
else {
$column = t('Items');
}
// Find the next time slot and fill it. Populate the skipped
// slots if the option to show empty times was chosen.
while ($time >= $next_start_time && $time < $end_start_time) {
if ((!empty($show_empty_times) || $display_overlap) && !array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
$grouped_items[$start_time]['values'][$column][] = $item;
if ($display_overlap) {
$time_end = date_format($item->date_end, 'H:i:s');
$item->time_start = $time;
$item->time_end = $time_end;
_calc_indents($overlapped_items, $time, $time_end, $item);
}
$item_count++;
$by_hour_count++;
}
}
// Finish out the day's time values if we want to see empty times.
if (!empty($show_empty_times) || $display_overlap) {
while ($start_time < $end_start_time && ($start_time != NULL || $display_overlap)) {
if ($start_time == NULL) {
$start_times = $view->date_info->style_groupby_times;
$start_time = array_shift($start_times);
$next_start_time = array_shift($start_times);
}
if (!array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
}
// Do the headers last, once we know what the actual values are.
$i = 0;
$start_times = array_keys($grouped_items);
foreach ($start_times as $start_time) {
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $rows['date']);
$grouped_items[$start_time]['hour'] = $heading['hour'];
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
foreach ($grouped_items[$start_time]['values'] as $column => &$items) {
foreach ($items as $index => &$item) {
if ($display_overlap) {
$offset = round(date_format($item->date_start, 'i') / 15);
$duration = date_convert('1970-01-01 ' . $item->time_end, DATE_DATETIME, DATE_UNIX) -
date_convert('1970-01-01 ' . $item->time_start, DATE_DATETIME, DATE_UNIX);
$duration = round($duration / (15 * 60));
$item->class = 'd_'. $duration . ' o_'. $offset . ' i_' . $item->indent . ' md_' . min($item->max_depth, 5);
}
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
$grouped_items[$start_time]['values'][$column][$index] = theme($theme, $item, $view);
}
}
$i++;
}
ksort($grouped_items);
$vars['rows']['items'] = $grouped_items;
if (empty($columns)) {
$columns = array(t('Items'));
}
$vars['columns'] = $columns;
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
$first_column_width = 10;
if (empty($view->date_info->style_groupby_times)) {
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
$first_column_width = 1;
}
$vars['first_column_width'] = $first_column_width;
if (count($columns)) {
$vars['column_width'] = round((100 - $first_column_width)/count($columns));
}
else {
$vars['column_width'] = (100 - $first_column_width);
}
$vars['item_count'] = $item_count;
$vars['by_hour_count'] = $by_hour_count;
$vars['start_times'] = $view->date_info->style_groupby_times;
return;
}
/**
* Display a week overlap view.
*/
function template_preprocess_calendar_week_overlap(&$vars) {
template_preprocess_calendar_week($vars);
}
/**
* Display a week view.
*/
function template_preprocess_calendar_week(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
$vars['view']->style_with_weekno = FALSE;
template_preprocess_calendar($vars);
$view = $vars['view'];
$rows = $vars['rows'];
$item_count = 0;
$by_hour_count = 0;
$start_time = NULL;
if (sizeof($rows) > 1) {
$day_names = array_shift($rows);
}
else {
$day_names = $rows;
$rows = array();
}
// Moved timed items into the right columns and render them.
$show_empty_times = $view->date_info->style_show_empty_times;
$end_start_time = '23:59:59';
$grouped_items = array();
// pass the multiday buckets
$vars['all_day'] = $rows['multiday_buckets'];
// Remove the count for singleday
$vars['multiday_rows'] = max(0, $rows['total_rows'] - 1);
$display_overlap = ($view->date_info->style_multiday_theme == '1' && $view->date_info->style_theme_style == '1');
$vars['display_overlap'] = $display_overlap;
// Add optional css
if ($display_overlap) {
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
$overlapped_items = array( array(), array(), array(), array(), array(), array(), array());
// Locate the first item
$first_time = '23:59:59';
$first_time_index = -1;
for ($i = 0; $i < 7; $i++) {
if (count($rows['singleday_buckets'][$i]) > 0) {
$time_slot = reset($rows['singleday_buckets'][$i]);
$time = date_format($time_slot[0]['item']->date_start, 'H:i:s');
if ($time < $first_time) {
$first_time = $time;
$first_time_index = $i;
}
}
}
if ($first_time_index > -1) {
$rows['singleday_buckets'][$first_time_index][$first_time][0]['is_first'] = TRUE;
}
}
// If we're not grouping by time, move all items into the 'all day' array.
if (empty($view->date_info->style_groupby_times)) {
$add_row = FALSE;
foreach ($vars['all_day'] as $index => &$day ) {
foreach ($rows['singleday_buckets'][$index] as $item) {
foreach ($item as $event) {
$day[] = $event;
$add_row = TRUE;
}
}
}
if ( $add_row ) {
$vars['multiday_rows']++;
}
}
else {
foreach ($rows['singleday_buckets'] as $wday => $singleday_row) {
$columns[] = $wday;
foreach ($singleday_row as &$row) {
$start_times = $view->date_info->style_groupby_times;
$start_time = array_shift($start_times);
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
foreach ($row as &$item) {
$time = date_format($item['item']->date_start, 'H:i:s');
if ($item['item']->calendar_all_day || ($item['item']->date_start == $item['item']->date_end)) {
$vars['all_day'][$item['wday']][] = $item;
if ($vars['multiday_rows'] == 0) {
$vars['multiday_rows']++;
}
}
else {
// Find the next time slot and fill it. Populate the skipped
// slots if the option to show empty times was chosen.
while ($time >= $next_start_time && $time < $end_start_time) {
if (($show_empty_times || $display_overlap) && !array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'][$wday] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
$grouped_items[$start_time]['values'][$wday][] = &$item;
if ($display_overlap) {
$date_end = date_format($item['item']->date_end, 'H:i:s');
_calc_indents($overlapped_items[$wday], $time, $date_end, $item);
}
$item_count++;
$by_hour_count++;
}
}
}
// Finish out the day's time values if we want to see empty times.
if ($show_empty_times || $display_overlap) {
while ($start_time < $end_start_time && ($start_time != NULL || $display_overlap)) {
if ($start_time == NULL) {
$start_times = $view->date_info->style_groupby_times;
$start_time = array_shift($start_times);
$next_start_time = array_shift($start_times);
}
if (!array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'][$wday] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
}
ksort($grouped_items);
}
}
// Do the headers last, once we know what the actual values are.
$i = 0;
$start_times = array_keys($grouped_items);
foreach ($start_times as $start_time) {
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, (isset($row['data'])) ? $row['data']['date'] : NULL);
$grouped_items[$start_time]['hour'] = $heading['hour'];
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
$grouped_items[$start_time]['time'] = $start_time;
if ($display_overlap) {
foreach ($grouped_items[$start_time]['values'] as $wday => &$items) {
foreach ($items as &$item) {
if ($display_overlap) {
$offset = round(date_format($item['item']->date_start, 'i') / 15);
$duration = date_convert($item['item']->date_end, DATE_OBJECT, DATE_UNIX) - date_convert($item['item']->date_start, DATE_OBJECT, DATE_UNIX);
$duration = round($duration / (15 * 60));
$item['class'] = 'd_'. $duration . ' o_'. $offset . ' i_' . $item['indent'] . ' md_' . min($item['max_depth'], 5);
}
}
}
}
}
$vars['items'] = $grouped_items;
$vars['day_names'] = $day_names;
$vars['columns'] = $columns;
$vars['start_times'] = $view->date_info->style_groupby_times;
$vars['first_time'] = $first_time;
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
$first_column_width = 10;
if (empty($view->date_info->style_groupby_times)) {
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
$first_column_width = 1;
}
$vars['item_count'] = $item_count;
$vars['by_hour_count'] = $by_hour_count;
return;
}
/**
* Create the calendar date box.
*/
function template_preprocess_calendar_datebox(&$vars) {
$date = $vars['date'];
$view = $vars['view'];
$vars['day'] = intval(substr($date, 8, 2));
$force_view_url = !empty($view->date_info->block) ? TRUE : FALSE;
$vars['url'] = date_real_url($view, NULL, $date, $force_view_url);
$vars['link'] = l($vars['day'], $vars['url']);
$vars['granularity'] = $view->date_info->granularity;
$vars['mini'] = $view->date_info->mini;
if ($view->date_info->mini) {
if (!empty($vars['selected'])) {
$vars['class'] = 'mini-day-on';
}
else {
$vars['class'] = 'mini-day-off';
}
}
else {
$vars['class'] = 'day';
}
}
/**
* Format an calendar node for display.
*/
function template_preprocess_calendar_node(&$vars) {
$node = $vars['node'];
$view = $vars['view'];
$fields = array();
foreach ($view->field as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($node->$field_alias)) {
$data = $node->$field_alias;
$label = $field->options['label'];
// CCK has some special label options.
if (!empty($field->content_field)) {
switch ($field->options['label_type']) {
case 'none':
$label = '';
break;
case 'widget':
$label = $field->content_field['widget']['label'];
break;
}
}
$fields[$field_alias] = array(
'id' => views_css_safe($field_alias),
'label' => $label,
'data' => $data,
);
}
}
$vars['fields'] = $fields;
$vars['calendar_start'] = $node->calendar_start;
$vars['calendar_end'] = $node->calendar_end;
$vars['calendar_start_date'] = $node->calendar_start_date;
$vars['calendar_end_date'] = $node->calendar_end_date;
// We added the node type to the results in the query,
// but it will show up as $node->node_type instead of
// $node->type. Rename it to match the normal way it
// would show up on a node object.
$vars['node']->type = $vars['node']->node_type;
}
/**
* Format an calendar month node for display.
*/
function template_preprocess_calendar_month_node(&$vars) {
template_preprocess_calendar_node($vars);
}
/**
* Format an calendar month node for display.
*/
function template_preprocess_calendar_month_multiple_node(&$vars) {
$view = $vars['view'];
$curday = $vars['curday'];
// get the year month and date
$parts = explode('-', substr($curday, 0, 10));
$year = $parts[0];
$month = intval($parts[1]);
$day = intval($parts[2]);
// create the link to the day
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($day));
}
/**
* Format an calendar day node for display.
*/
function template_preprocess_calendar_day_node(&$vars) {
template_preprocess_calendar_node($vars);
$node = $vars['node'];
// Remote items may have a teaser to show.
if (!empty($node->remote) && !empty($node->teaser)) {
$fields['teaser'] = '<div class="content">'. ($node->teaser) ."</div>\n";
}
}
/**
* Format an calendar week node for display.
*/
function template_preprocess_calendar_week_node(&$vars) {
template_preprocess_calendar_node($vars);
}
/**
* Format an calendar week node for display.
*/
function template_preprocess_calendar_week_multiple_node(&$vars) {
$view = $vars['view'];
$curday = $vars['curday'];
// get the year month and date
$parts = explode('-', substr($curday, 0, 10));
$year = $parts[0];
$month = intval($parts[1]);
$day = intval($parts[2]);
// create the link to the day
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($day));
}
/**
* Format the time row headings in the week and day view.
*/
function theme_calendar_time_row_heading($start_time, $next_start_time, $curday_date) {
static $format_hour, $format_ampm;
if (empty($format_hour)) {
$format = variable_get('date_format_short', 'm/d/Y - H:i');
$format_hour = str_replace(array('a', 'A'), '', date_limit_format($format, array('hour', 'minute')));
$format_ampm = strstr($format, 'a') ? 'a' : (strstr($format, 'A') ? 'A' : '');
}
if ($start_time == '00:00:00' && $next_start_time == '23:59:59') {
$hour = t('All times');
}
elseif ($start_time == '00:00:00') {
$date = date_create($curday_date .' '. $next_start_time);
$hour = t('Before @time', array('@time' => date_format($date, $format_hour)));
}
else {
$date = date_create($curday_date .' '. $start_time);
$hour = date_format($date, $format_hour);
}
if (!empty($date)) {
$ampm = date_format($date, $format_ampm);
}
else {
$ampm = '';
}
return array('hour' => $hour, 'ampm' => $ampm);
}
/**
* Format a node stripe legend
*/
function theme_calendar_stripe_legend() {
if (empty($GLOBALS['calendar_stripes'])) {
return '';
}
$header = array(
array('class' => 'calendar-legend', 'data' => t('Item')),
array('class' => 'calendar-legend', 'data' => t('Key'))
);
$rows = array();
$output = '';
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
if ($stripe) {
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'">&nbsp;</div>');
}
}
if (!empty($rows)) {
$output .= theme('table', $header, $rows, array('class' => 'mini calendar-legend'));
}
return $output;
}
/**
* Format node stripes
*/
function theme_calendar_stripe_stripe($node) {
if (empty($node->stripe) || (!count($node->stripe))) {
return;
}
$output = '';
if (is_array($node->stripe_label)) {
foreach ($node->stripe_label as $k => $stripe_label) {
if (!empty($node->stripe[$k]) && !empty($stripe_label)) {
$GLOBALS['calendar_stripes'][$stripe_label] = $node->stripe[$k];
$output .= '<div style="background-color:'. $node->stripe[$k] .';color:'. $node->stripe[$k] .'" class="stripe" title="Key: '. $node->stripe_label[$k] .'">&nbsp;</div>'."\n";
}
}
}
return $output;
}
/**
* Format an empty day on a calendar
*
* @param day
* The day to display.
*/
function theme_calendar_empty_day($curday, $view) {
if ($view->date_info->calendar_type != 'day') {
return '<div class="calendar-empty">&nbsp;</div>'."\n";
}
else {
return '<div class="calendar-dayview-empty">'. t('Empty day') .'</div>';
}
}
/**
* Indent items based off a nested tree structure of overlapping items
*
* @param array $overlapped_items
* Tree of overlapped items
* @param date $start
* Start time of the event
* @param date $end
* End tiem of the event
* @param array $item
* The event to add to the tree
* @param int $depth
* Current depth of the tree
* @return rc
* Returns an array with the max depth of the branch and whether an overlap occurred
*/
function _calc_indents(&$overlapped_items, $start, $end, &$item, $depth = 0) {
// Are there any items at this depth?
if (!empty($overlapped_items)) {
// Iterate for each item as this depth and see if we overlap
foreach ($overlapped_items as $index => &$entry) {
// We search depth-first, so if there are children for this item, recurse into
// each child tree looking for an overlap
if (!empty($entry['children'])) {
$rc = _calc_indents($entry['children'], $start, $end, $item, $depth + 1);
// Was there an overlap in the child tree?
if ($rc['overlap']) {
if (is_object($entry['item'])) {
$entry['item']->indent = _calc_indent($entry['depth'], $rc['max_depth']);
$entry['item']->max_depth = $rc['max_depth'];
}
else {
$entry['item']['indent'] = _calc_indent($entry['depth'], $rc['max_depth']);
$entry['item']['max_depth'] = $rc['max_depth'];
}
// There was an overlap, pop out of this depth
return $rc;
}
}
// No, child overlap, so check if we overlap this item
if ($start >= $entry['start'] && $start <= $entry['end']) {
// We overlap, create an overlapping entry
$entry['children'][] = array('item' => &$item, 'depth' => $depth + 1, 'start' => $start, 'end' => $end, 'children' => array());
if (is_object($entry['item'])) {
$max_depth = max($entry['item']->max_depth, $depth + 1);
$entry['item']->indent = _calc_indent($depth, $max_depth);
$entry['item']->max_depth = $max_depth;
}
else {
$max_depth = max($entry['item']['max_depth'], $depth + 1);
$entry['item']['indent'] = _calc_indent($depth, $max_depth);
$entry['item']['max_depth'] = $max_depth;
}
if (is_object($item)) {
$item->indent = _calc_indent($depth + 1, $max_depth);
$item->max_depth = $max_depth;
}
else {
$item['indent'] = _calc_indent($depth + 1, $max_depth);
$item['max_depth'] = $max_depth;
}
// We overlap, so pop out of this depth
return array('overlap' => TRUE, 'max_depth' => $max_depth);
}
}
// If there are items at this depth, but no overlap, then return no overlap and pop
// out of this depth
if ($depth > 0) {
return array('overlap' => FALSE, 'max_depth' => 0);
}
}
// No overlap at any depth, reset the array of overlaps
if ($depth == 0) {
reset($overlapped_items);
$overlapped_items[0] = array('item' => &$item, 'depth' => $depth, 'start' => $start, 'end' => $end, 'children' => array());
}
else {
$overlapped_items[] = array('item' => &$item, 'depth' => $depth, 'start' => $start, 'end' => $end, 'children' => array());
}
if (is_object($item)) {
$item->indent = _calc_indent($depth, $depth);
$item->max_depth = $depth;
}
else {
$item['indent'] = _calc_indent($depth, $depth);
$item['max_depth'] = $depth;
}
return array('overlap' => FALSE, 'max_depth' => $depth);
}
/**
* Calculates the indent based of the current depth and the depth of this branch in the tree
*
* @param int $cur_depth
* @param int $depth
* @return number
*/
function _calc_indent( $cur_depth, $depth ) {
return round(10 * $cur_depth / ($depth + 1));
}
/** @} End of addtogroup themeable */

View file

@ -0,0 +1 @@
<p>Views 2 lets you combine a number of 'displays' together in one view, including, potentially, more than one page display. Each page display can be a regular page display, with its own url, or an 'attachment' to another display. Attachments are basically one or more views that all appear at the same url of the page they are attached to, one after the other. So the calendar now creates one display that creates the back/next navigation, and attaches to it a year, month, week, or day display with the calendar for the right period.</p>

View file

@ -0,0 +1,43 @@
; $Id: calendar.help.ini,v 1.1.2.4 2008/10/28 11:46:19 karens Exp $
[advanced help settings]
name = Calendar
index name = "Calendar"
[overview]
title = Overview
[getting-started]
title = Getting started
parent = overview
weight = 1
[settings]
title = Settings
parent = overview
weight = 2
[attachments]
title = Attachments
parent = overview
weight = 3
[embedding]
title = Embedding views
parent = overview
weight = 10
[ical]
title = iCal
parent = overview
weight = 5
[ical-export]
title = iCal Export
parent = ical
weight = 1
[ical-import]
title = iCal Import
parent = ical
weight = 2

View file

@ -0,0 +1,15 @@
<h3>Embedding Views</h3>
<p>Embed a date browser or calendar view anywhere using the format: <pre>date_embed_view($view_name, $display_name, $settings, $args)</pre>
Settings are used to override some values of the view.</p>
<p>The primary setting that is useful here is a setting for 'block_identifier'. The view's block_identifier is used to control individual instances of regular and embedded views that contain date navigation so that they move separately or together. All views that use the same identifier will move together.
All views that use different identifiers will move independently. The identifier will show up in the url as a querystring, like node/275?mini=calendar/2008-10.
Page views use no block identifier, the normal identifier of the block view is 'mini'.</p>
<h3>Examples:</h3>
<dl>
<dt>&lt;?php print date_embed_view('calendar', 'calendar_1'); ?&gt;</dt>
<dd>This will embed the default page view of the calendar, using the regular calendar defaults.</dd>
<dt>&lt;?php print date_embed_view('calendar', 'calendar_1', array('block_identifer' => 'embedded'), array('2008-W45')); ?&gt;</dt>
<dd>This will embed the page view of the calendar that will use 'embedded' as an identifier, set to show the week view for week 45 of 2008.</dd>
<dt>&lt;?php print date_embed_view('calendar', 'calendar_block_1', array('block_identifier' => 'mini'), array('2008-07')); ?&gt;</dt>
<dd>This will embed the block view of the calendar that will use 'mini' as an identifier, set to show the month view for July 2008.</dd>
</dl>

View file

@ -0,0 +1,22 @@
<ol>
<li>Create a new calendar by enabling the default calendar view and changing it to use whatever date you want in your calendar. You can create multiple calendars by cloning the default calendar view as many times as necessary.</li>
<li>The calendar uses the <a href="topic:date_api/date-argument">Generic Date argument</a>. This argument has an option to select one or more Views date fields to filter on, automatically adds them to the view, and then filters the view by the value of the selected field(s). This argument can be used on any view, not just calendar views.</li>
<li> Unlike previous versions of the Calendar module, there is just a single argument instead of year, month, and day arguments. The argument value will be YYYY-MM-DD for a day, YYYY-MM for a month, YYYY for a year, and YYYY-W99 for a week. There is a default option to set the argument to the current date when the argument is empty.</li>
<li>A calendar display creates calendar navigation and links to multiple displays for the year, month, day, or week views. The actual displays are created by attaching calendar views that use whatever styles are desired for those pages.</li>
<li> Calendar views are attachments <a href="#note1">(note 1)</a> to create the year, month, day, and week displays. They can be set to use any style, either a calendar style or any other Views style, like teasers or lists. They can each have their own fields and formatting. They must be attached to the main calendar page or to a calendar block.</li>
<li>If you don't want to have a link to a week display, just remove the week display from the view. Ditto for any other displays you don't want to use. The links will automatically disappear for any displays that are not defined in the view.</li>
<li>A calendar block will create a calendar block for the view results. This block requires the calendar argument to do its work, and uses one of the year, month, day, or week calendar view attachments created above. </li>
<li>Earlier versions required that you add the date field to the 'Fields' section of the view, but this version does not require that. Add the field to the view if you want it displayed in the results, otherwise you can leave it out. The Calendar no longer over-writes normal formatting for that field, it will be displayed however you set it up in the view.</li>
<li>There are templates for the top of the calendar (the links and navigation), the year, month, day, and week displays, and the individual month, week, and day nodes, so you can easily style them.</li>
</ol>

View file

@ -0,0 +1,2 @@
<p>If the Calendar iCal module is enabled, the default Calendar view will include an iCal display that you can use to create iCal exports of your calendar.</p>
<p>To use the iCal export, look for the iCal display in the calendar. The default iCal feed uses a Date filter set to show events greater to or equal to 'now'. Find the <a href="topic:date_api/date-filter">date filter</a> on the iCal display and change it to use the date(s) used in the calendar. Then attach the iCal feed to the Calendar Page and/or the Calendar Block.</p>

View file

@ -0,0 +1,4 @@
<p>To import nodes from an iCal feed, follow the <a href="topic:date_api/ical-import">iCal Import</a> instructions.</p>
<p>After importing, the imported nodes now exist as regular date fields that can be added to your calendar. </p><p><img src="&path&images/ical_import.png"></p>
</ol>

View file

@ -0,0 +1 @@
The Calendar module can take advantage of the iCal standard to either export or import ical feeds.

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

View file

@ -0,0 +1,3 @@
<h3>Calendar 2.0 for Drupal 6</h3>
Calendar 2.0 for Drupal 6 entailed a complete rewrite in order work with Views 2. There are a lot of changes from earlier versions, so I strongly suggest you start with the default calendar view provided and add and edit it to get the results you want.

View file

@ -0,0 +1,7 @@
<p>Calendar settings are now all done in the view instead of on a separate settings page in the administration area.</p>
<p>See the screenshots below for the place to edit the legend colors.</p>
<p><img src="path:images/calendar_colors.jpg"></p>
<p><img src="path:images/calendar_colors2.jpg"></p>

View file

@ -0,0 +1,203 @@
<?php
//$Id: calendar.inc,v 1.1.2.46 2010/11/28 23:31:28 karens Exp $
/**
* Build calendar
*
* @param unknown_type $view
* @param unknown_type $items
* @return themed table
*/
function calendar_build_calendar($view, $items) {
// Remove nodes outside the selected date range.
$values = array();
foreach ($items as $delta => $item) {
if (empty($item->calendar_start_date) || empty($item->calendar_end_date)) {
continue;
}
$item_start = date_format($item->calendar_start_date, DATE_FORMAT_DATE);
$item_end = date_format($item->calendar_end_date, DATE_FORMAT_DATE);
if (($item_start >= $view->date_info->min_date_date && $item_start <= $view->date_info->max_date_date)
|| ($item_end >= $view->date_info->min_date_date && $item_end <= $view->date_info->max_date_date)) {
$values[$item_start][date_format($item->calendar_start_date, 'H:i:s')][] = $item;
}
}
$items = $values;
ksort($items);
$rows = array();
$curday = drupal_clone($view->date_info->min_date);
switch ($view->date_info->granularity) {
case 'year':
$rows = array();
$view->date_info->mini = TRUE;
for ($i = 1; $i <= 12; $i++) {
$rows[$i] = calendar_build_month($curday, $view, $items);
}
$view->date_info->mini = FALSE;
break;
case 'month':
$rows = calendar_build_month($curday, $view, $items);
break;
case 'day':
$rows = calendar_build_day($curday, $view, $items);
break;
case 'week':
$rows = calendar_build_week($curday, $view, $items);
// Merge the day names in as the first row.
$rows = array_merge(array(calendar_week_header($view)), $rows);
break;
}
return $rows;
}
/**
* Build one month.
*/
function calendar_build_month(&$curday, $view, $items) {
$month = date_format($curday, 'n');
date_modify($curday, '-' . strval(date_format($curday, 'j')-1) . ' days');
$rows = array();
do {
$rows = array_merge($rows, calendar_build_week($curday, $view, $items, TRUE));
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$curday_month = date_format($curday, 'n');
} while ($curday_month == $month && $curday_date <= $view->date_info->max_date_date);
// Merge the day names in as the first row.
$rows = array_merge(array(calendar_week_header($view)), $rows);
return $rows;
}
/**
* Build one week row.
*/
function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$weekdays = calendar_untranslated_days($items, $view);
$today = date_format(date_now(date_default_timezone_name()), DATE_FORMAT_DATE);
$month = date_format($curday, 'n');
$week = date_week($curday_date);
$first_day = variable_get('date_first_day', 0);
// move backwards to the first day of the week
$day_wday = date_format($curday, 'w');
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
$curday_date = date_format($curday, DATE_FORMAT_DATE);
// If we're displaying the week number, add it as the
// first cell in the week.
if (!empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', 'week'))) {
$url = date_real_url($view, NULL, $view->date_info->year .'-W'. $week);
if (!empty($view->date_info->display_types['week'])) {
$weekno = l($week, $url, array('query' => !empty($view->date_info->append) ? $view->date_info->append : ''));
}
else {
// Do not link week numbers, if Week views are disabled.
$weekno = $week;
}
$rows[$week][] = array(
'data' => $weekno,
'id' => $view->name . '-weekno-' . $curday_date,
'class' => 'week');
}
for ($i = 0; $i < 7; $i++) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$class = strtolower($weekdays[$i] .
($view->date_info->mini ? ' mini' : ''));
if ($check_month && ($curday_date < $view->date_info->min_date_date || $curday_date > $view->date_info->max_date_date || date_format($curday, 'n') != $month)) {
$class .= ' empty';
$content = array(
'date' => '',
'datebox' => '',
'empty' => theme('calendar_empty_day', $curday_date, $view),
'link' => '',
'all_day' => array(),
'items' => array(),
);
}
else {
$content = calendar_build_day($curday, $view, $items);
$class .= ($curday_date == $today ? ' today' : '') .
($curday_date < $today ? ' past' : '') .
($curday_date > $today ? ' future' : '') .
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
}
$rows[$week][] = array(
'data' => $content,
'class' => $class, 'id' => $view->name . '-' . $curday_date);
date_modify($curday, '+1 day');
}
return $rows;
}
/**
* Build the contents of a single day for the $rows results.
*/
function calendar_build_day($curday, $view, $items) {
$curday_date = date_format($curday, DATE_FORMAT_DATE);
$selected = FALSE;
$max_events = !empty($view->date_info->style_max_items) ? $view->date_info->style_max_items : 0;
$types = array();
$inner = array();
$all_day = array();
$empty = '';
$link = '';
$count = 0;
foreach ($items as $date => $day) {
if ($date == $curday_date) {
$count = 0;
$selected = TRUE;
ksort($day);
foreach ($day as $time => $hour) {
foreach ($hour as $key => $item) {
$count++;
$types[$item->type] = $item;
if (!$view->date_info->mini && ($max_events == CALENDAR_SHOW_ALL || $count <= $max_events || ($count > 0 && $max_events == CALENDAR_HIDE_ALL))) {
// Theme the item here unless this is a 'Day' or 'Week' view.
// Day and week views need to do more processing before rendering
// the item, so just past them the unrendered item.
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
if ($item->calendar_all_day) {
$all_day[] = in_array($view->date_info->calendar_type, array('day', 'week')) ? $item : theme($theme, $item, $view);
}
else {
$key = date_format($item->calendar_start_date, 'H:i:s');
$inner[$key][] = in_array($view->date_info->calendar_type, array('day', 'week')) ? $item : theme($theme, $item, $view);
}
}
}
}
}
}
ksort($inner);
if (empty($inner) && empty($all_day)) {
$empty = theme('calendar_empty_day', $curday_date, $view);
}
// We have hidden events on this day, use the theme('calendar_multiple_') to show a link.
if ($max_events != CALENDAR_SHOW_ALL && $count > 0 && $count > $max_events && $view->date_info->calendar_type != 'day' && !$view->date_info->mini) {
if ($view->date_info->style_max_items_behavior == 'hide' || $max_events == CALENDAR_HIDE_ALL) {
$all_day = array();
$inner = array();
}
$link = theme('calendar_'. $view->date_info->calendar_type .'_multiple_node', $curday_date, $count, $view, $types);
}
$content = array(
'date' => $curday_date,
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
'empty' => $empty,
'link' => $link,
'all_day' => $all_day,
'items' => $inner,
);
return $content;
}

View file

@ -0,0 +1,231 @@
<?php
//$Id: calendar.views.inc,v 1.1.2.11 2010/11/29 11:41:58 karens Exp $
/**
* Implementation of hook_views_query()
*
* Handle the date_popup calendar goto date.
*/
function calendar_views_query_alter(&$view, &$query) {
// Check if a new date has been selected and if so redirect.
if (isset($_POST['calendar_goto']) && $_POST['view_name'] == $view->name) {
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_elements.inc');
$format = date_limit_format(variable_get('date_format_short', 'm/d/Y - H:i'), array('year', 'month', 'day'));
$date = date_convert_from_custom($_POST['calendar_goto']['date'], $format);
switch ($_POST['calendar_type']) {
case 'year':
$arg = date_pad(date_part_extract($date, 'year'), 4);
break;
case 'month':
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month'));
break;
case 'week':
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-W'. date_pad(date_week($date));
break;
default:
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month')) .'-'. date_pad(date_part_extract($date, 'day'));
break;
}
drupal_goto(str_replace($_POST['calendar_previous_arg'], $arg, $_POST['view_url']));
exit();
}
}
function calendar_views_pre_view(&$view, &$display_id, &$args) {
//
}
/**
* @file
*
* Creates calendar displays of Views results.
*
* Create a new calendar by enabling or cloning the default calendar,
* changing the date argument to use the correct date field(s), and setting
* up the year, month, day, week, and block views with the desired styles
* and fields.
*
* Unlike previous versions of the Calendar module, there is just a single
* Date argument instead of year, month, and day arguments. The argument
* value will be YYYY-MM-DD for a day, YYYY-MM for a month, YYYY for a
* year, and YYYY-W99 for a week. There is a default option to set the
* argument to the current date when the argument is empty.
*
* A calendar display creates calendar navigation and links to
* multiple displays for the year, month, day, or week views. The actual
* displays are created by attaching calendar views that use whatever
* styles are desired for those pages.
*
* Calendar views are attachments to create the year, month, day,
* and week displays. They can be set to use any style, either a
* calendar style or any other Views style, like teasers or lists.
* If you don't want to use one of them, don't attach it to
* anything. Only the attached views will show up in the calendar.
*
* A calendar block will create a calendar block for the
* view results. Attach a block view to the block and set up the
* desired style in the block view.
*/
/**
* Implementation of hook_views_plugins
*/
function calendar_views_plugins() {
$path = drupal_get_path('module', 'calendar');
$theme_path = $path;
if (module_exists('calendar_multiday')) {
$theme_path = drupal_get_path('module', 'calendar_multiday');
}
$views_path = drupal_get_path('module', 'views');
require_once "./$theme_path/theme/theme.inc";
$data = array(
'module' => 'calendar', // This just tells our themes are elsewhere.
'display' => array(
// Parents are not really displays, just needed so the files can
// be included.
'parent' => array(
'no ui' => TRUE,
'handler' => 'views_plugin_display',
'path' => "$views_path/plugins",
'parent' => '',
),
'page' => array(
'no ui' => TRUE,
'handler' => 'views_plugin_display_page',
'path' => "$views_path/plugins",
'parent' => 'parent',
),
'block' => array(
'no ui' => TRUE,
'handler' => 'views_plugin_display_block',
'path' => "$views_path/plugins",
'parent' => 'parent',
),
'attachment' => array(
'no ui' => TRUE,
'handler' => 'views_plugin_display_attachment',
'path' => "$views_path/plugins",
'parent' => 'parent',
),
'calendar_attachment' => array(
'handler' => 'calendar_plugin_display_attachment',
'path' => "$path/includes",
'parent' => 'attachment',
'no ui' => TRUE,
),
// Main calendar display plugin.
'calendar' => array(
'title' => t('Calendar page'),
'help' => t('Calendar page. Attach Calendar period attachments to this page, set to show the year, month, day, and week views.'),
'handler' => 'calendar_plugin_display_page',
'path' => "$path/includes",
'parent' => 'page',
'theme' => 'views_view',
'no ui' => TRUE,
//'no remove' => TRUE,
'uses hook menu' => TRUE,
'uses hook block' => FALSE,
'use ajax' => TRUE,
'use pager' => FALSE,
'accept attachments' => TRUE,
'admin' => t('Calendar page'),
'help topic' => 'getting-started',
'js' => array(
'misc/farbtastic/farbtastic.js',
drupal_get_path('module', 'calendar') .'/js/calendar_colorpicker.js',
),
),
// Calendar block display plugin.
'calendar_block' => array(
'title' => t('Calendar block'),
'help' => t('Calendar page. Attach a Calendar period attachment to this block, set to show the year, month, day, or week view.'),
'handler' => 'calendar_plugin_display_block',
'path' => "$path/includes",
'parent' => 'block',
'theme' => 'views_view',
'no ui' => TRUE,
//'no remove' => TRUE,
'uses hook block' => TRUE,
'use ajax' => TRUE,
'use pager' => FALSE,
'use more' => TRUE,
'accept attachments' => TRUE,
'admin' => t('Calendar block'),
'help topic' => 'getting-started',
),
// Display plugins for calendar displays.
'calendar_period' => array(
'title' => t('Calendar period'),
'help' => t('An attachment for a Year, Month, Day, or Week calendar display, using any style you choose. Attach to a Calendar page and/or a Calendar block.'),
'handler' => 'calendar_plugin_display_attachment',
'path' => "$path/includes",
'file' => 'calendar_plugin_display_attachment.inc',
'parent' => 'calendar_attachment',
'theme' => 'views_view',
'no ui' => TRUE,
//'no remove' => TRUE,
'use ajax' => TRUE,
'use pager' => TRUE,
'admin' => t('Calendar page year, month, week, or day view'),
'help topic' => 'getting-started',
),
),
'style' => array(
'parent' => array(
// this isn't really a display but is necessary so the file can
// be included.
'no ui' => TRUE,
'handler' => 'views_plugin_style',
'path' => "$views_path/plugins",
'parent' => '',
),
// Style plugin for the navigation.
'calendar_nav' => array(
'title' => t('Calendar navigation'),
'help' => t('Creates back/next navigation and calendar links.'),
'handler' => 'calendar_plugin_style',
'path' => "$path/includes",
'parent' => 'parent',
'theme' => 'calendar_main',
'theme file' => 'theme.inc',
'theme path' => "$theme_path/theme",
'uses row plugin' => FALSE,
'uses fields' => TRUE,
'uses options' => FALSE,
'type' => 'calendar', // Only used on calendar page or block displays.
'even empty' => TRUE,
),
'calendar_style' => array(
'title' => t('Calendar'),
'help' => t('Displays Views results in a calendar.'),
'handler' => 'calendar_view_plugin_style',
'path' => "$path/includes",
'parent' => 'calendar_nav',
'theme' => 'calendar_month',
'theme file' => 'theme.inc',
'theme path' => "$theme_path/theme",
'additional themes' => array(
'calendar_year' => 'style',
'calendar_day' => 'style',
'calendar_week' => 'style',
'calendar_mini' => 'style',
),
'uses row plugin' => FALSE,
'uses fields' => TRUE,
'uses options' => TRUE,
'type' => 'normal',
'even empty' => TRUE,
),
),
);
if (module_exists('calendar_multiday')) {
$data['style']['calendar_style']['additional themes'] += array(
'calendar_day_overlap' => 'style',
'calendar_week_overlap' => 'style',
);
}
return $data;
}

View file

@ -0,0 +1,510 @@
<?php
//$Id: calendar.views_default.inc,v 1.1.2.23 2010/11/28 23:31:28 karens Exp $
/**
* Set up so it can be used as an API to create default calendars for
* specific date fields.
*
* Use variable_set() to establish criteria for default calendars.
* Set the variable in custom modules or in settings.
*
* Example: Add a new default calendar to custom
* calendars that are already configured:
*
* $options = variable_get('calendar_default_view_options', array());
* $option = array(
* 'name' => 'example_event',
* 'description' => 'An example event calendar for the date field.',
* 'path' => 'example_event',
* 'types' => array('example_content_type'),
* 'date_fields' => array('field_example_date'),
* );
* $options[] = $option;
* variable_set('calendar_default_view_options', $options);
*
*/
function calendar_views_default_views() {
$views = array();
// Construct the default view with default options.
$view = calendar_views_construct();
$views[$view->name] = $view;
// Then see if there are any custom calendars to be created
// using variable_get().
$calendar_options = variable_get('calendar_default_view_options', array());
foreach ((array) $calendar_options as $calendar_option) {
$view = calendar_views_construct($calendar_option);
$views[$view->name] = $view;
}
return $views;
}
/**
*
* Construct a default calendar to match specified options.
* Views calls it without options, so the basic
* default view will use the default values.
*
* @param $options: an optional array of options to
* create default calendars.
*
* Possible options include:
* @param string $name:
* The view name, if empty, defaults to 'calendar'.
* @param string $description:
* The view description, if empty, defaults to generic description.
* @param string $path:
* The view url, if empty, defaults to 'calendar'.
* @param array $types:
* Array of content types to limit the calendar to those types.
* If empty, defaults to no type filter.
* @param array $date_fields:
* Date fields used to filter the calendar.
* If empty, defaults to array('changed') for node.changed.
* @param array $display_fields:
* Fields to display in the calendar.
* If empty, defaults to title and date fields.
*
* @return the default calendar array.
*/
function calendar_views_construct($options = NULL) {
$name = NULL;
$description = NULL;
$path = NULL;
$types = NULL;
$date_fields = NULL;
$display_fields = NULL;
if (empty($options)) {
$disabled = TRUE;
}
else {
$disabled = FALSE;
extract($options);
}
if (empty($name)) {
$name = 'calendar';
}
if (empty($description)) {
$description = 'A multi-dimensional calendar view with back/next navigation.';
}
if (empty($path)) {
$path = 'calendar';
}
if (empty($types)) {
$types = array();
}
if (empty($date_fields)) {
$date_fields = array('changed');
}
$colors = array();
$date_link_type = '';
foreach ($types as $type => $label) {
$colors[0][$type] = '#ffffff';
$date_link_type = $type;
}
// Can handle core node date fields or CCK date fields.
$fields = array();
$alias_fields = $date_fields;
$sort_fields = array();
$upcoming_fields = array();
foreach ($date_fields as $key => $field_name) {
if (substr($field_name, 0, 6) == 'field_') {
$table = 'node_data_'. $field_name;
$alias_fields[$key] = $field_name .'_value';
$alias = $table .'.'. $field_name .'_value';
$cck_field = TRUE;
}
else {
$table = 'node';
$alias_fields[$key] = $field_name;
$alias = $table .'.'. $field_name;
$cck_field = FALSE;
}
$fields[$alias] = $alias;
// Add a sort for each date field:
$sort_fields[$field_name] = array(
'order' => 'ASC',
'delta' => '-1',
'id' => $field_name . ($cck_field ? '_value' : ''),
'table' => $table,
'field' => $field_name . ($cck_field ? '_value' : ''),
'relationship' => 'none',
);
}
// Set up fields section with some of the basic options.
// Won't handle all possible options, but should cover
// the main ones needed for Drupal core and CCK fields.
if (empty($display_fields)) {
$display_fields = array('title' => array());
foreach ($date_fields as $field) {
$display_fields[$field] = array();
}
}
foreach ($display_fields as $key => $value) {
$cck_field = substr($key, 0, 6) == 'field_' ? TRUE : FALSE;
$date_field = $cck_field && in_array($key, $date_fields) ? TRUE : FALSE;
$display_fields[$key]['label'] = '';
$display_fields[$key]['link_to_node'] = $key == 'title' ? 1 : 0;
$display_fields[$key]['exclude'] = 0;
$display_fields[$key]['id'] = $date_field ? $key .'_value' : $key;
$display_fields[$key]['field'] = $date_field ? $key .'_value' : $key;
$display_fields[$key]['table'] = $cck_field ? 'node_data_'. $key : 'node';
$display_fields[$key]['relationship'] = 'none';
if (in_array($key, array('changed'))) {
$display_fields[$key]['date_format'] = 'small';
}
elseif ($cck_field) {
$display_fields[$key]['label_type'] = 'none';
$display_fields[$key]['format'] = 'time';
$display_fields[$key]['multiple'] = array(
'group' => 0,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => 0,
);
}
// Upcoming and iCal fields should display the whole date, not just time.
$upcoming_fields[$key] = $display_fields[$key];
$upcoming_fields[$key]['format'] = 'default';
}
$filters = array(
'status' => array(
'operator' => '=',
'value' => 1,
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
);
// Limit to types provided:
if (!empty($types)) {
$filters += array(
'type' => array(
'operator' => 'in',
'value' => drupal_map_assoc(array_keys($types)),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
);
}
// Filters for Upcoming and iCal views:
$upcoming_filters = $filters + array(
'date_filter' => array(
'operator' => '>=',
'value' => array(
'value' => NULL,
'min' => NULL,
'max' => NULL,
'default_date' => 'now',
'default_to_date' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'date_fields' => $fields,
'granularity' => 'day',
'form_type' => 'date_select',
'default_date' => 'now',
'default_to_date' => '',
'id' => 'date_filter',
'table' => 'node',
'field' => 'date_filter',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
);
$view = new view;
$view->name = $name;
$view->description = $description;
$view->tag = 'Calendar';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = $disabled; /* Edit this to true to make a default view disabled initially */
// Defaults.
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', $display_fields);
$handler->override_option('sorts', $sort_fields);
$handler->override_option('arguments', array(
'date_argument' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'default_argument_type' => 'date',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'date_fields' => $fields,
'year_range' => '-3:+3',
'date_method' => 'OR',
'granularity' => 'month',
'id' => 'date_argument',
'table' => 'node',
'field' => 'date_argument',
'relationship' => 'none',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
),
'validate_argument_type' => 'tid',
'validate_argument_php' => '',
'override' => array(
'button' => 'Override',
),
'default_options_div_prefix' => '',
),
));
$handler->override_option('filters', $filters);
$handler->override_option('access', array(
'type' => 'none',
'role' => array(),
'perm' => '',
));
$handler->override_option('title', 'Calendar');
if (!empty($header)) {
$handler->override_option('header', $header);
// The only format we can be sure of is filtered.
$handler->override_option('header_format', '1');
}
$handler->override_option('header_empty', 1);
$handler->override_option('items_per_page', 0);
$handler->override_option('use_more', 0);
$handler->override_option('style_plugin', 'calendar_nav');
$handler->override_option('style_options', array(
));
// Calendar page.
$handler = $view->new_display('calendar', 'Calendar page', 'calendar_1');
$handler->override_option('style_options', array());
$handler->override_option('path', $path);
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
$handler->override_option('calendar_colors', array($colors));
$handler->override_option('calendar_colors_vocabulary', array());
$handler->override_option('calendar_colors_taxonomy', array());
$handler->override_option('calendar_colors_group', array());
$handler->override_option('calendar_popup', 0);
$handler->override_option('calendar_date_link', $date_link_type);
// Calendar block.
$handler = $view->new_display('calendar_block', 'Calendar block', 'calendar_block_1');
$handler->override_option('style_options', array());
$handler->override_option('block_description', 'Calendar');
$handler->override_option('block_caching', -1);
// Year view.
$handler = $view->new_display('calendar_period', 'Year view', 'calendar_period_1');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'display_type' => 'year',
'name_size' => 1,
'max_items' => 0,
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'year');
// Month view.
$handler = $view->new_display('calendar_period', 'Month view', 'calendar_period_2');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'display_type' => 'month',
'name_size' => '99',
'with_weekno' => '1',
'date_fields' => NULL,
'max_items' => 0,
));
if (module_exists('calendar_multiday')) {
$handler->override_option['style_options']['multiday_theme'] = 1;
}
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'month');
// Day view.
$handler = $view->new_display('calendar_period', 'Day view', 'calendar_period_3');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'name_size' => '99',
'with_weekno' => 0,
'max_items' => 0,
'max_items_behavior' => 'more',
'groupby_times' => 'hour',
'groupby_times_custom' => '',
'groupby_field' => '',
));
if (module_exists('calendar_multiday')) {
$handler->override_option['style_options']['theme_style'] = 1;
}
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'day');
// Week view.
$handler = $view->new_display('calendar_period', 'Week view', 'calendar_period_4');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'name_size' => '99',
'with_weekno' => 0,
'max_items' => 0,
'max_items_behavior' => 'more',
'groupby_times' => 'hour',
'groupby_times_custom' => '',
'groupby_field' => '',
));
if (module_exists('calendar_multiday')) {
$handler->override_option['style_options']['theme_style'] = 1;
}
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'week');
// Block view.
$handler = $view->new_display('calendar_period', 'Block view', 'calendar_period_5');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'display_type' => 'month',
'name_size' => '1',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 0,
'default' => 0,
'calendar_block_1' => 'calendar_block_1',
));
$handler->override_option('calendar_type', 'month');
// iCal feed.
if (module_exists('calendar_ical')) {
$handler = $view->new_display('calendar_ical', 'iCal feed', 'calendar_ical_1');
$handler->override_option('arguments', array());
$handler->override_option('filters', $upcoming_filters);
$handler->override_option('style_plugin', 'ical');
$handler->override_option('style_options', array(
'mission_description' => FALSE,
'description' => '',
'summary_field' => 'node_title',
'description_field' => '',
'location_field' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', $path .'/ical');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 'calendar_block_1',
));
$handler->override_option('sitename_title', FALSE);
}
// Upcoming events block.
$handler = $view->new_display('block', 'Upcoming', 'block_1');
$handler->override_option('fields', $upcoming_fields);
$handler->override_option('arguments', array());
$handler->override_option('filters', $upcoming_filters);
$handler->override_option('use_more', 1);
$handler->override_option('items_per_page', 5);
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
'grouping' => '',
'type' => 'ul',
));
$handler->override_option('title', 'Upcoming');
$handler->override_option('block_description', 'Upcoming');
$handler->override_option('block_caching', -1);
return $view;
}

View file

@ -0,0 +1,242 @@
<?php
// $Id: calendar_plugin_display_attachment.inc,v 1.1.2.22 2011/01/03 02:39:05 karens Exp $
/**
* The plugin that handles calendar attachment displays.
*
* Adding year/month/day/week pages as attachments makes it
* possible to use any style type, so they could be tables,
* lists, teasers, or nodes as well as traditional calendar
* pages.
*
* Force 'inherit_arguments' and 'inherit_filters' to TRUE,
* and 'attachment_position' to 'after', and don't display
* those options in the UI.
*
* Allows paging (regular attachments do not), and adds an option
* to choose what calendar period this display represents.
*/
class calendar_plugin_display_attachment extends views_plugin_display_attachment {
/**
* Instead of going through the standard views_view.tpl.php, delegate this
* to the style handler.
*/
function render() {
if (!empty($this->view->date_info->forbid)) {
return '';
}
return $this->view->style_plugin->render($this->view->result);
}
/**
* Create an array of possible display periods.
*/
function display_types($type = 'month') {
$types = calendar_display_types();
return $types[$type];
}
/**
* Identify the period of this display.
*/
function calendar_type() {
$types = calendar_display_types();
$default = $this->get_option('calendar_type');
if (!array_key_exists($default, $types)) $default = 'month';
return $default;
}
/**
* Inspect argument and view information to see which calendar
* period we should show. The argument tells us what to use
* if there is no value, the view args tell us what to use
* if there are values.
*/
function display_granularity($display_id) {
$arguments = $this->view->get_items('argument', $display_id);
$wildcard = '';
$argument = '';
$default_granularity = '';
$i = 0;
foreach ($arguments as $argument) {
if ($argument['id'] == 'date_argument') {
$pos = $i;
$default_granularity = $argument['granularity'];
$wildcard = $argument['wildcard'];
$argument = !empty($this->view->args) && !empty($this->view->args[$pos]) ? $this->view->args[$pos] : '';
break;
}
$i++;
}
// TODO Anything else we need to do for 'all' arguments?
if ($argument == $wildcard) {
$view_granularity = $default_granularity;
}
elseif (!empty($argument)) {
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
$date_handler = new date_sql_handler();
$view_granularity = $date_handler->arg_granularity($argument);
}
else {
$view_granularity = $default_granularity;
}
return $view_granularity;
}
/**
* Display validation.
*/
function validate() {
$errors = parent::validate();
$arguments = $this->display->handler->get_option('arguments');
if (!in_array('date_argument', array_keys($arguments))) {
if (empty($this->view->date_info->arg_missing)) {
$errors[] = t("A Calendar period display will not work without a Date argument.");
}
$this->view->date_info->arg_missing = TRUE;
}
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
return $errors;
}
/**
* Attach only the appropriate displays for the current argument.
*/
function attach_to($display_id) {
$display_granularity = $this->calendar_type();
$view_granularity = $this->display_granularity($display_id);
// If this is not the right display to show,
// don't attach it, just exit.
if ($view_granularity != $display_granularity) {
unset($this->display);
return;
}
$this->view->date_info->parent_id = $display_id;
// See if we're attaching to a block rather than a page.
if (substr($display_id, 0, 14) == 'calendar_block') {
$this->view->date_info->mini = TRUE;
$this->view->date_info->block = TRUE;
$this->view->date_info->calendar_popup = FALSE;
if (!isset($this->view->date_info->block_identifier)) {
$this->view->date_info->block_identifier = 'mini';
}
}
elseif (substr($display_id, 0, 9) == 'calendar_') {
$this->view->date_info->calendar_colors = $this->view->display[$display_id]->handler->options['calendar_colors'];
$this->view->date_info->calendar_colors_taxonomy = $this->view->display[$display_id]->handler->options['calendar_colors_taxonomy'];
$this->view->date_info->calendar_colors_group = $this->view->display[$display_id]->handler->options['calendar_colors_group'];
$this->view->date_info->calendar_popup = $this->view->display[$display_id]->handler->options['calendar_popup'];
$this->view->date_info->calendar_date_link = $this->view->display[$display_id]->handler->options['calendar_date_link'];
}
parent::attach_to($display_id);
}
function pre_execute() {
// Make sure parent function is called so things like items per page get set.
parent::pre_execute();
$this->view->date_info->display_granularity = $this->calendar_type();
$this->view->date_info->calendar_type = $this->calendar_type();
}
function query() {
// If we are using legend colors based on taxonomy, make sure the
// node vid field is added to the query so the theme can use it.
if (!empty($this->view->date_info->calendar_colors_taxonomy)) {
if (empty($this->additional_fields)) $this->additional_fields = array();
$this->view->query->add_field('node', 'vid');
}
parent::query();
}
/**
* Override some of the parent options.
*/
function options(&$display) {
parent::options($display);
$display['inherit_argments'] = TRUE;
$display['inherit_filters'] = TRUE;
$display['attachment_position'] = 'after';
}
/**
* Add custom option definitions.
*/
function option_definition() {
$options = parent::option_definition();
$options['calendar_type'] = array('default' => $this->calendar_type());
return $options;
}
function options_form(&$form, &$form_state) {
// It is very important to call the parent function here:
parent::options_form($form, $form_state);
switch ($form_state['section']) {
case 'calendar_type':
$form['#title'] .= t('Calendar period');
$form['calendar_type'] = array(
'#type' => 'select',
'#description' => t('Select the calendar time period for this display.'),
'#default_value' => $this->calendar_type(),
'#options' => calendar_display_types(),
);
break;
}
}
/**
* Perform any necessary changes to the form values prior to storage.
* There is no need for this function to actually store the data.
*/
function options_submit($form, &$form_state) {
// It is very important to call the parent function here:
parent::options_submit($form, $form_state);
switch ($form_state['section']) {
case 'calendar_type':
$this->set_option($form_state['section'], $form_state['values'][$form_state['section']]);
break;
}
}
/**
* Provide the summary for attachment options in the views UI.
*
* This output is returned as an array.
*/
function options_summary(&$categories, &$options) {
parent::options_summary($categories, $options);
$types = calendar_display_types();
$categories['calendar_settings'] = array(
'title' => t('Calendar settings'),
);
$options['calendar_type'] = array(
'category' => 'calendar_settings',
'title' => t('Calendar period'),
'value' => $types[$this->calendar_type()],
);
}
/**
* Take away the option to change these values.
*/
function defaultable_sections($section = NULL) {
if (in_array($section, array('inherit_argments', 'inherit_filters', 'attachment_position',))) {
return FALSE;
}
return parent::defaultable_sections($section);
}
}

View file

@ -0,0 +1,78 @@
<?php
// $Id: calendar_plugin_display_block.inc,v 1.1.2.12 2010/12/28 15:35:50 karens Exp $
/**
* The plugin that handles a calendar block.
*
* The only style option that will be available is the calendar
* style, which creates the navigation and links to other calendar
* displays. All options for paging, row plugins, etc. are
* deferred to the attachments.
*/
class calendar_plugin_display_block extends views_plugin_display_block {
function init(&$view, &$display, $options = NULL) {
parent::init($view, $display, $options);
}
/**
* Display validation.
*/
function validate() {
$errors = parent::validate();
$arguments = $this->display->handler->get_option('arguments');
if (!in_array('date_argument', array_keys($arguments))) {
if (empty($this->view->date_info->arg_missing)) {
$errors[] = t("The Calendar period display '@display_title' will not work without a Date argument.", array('@display_title' => $this->definition['title']));
}
$this->view->date_info->arg_missing = TRUE;
}
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
return $errors;
}
function get_style_type() { return 'calendar'; }
function defaultable_sections($section = NULL) {
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
return FALSE;
}
return parent::defaultable_sections($section);
}
/**
* Override some of the parent options.
*/
function options(&$display) {
parent::options($display);
$display['style_plugin'] = 'calendar_nav';
$display['items_per_page'] = 0;
$display['row_plugin'] = '';
$display['defaults']['style_plugin'] = FALSE;
$display['defaults']['style_options'] = FALSE;
$display['defaults']['items_per_page'] = FALSE;
$display['defaults']['row_plugin'] = FALSE;
$display['defaults']['row_options'] = FALSE;
}
/**
* The display block handler returns the structure necessary for a block.
*
* TODO This can be removed when the patch at http://drupal.org/node/290328
* gets into an official release.
*/
function execute() {
// Prior to this being called, the $view should already be set to this
// display, and arguments should be set on the view.
$info['content'] = $this->view->render();
$info['subject'] = filter_xss_admin($this->view->get_title());
if (!empty($this->view->result) || $this->get_option('empty') || !empty($this->view->style_plugin->definition['even empty'])) {
return $info;
}
}
}

View file

@ -0,0 +1,297 @@
<?php
// $Id: calendar_plugin_display_page.inc,v 1.1.2.25 2011/01/03 02:39:05 karens Exp $
/**
* The plugin that handles a full calendar page.
*
* The only style option that will be available is the calendar
* style, which creates the navigation and links to other calendar
* displays. All options for paging, row plugins, etc. are
* deferred to the attachments.
*/
class calendar_plugin_display_page extends views_plugin_display_page {
function render() {
if (!empty($this->view->date_info->forbid)) {
drupal_not_found();
exit;
}
return parent::render();
}
/**
* Display validation.
*/
function validate() {
$errors = parent::validate();
$arguments = $this->display->handler->get_option('arguments');
if (!in_array('date_argument', array_keys($arguments))) {
if (empty($this->view->date_info->arg_missing)) {
$errors[] = t("The Calendar display '@display_title' will not work without a Date argument.", array('@display_title' => $this->definition['title']));
}
$this->view->date_info->arg_missing = TRUE;
}
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
return $errors;
}
function get_style_type() { return 'calendar'; }
function defaultable_sections($section = NULL) {
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
return FALSE;
}
return parent::defaultable_sections($section);
}
/**
* Override some of the parent options.
*/
function options(&$display) {
parent::options($display);
$display['style_plugin'] = 'calendar_nav';
$display['items_per_page'] = 0;
$display['row_plugin'] = '';
$display['defaults']['style_plugin'] = FALSE;
$display['defaults']['style_options'] = FALSE;
$display['defaults']['row_plugin'] = FALSE;
$display['defaults']['row_options'] = FALSE;
$display['defaults']['items_per_page'] = FALSE;
}
/**
* Add custom option definitions.
*/
function option_definition () {
$options = parent::option_definition();
$options['calendar_colors'] = array('default' => array());
$options['calendar_colors_vocabulary'] = array('default' => array());
$options['calendar_colors_taxonomy'] = array('default' => array());
$options['calendar_colors_group'] = array('default' => array());
$options['calendar_popup'] = array('default' => 0);
$options['calendar_date_link'] = array('default' => '');
return $options;
}
/**
* Provide the summary for attachment options in the views UI.
*
* This output is returned as an array.
*/
function options_summary(&$categories, &$options) {
// It is very important to call the parent function here:
parent::options_summary($categories, $options);
$categories['calendar_settings'] = array(
'title' => theme('advanced_help_topic', 'calendar', 'settings') . t('Calendar settings'),
);
$colors = $this->get_option('calendar_colors');
$colors_taxonomy = $this->get_option('calendar_colors_taxonomy');
$options['calendar_colors'] = array(
'category' => 'calendar_settings',
'title' => t('Legend Content Types'),
'value' => t('Edit'),
);
$options['calendar_colors_vocabulary'] = array(
'category' => 'calendar_settings',
'title' => t('Legend Vocabularies'),
'value' => t('Edit'),
);
$options['calendar_colors_taxonomy'] = array(
'category' => 'calendar_settings',
'title' => t('Legend Terms'),
'value' => t('Edit'),
);
if (function_exists('og_all_groups_options')) {
$colors_group = $this->get_option('calendar_colors_group');
$options['calendar_colors_group'] = array(
'category' => 'calendar_settings',
'title' => t('Legend Groups'),
'value' => t('Edit'),
);
}
$popup_options = $this->popup_options();
$default = $this->get_option('calendar_popup');
$options['calendar_popup'] = array(
'category' => 'calendar_settings',
'title' => t('Date changer'),
'value' => isset($default) ? $popup_options[$default] : $popup_options[0],
);
$default = $this->get_option('calendar_date_link');
$options['calendar_date_link'] = array(
'category' => 'calendar_settings',
'title' => t('Add new date link'),
'value' => !empty($default) ? check_plain(node_get_types('name', $default)) : t('None'),
);
}
function popup_options() {
return array(0 => t('No'), 1 => t('Yes'));
}
function options_form(&$form, &$form_state) {
// It is very important to call the parent function here:
parent::options_form($form, $form_state);
switch ($form_state['section']) {
case 'calendar_popup':
$form['#title'] .= t('Date changer');
$form['calendar_popup'] = array(
'#type' => 'radios',
'#default_value' => $this->get_option('calendar_popup'),
'#options' => $this->popup_options(),
'#description' => t('Display a popup calendar date selector?'),
);
break;
case 'calendar_date_link':
$form['#title'] .= t('Add new date link');
$form['calendar_date_link'] = array(
'#type' => 'radios',
'#default_value' => $this->get_option('calendar_date_link'),
'#options' => array('' => t('No link')) + node_get_types('names'),
'#description' => t('Display a link to add a new date of the specified content type. Displayed only to users with appropriate permissions.'),
);
break;
case 'calendar_colors':
$method = 'types';
// TODO Move the embedded styles other than the color into a stylesheet.
$form['#title'] .= t('Content Type Legend Colors');
$form['calendar_colors']['#tree'] = TRUE;
$form['calendar_colors']['#prefix'] .= '<div class="form-item"><label>'. t('Content Type') .'</label><p>'. t('Set a hex color value (like #ffffff) to use in the calendar legend for each content type. Types with empty values will have no stripe in the calendar and will not be added to the legend.') .'</p></div>';
$form['calendar_colors']['colorpicker'] = array(
'#type' => 'calendar_colorpicker',
'#prefix' => '<div class="clear-block"><div style="float:left">',
'#suffix' => '</div>',
);
$colors = $this->get_option('calendar_colors');
switch ($method) {
case 'types':
$color_types = node_get_types('names');
break;
}
foreach ($color_types as $key => $name) {
$form['calendar_colors']['color'][$key] = array(
'#title' => $name,
'#type' => 'calendar_colorfield',
'#default_value' => isset($colors[$key]) ? $colors[$key] : '#ffffff',
'#calendar_colorpicker' => 'calendar-colors-colorpicker',
'#prefix' => '<div style="float:left;margin-right:10px">',
'#suffix' => '</div>',
);
}
$form['calendar_colors']['color']['#suffix'] = '</div>';
break;
case 'calendar_colors_vocabulary':
$taxonomies = taxonomy_get_vocabularies();
$options = array();
foreach ($taxonomies as $vid => $vocab) {
$options[$vid] = $vocab->name;
}
$colors_vocabulary = $this->get_option('calendar_colors_vocabulary');
$form['#title'] .= t('Vocabulary Legend Types');
$form['calendar_colors_vocabulary'] = array(
'#type' => 'checkboxes',
'#default_value' => isset($colors_vocabulary) ? $colors_vocabulary : array(),
'#multiple' => TRUE,
'#options' => $options,
);
$form['calendar_colors_vocabulary']['#prefix'] .= '<div class="form-item"><label>'. t('Vocabularies') .'</label>'. t('Select vocabularies to use for setting calendar legend colors by taxonomy term. This works best for vocabularies with only a limited number of possible terms.') .'</div>';
break;
case 'calendar_colors_taxonomy':
$taxonomies = (array) $this->get_option('calendar_colors_vocabulary');
$colors_taxonomy = $this->get_option('calendar_colors_taxonomy');
$form['#title'] .= t('Taxonomy Legend Colors');
$form['calendar_colors_taxonomy']['#prefix'] = '';
if (empty($taxonomies)) {
$form['calendar_colors_taxonomy']['#prefix'] .= '<div class="form-item warning">'. t('Please select Legend vocabularies first!') .'</div>';
}
$form['calendar_colors_taxonomy']['#prefix'] .= '<div class="form-item"><label>'. t('Taxonomy Terms') .'</label><p>'. t('Set a hex color value (like #ffffff) to use in the calendar legend for each taxonomy term. Terms with empty values will have no stripe in the calendar and will not be added to the legend.') .'</p></div>';
$form['calendar_colors_taxonomy']['#tree'] = TRUE;
$form['calendar_colors_taxonomy']['colorpicker'] = array(
'#type' => 'calendar_colorpicker',
'#prefix' => '<div class="clear-block"><div style="float:left">',
'#suffix' => '</div>',
);
foreach ($taxonomies as $vid => $taxonomy){
$vocab = taxonomy_get_tree($vid);
foreach ($vocab as $tid => $term){
$form['calendar_colors_taxonomy']['color'][$term->tid] = array(
'#title' => t($term->name),
'#type' => 'calendar_colorfield',
'#default_value' => isset($colors_taxonomy[$term->tid]) ? $colors_taxonomy[$term->tid] : '#ffffff',
'#calendar_colorpicker' => 'calendar-colors-taxonomy-colorpicker',
'#prefix' => '<div style="float:left;margin-right:10px">',
'#suffix' => '</div>',
);
}
}
$form['calendar_colors_taxonomy']['color']['#suffix'] = '</div>';
break;
case 'calendar_colors_group':
$colors_group = $this->get_option('calendar_colors_group');
$form['#title'] .= t('Group Legend Colors');
$form['calendar_colors_group']['#prefix'] = '';
$form['calendar_colors_group']['#prefix'] .= '<div class="form-item"><label>' . t('Group') . '</label><p>' . t('Set a hex color value (like #ffffff) to use in the calendar legend for each group. Groups with empty values will have no stripe in the calendar and will not be added to the legend.') .'</p></div>';
$form['calendar_colors_group']['#tree'] = TRUE;
$form['calendar_colors_group']['colorpicker'] = array(
'#type' => 'calendar_colorpicker',
'#prefix' => '<div class="clear-block"><div style="float:left">',
'#suffix' => '</div>',
);
$groups = og_all_groups_options();
foreach ($groups as $gid => $group_name){
$form['calendar_colors_group']['color'][$gid] = array(
'#title' => t($group_name),
'#type' => 'calendar_colorfield',
'#default_value' => isset($colors_group[$gid]) ? $colors_group[$gid] : '#ffffff',
'#calendar_colorpicker' => 'calendar-colors-group-colorpicker',
'#prefix' => '<div style="float:left;margin-right:10px">',
'#suffix' => '</div>',
);
}
$form['calendar_colors_group']['color']['#suffix'] = '</div>';
break;
}
}
/**
* Perform any necessary changes to the form values prior to storage.
* There is no need for this function to actually store the data.
*/
function options_submit($form, &$form_state) {
// It is very important to call the parent function here:
parent::options_submit($form, $form_state);
switch ($form_state['section']) {
case 'calendar_popup':
$this->set_option($form_state['section'], $form_state['values'][$form_state['section']]['popup']);
break;
case 'calendar_colors':
case 'calendar_colors_taxonomy':
case 'calendar_colors_group':
$this->set_option($form_state['section'], $form_state['values'][$form_state['section']]['color']);
break;
case 'calendar_colors_vocabulary':
$this->set_option($form_state['section'], array_filter($form_state['values'][$form_state['section']]));
break;
case 'calendar_date_link':
$this->set_option($form_state['section'], ($form_state['values'][$form_state['section']]));
variable_set('calendar_date_link_'. $form_state['values']['calendar_date_link'], $this->display->handler->get_option('path'));
break;
}
}
}

View file

@ -0,0 +1,180 @@
<?php
// $Id: calendar_plugin_style.inc,v 1.1.2.18 2011/01/03 02:39:05 karens Exp $
/**
* Style plugin to create the calendar navigation and links.
*
* Used by the main calendar page and calendar block displays.
*/
class calendar_plugin_style extends views_plugin_style {
/**
* Init will be called after construct, when the plugin is attached to a
* view and a display.
*/
function init(&$view, &$display, $options = NULL) {
parent::init($view, $display, $options);
if (!isset($view->date_info)) {
$view->date_info = new StdClass();
}
$view->date_info->display_types = $this->display_types();
}
function display_types($granularity = NULL, $option_type = 'names') {
$ids = array();
$names = array();
foreach (calendar_display_types() as $name => $type) {
foreach ($this->view->display as $id => $display) {
if ($display->display_plugin == 'calendar_period') {
if (!empty($display->display_options['calendar_type']) && $display->display_options['calendar_type'] == $name) {
$attachments = array_filter($display->display_options['displays']);
if (isset($attachments['calendar_1'])) {
$ids[$name] = $id;
$names[$name] = $display->display_title;
}
}
}
}
}
if ($granularity) {
return $$option_type[$granularity];
}
return $$option_type;
}
/**
* Calendar argument date fields used in this view.
*/
function date_fields() {
$date_fields = array();
$calendar_fields = date_api_fields($this->view->base_table);
$arguments = $this->display->handler->get_option('arguments');
foreach ($arguments as $name => $argument) {
if (isset($argument['date_fields'])) {
foreach ($argument['date_fields'] as $date_field) {
$field = $calendar_fields['name'][$date_field];
$handler = views_get_handler($field['table_name'], $field['field_name'], 'field');
if ($handler) {
$date_fields[$date_field] = $field;
$date_fields[$date_field]['name'] = $handler->ui_name();
}
}
}
}
return ($date_fields);
}
/**
* Style validation.
*/
function validate() {
$errors = parent::validate();
if (empty($this->display->display_options['style_plugin'])) {
return $errors;
}
$style = $this->display->display_options['style_plugin'];
$arguments = $this->display->handler->get_option('arguments');
if (!in_array('date_argument', array_keys($arguments))) {
if (empty($this->view->date_info->arg_missing)) {
$errors[$style] = t("The @style style requires a Date argument.", array('@style' => $style));
}
$this->view->date_info->arg_missing = TRUE;
$this->date_info->arg_fields = array();
}
else {
$this->date_info->arg_fields = $arguments['date_argument']['date_fields'];
if ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
}
// Make sure date fields are not set up to 'Group multiple values'
// in the calendar style.
if ($style == 'calendar_style') {
$view_fields = date_api_fields($this->view->base_table);
$view_fields = $view_fields['name'];
$fields = $this->display->handler->get_option('fields');
$has_fields = FALSE;
foreach ($fields as $column => $field) {
$field_name = $field['table'] .".". $field['field'];
if (in_array($field_name, $this->date_info->arg_fields)) {
$has_fields = TRUE;
}
if (!empty($field['multiple']) && array_key_exists($field_name, $view_fields)) {
$cck_fields = content_fields();
$real_name = $view_fields[$field_name]['real_field_name'];
if ($cck_fields[$real_name]['multiple'] && !empty($field['multiple']['group'])) {
$errors[] = t("The date field '@field' used by the display '@display_title' cannot be set to 'Group multiple values'.", array('@field' => $view_fields[$field_name]['label'], '@display_title' => $this->display->display_title));
}
}
}
// The calendar needs the values from the date fields to split
// the nodes into calendar cells, so make sure the field gets
// added into the query.
if (!$has_fields) {
$errors[] = t('The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar.');
}
}
return $errors;
}
function query() {
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
$style_options = $this->view->style_plugin->options;
// Evaluate our argument values and figure out which
// calendar display we need to create.
$i = 0;
foreach ($this->view->argument as $id => $argument) {
if ($argument->field == 'date_argument') {
// TODO Decide if we want to provide a date here or not.
// Adding this now is to prevent fatal errors later if the
// view is used in unexpected ways without a date being set.
if (empty($argument->min_date)) {
$value = $argument->get_default_argument();
$range = $argument->date_handler->arg_range($value);
$argument->min_date = $range[0];
$argument->max_date = $range[1];
}
$this->view->date_info->granularity = !empty($argument->granularity) ? $argument->granularity : $argument->options['granularity'];
$this->view->date_info->date_arg = !empty($this->view->args) && count($this->view->args) > $argument->position ? $this->view->args[$argument->position] : '';
$this->view->date_info->date_arg_pos = $i;
$this->view->date_info->year = isset($argument->year) ? $argument->year : NULL;
$this->view->date_info->month = isset($argument->month) ? $argument->month: NULL;
$this->view->date_info->day = isset($argument->day) ? $argument->day : NULL;
$this->view->date_info->week = isset($argument->week) ? $argument->week : NULL;
$this->view->date_info->min_date = $argument->min_date;
$this->view->date_info->max_date = $argument->max_date;
$this->view->date_info->min_date_date = date_format($this->view->date_info->min_date, DATE_FORMAT_DATE);
$this->view->date_info->max_date_date = date_format($this->view->date_info->max_date, DATE_FORMAT_DATE);
$this->view->date_info->forbid = isset($argument->forbid) ? $argument->forbid : FALSE;
// Stop after the first date argument, if there is more than one.
break;
}
$i++;
}
$this->view->date_info->display_types = $this->display_types();
$keys = drupal_map_assoc(array_keys(calendar_display_types()));
$this->view->date_info->calendar_type = $keys[$this->view->date_info->granularity];
// bring the node type into the query so we can use it in the theme
if ($this->view->base_table == 'node') {
$this->view->query->add_field('node', 'type');
}
parent::query();
}
/**
* Render the calendar navigation style.
*/
function render() {
return theme($this->theme_functions(), $this->view, $this->options, array());
}
}

View file

@ -0,0 +1,173 @@
<?php
// $Id: calendar_view_plugin_style.inc,v 1.1.2.21 2010/12/28 15:35:50 karens Exp $
/**
* Style plugin to render the year, month, week, or day calendar view.
*/
class calendar_view_plugin_style extends calendar_plugin_style {
/**
* Init will be called after construct, when the plugin is attached to a
* view and a display.
*/
function init(&$view, &$display, $options = NULL) {
parent::init($view, $display, $options);
$calendar_type = $this->display->handler->get_option('calendar_type');
$view->date_info->style_name_size = $this->options['name_size'];
$view->date_info->style_with_weekno = $this->options['with_weekno'];
$view->date_info->style_multiday_theme = $this->options['multiday_theme'];
$view->date_info->style_theme_style = $this->options['theme_style'];
$view->date_info->style_max_items = $this->options['max_items'];
$view->date_info->style_max_items_behavior = $this->options['max_items_behavior'];
if (!empty($this->options['groupby_times_custom'])) {
$view->date_info->style_groupby_times = explode(',', $this->options['groupby_times_custom']);
}
else {
$view->date_info->style_groupby_times = calendar_groupby_times($this->options['groupby_times']);
}
$view->date_info->style_groupby_field = $this->options['groupby_field'];
// TODO make this an option setting.
$view->date_info->style_show_empty_times = !empty($this->options['groupby_times_custom']) ? TRUE : FALSE;
// Make sure views does't try to limit the number of items in this view.
$this->view->pager['items_per_page'] = 0;
}
/**
* Set default options
*/
function options(&$options) {
$options['name_size'] = 3;
$options['with_weekno'] = 0;
$options['multiday_theme'] = '1';
$options['theme_style'] = '1';
$options['max_items'] = 0;
$options['max_items_behavior'] = 'more';
$options['groupby_times'] = 'hour';
$options['groupby_times_custom'] = '';
$options['groupby_field'] = '';
}
/**
* Style options.
*/
function options_form(&$form, &$form_state) {
$calendar_type = $this->display->handler->get_option('calendar_type');
$form['name_size'] = array(
'#title' => t('Calendar day of week names'),
'#default_value' => $this->options['name_size'],
'#type' => in_array($calendar_type, array('year', 'month', 'week')) ? 'radios' : 'value',
'#options' => array(1 => t('First letter of name'), 2 => t('First two letters of name'), 3 => t('Abbreviated name'), 99 => t('Full name')),
'#description' => t('The way day of week names should be displayed in a calendar.'),
);
$form['with_weekno'] = array(
'#title' => t('Show week numbers'),
'#default_value' => $this->options['with_weekno'],
'#type' => in_array($calendar_type, array('month')) ? 'radios' : 'value',
'#options' => array(0 => t('No'), 1 => t('Yes')),
'#description' => t('Whether or not to show week numbers in the left column of calendar weeks and months.'),
);
$form['max_items'] = array(
'#title' => t('Maximum items'),
'#type' => in_array($calendar_type, array('month')) ? 'select' : 'value',
'#options' => array(CALENDAR_SHOW_ALL => t('Unlimited'), CALENDAR_HIDE_ALL => t('No items'), 3 => t('3 items'), 5 => t('5 items'), 10 => t('10 items')),
'#default_value' => $calendar_type != 'day' ? $this->options['max_items'] : 0,
'#description' => t('Maximum number of items to show in calendar cells, used to keep the calendar from expanding to a huge size when there are lots of items in one day. '),
);
$form['max_items_behavior'] = array(
'#title' => t('Too many items'),
'#type' => in_array($calendar_type, array('month')) ? 'select' : 'value',
'#options' => array('more' => t("Show maximum, add 'more' link"), 'hide' => t('Hide all, add link to day')),
'#default_value' => $calendar_type != 'day' ? $this->options['max_items_behavior'] : 'more',
'#description' => t('Behavior when there are more than the above number of items in a single day. When there more items than this limit, a link to the day view will be displayed.'),
);
$form['groupby_times'] = array(
'#title' => t('Time grouping'),
'#type' => in_array($calendar_type, array('day', 'week')) ? 'select' : 'value',
'#default_value' => $this->options['groupby_times'],
'#description' => t("Group items together into time periods based on their start time."),
'#options' => array('' => t('None'), 'hour' => t('Hour'), 'half' => t('Half hour'), 'custom' => t('Custom')),
);
$form['groupby_times_custom'] = array(
'#title' => t('Custom time grouping'),
'#type' => in_array($calendar_type, array('day', 'week')) ? 'textarea' : 'value',
'#default_value' => $this->options['groupby_times_custom'],
'#description' => t("When choosing the 'custom' Time grouping option above, create custom time period groupings as a comma-separated list of 24-hour times in the format HH:MM:SS, like '00:00:00,08:00:00,18:00:00'. Be sure to start with '00:00:00'. All items after the last time will go in the final group."),
);
// Create a list of fields that are available for grouping and truncation,
// excluding the date fields in the view from the grouping options.
$field_options = array();
$date_field_options = array();
$fields = $this->display->handler->get_option('fields');
$date_fields = array_keys($this->date_fields());
foreach ($fields as $field_name => $field) {
$handler = views_get_handler($field['table'], $field['field'], 'field');
if (!in_array($field['table'] .'.'. $field['field'], $date_fields)) {
$field_options[$field['table'] .'_'. $field['field']] = $handler->ui_name();
}
else {
$date_field_options[$field['table'] .'_'. $field['field']] = $handler->ui_name();
}
}
$form['groupby_field'] = array(
'#title' => t('Field grouping'),
'#type' => in_array($calendar_type, array('day')) ? 'select' : 'value',
'#default_value' => $this->options['groupby_field'],
'#description' => t("Optionally group items into columns by a field value, for instance select the content type to show items for each content type in their own column, or use a location field to organize items into columns by location."),
'#options' => array('' => '') + $field_options,
);
if (module_exists('calendar_multiday')) {
$form['multiday_theme'] = array(
'#title' => t('Multi-day style'),
'#default_value' => $this->options['multiday_theme'],
'#type' => in_array($calendar_type, array('month', 'week')) ? 'select' : 'value',
'#options' => array(0 => t('Display multi-day item as a single column'), 1 => t('Display multi-day item as a multiple column row')),
'#description' => t('If selected, items which span multiple days will displayed as a multi-column row. If not selected, items will be displayed as an individual column.'),
);
$form['theme_style'] = array(
'#title' => t('Overlapping time style'),
'#default_value' => $this->options['theme_style'],
'#type' => in_array($calendar_type, array('day', 'week')) ? 'select' : 'value',
'#options' => array(0 => t('Do not display overlapping items'), 1 => t('Display overlapping items')),
'#description' => t('Select whether calendar items are displayed as overlapping items.'),
);
}
foreach ($form as $key => $value) {
if ($value['#type'] == 'value') {
$form[$key]['#value'] = $value['#default_value'];
}
}
}
/**
* Render the calendar attachment style.
*/
function render() {
$calendar_type = $this->display->handler->get_option('calendar_type');
// Adjust the theme to match the currently selected default.
// Only the month view needs the special 'mini' class,
// which is used to retrieve a different, more compact, theme.
if (!empty($this->view->date_info->mini) && $this->view->date_info->granularity == 'month') {
$this->definition['theme'] = 'calendar_mini';
}
elseif ( module_exists('calendar_multiday') && $calendar_type == 'week') {
$this->view->date_info->mini = FALSE;
$this->definition['theme'] = ($this->view->style_options['multiday_theme'] == '1' && $this->view->style_options['theme_style'] == '1') ? 'calendar_'. $this->view->date_info->granularity .'_overlap' : 'calendar_'. $this->view->date_info->granularity;
}
elseif ( module_exists('calendar_multiday') && $calendar_type == 'day') {
$this->view->date_info->mini = FALSE;
$this->definition['theme'] = ($this->view->style_options['theme_style'] == '1') ? 'calendar_'. $this->view->date_info->granularity .'_overlap' : 'calendar_'. $this->view->date_info->granularity;
}
else {
$this->view->date_info->mini = FALSE;
$this->definition['theme'] ='calendar_'. $this->view->date_info->granularity;
}
$this->view->date_info->hide_admin_links = TRUE;
return theme($this->theme_functions(), $this->view, $this->options, array());
}
}

View file

@ -0,0 +1,235 @@
# $Id: includes.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
#
# Czech translation of Calendar (6.x-2.2)
# Copyright (c) 2010 by the Czech translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (6.x-2.2)\n"
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
"PO-Revision-Date: 2010-09-29 22:09+0000\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
msgid "Edit"
msgstr "Upravit"
msgid "Maximum items"
msgstr "Maximální počet položek"
msgid "Custom"
msgstr "Vlastní"
msgid "Unlimited"
msgstr "Neomezené"
msgid "Full name"
msgstr "Celé jméno"
msgid "Hour"
msgstr "Hodina"
msgid "No link"
msgstr "Žádný odkaz"
msgid "First letter of name"
msgstr "První písmeno jména"
msgid "First two letters of name"
msgstr "První dvě písmena jména"
msgid "Abbreviated name"
msgstr "Zkrácené jméno"
msgid "Show week numbers"
msgstr "Zobrazit čísla týdnů"
msgid "3 items"
msgstr "3 položky"
msgid "5 items"
msgstr "5 položek"
msgid "10 items"
msgstr "10 položek"
msgid ""
"Maximum number of items to show in calendar cells, used to keep the "
"calendar from expanding to a huge size when there are lots of items in "
"one day. "
msgstr ""
"Maximální počet položek zobrazených v buňce kalendáře. "
"Slouží k omezení rozměrů kalendáře při větším počtu "
"položek v jednom dni. "
msgid "Too many items"
msgstr "Příliš mnoho položek"
msgid "Show maximum, add 'more' link"
msgstr "Zobrazit maximální počet, připojit odkaz 'více'"
msgid "Hide all, add link to day"
msgstr "Skrýt vše, přidat odkaz na den"
msgid ""
"Behavior when there are more than the above number of items in a "
"single day. When there more items than this limit, a link to the day "
"view will be displayed."
msgstr ""
"Pokud je počet denních položek vyšší než definuje limit, potom "
"je zobrazen odkaz do pohledu reprezentujícího den."
msgid "Calendar page"
msgstr "Stránka kalendáře"
msgid ""
"Calendar page. Attach Calendar period attachments to this page, set to "
"show the year, month, day, and week views."
msgstr ""
"Stránka kalendáře. Přidat ke stránce s obdobím kalendáře, "
"určenou k zobrazení ročního, měsíčního, denního nebo "
"týdenního pohledu."
msgid "Calendar block"
msgstr "Blok kalendáře"
msgid ""
"Calendar page. Attach a Calendar period attachment to this block, set "
"to show the year, month, day, or week view."
msgstr ""
"Stránka kalendáře. Přidat k bloku přílohu s obdobím "
"kalendáře, určenou k zobrazení ročního, měsíčního, denního "
"nebo týdenního pohledu."
msgid ""
"An attachment for a Year, Month, Day, or Week calendar display, using "
"any style you choose. Attach to a Calendar page and/or a Calendar "
"block."
msgstr ""
"Příloha pro zobrazení kalendáře na rok, měsíc, den nebo týden "
"používá styl, který jste vybral. Přiložte ke stránce a/nebo "
"bloku kalendáře."
msgid "Calendar page year, month, week, or day view"
msgstr "Pohled stránky kalendáře pro rok, měsíc, týden nebo den"
msgid "Calendar navigation"
msgstr "Navigace kalendáře"
msgid "Creates back/next navigation and calendar links."
msgstr "Vytvoří navigaci \"zpět/další\" a odkazy kalendáře."
msgid "Displays Views results in a calendar."
msgstr "Zobrazuje výsledek Views v kalendáři."
msgid "A Calendar period display will not work without a Date argument."
msgstr ""
"Zobrazení období v kalendáři nebude fungovat bez argumentu typu "
"\"datum\"."
msgid "Select the calendar time period for this display."
msgstr "Vyberte časové období kalendáře pro toto zobrazení."
msgid ""
"The Calendar period display '@display_title' will not work without a "
"Date argument."
msgstr ""
"Pohled na období kalendáře '@display_title' nebude fungovat bez "
"data, jako argumentu."
msgid ""
"The Calendar display '@display_title' will not work without a Date "
"argument."
msgstr ""
"Pohled na kalendář '@display_title' nebude fungovat bez data, jako "
"argumentu."
msgid "Legend Content Types"
msgstr "Typy obsahu legendy"
msgid "Legend Vocabularies"
msgstr "Slovníky legendy"
msgid "Legend Terms"
msgstr "Termíny legendy"
msgid "Date changer"
msgstr "Změna datumu"
msgid "Add new date link"
msgstr "Přidej nový odkaz na datum"
msgid "Display a popup calendar date selector?"
msgstr "Zobrazit popup kalendář pro výběr data?"
msgid ""
"Display a link to add a new date of the specified content type. "
"Displayed only to users with appropriate permissions."
msgstr ""
"Zobrazit odkaz pro přidání nového data zadaného typu obsahu. "
"Zobrazí se pouze uživatelům s odpovídajícím oprávněním."
msgid "Content Type Legend Colors"
msgstr "Barevná legenda typů obsahu"
msgid ""
"<div class=\"form-item\"><label>Content Type</label><p>Set a hex color "
"value (like #ffffff) to use in the calendar legend for each content "
"type. Types with empty values will have no stripe in the calendar and "
"will not be added to the legend.</p></div>"
msgstr ""
"<div class=\"form-item\"><label>Typ obsahu</label><p>Nastavte "
"šestnáctkovou hodnotu barvy (např. #ffffff) pro každý typ obsahu, "
"který je v kalendáři použit. Pokud nebude typu přiřazena barva, "
"potom nebude tento typ v kalendáři nijak zvýrazněn a ani nebude "
"zahrnut do legendy.</p></div>"
msgid "Vocabulary Legend Types"
msgstr "Typy slovníků v legendě"
msgid ""
"<div class=\"form-item\"><label>Vocabularies</label>Select "
"vocabularies to use for setting calendar legend colors by taxonomy "
"term. This works best for vocabularies with only a limited number of "
"possible terms.</div>"
msgstr ""
"<div class=\"form-item\"><label>Slovníky</label>Vyberte slovník "
"jehož termíny chcete barevně odlišovat. Je vhodné používat "
"slovníky s omezeným počtem termínů.</div>"
msgid "Taxonomy Legend Colors"
msgstr "Barvy taxonomie v legendě"
msgid ""
"<div class=\"form-item warning\">Please select Legend vocabularies "
"first!</div>"
msgstr ""
"<div class=\"form-item warning\">Nejdříve prosím zvolte slovníky "
"legendy!</div>"
msgid ""
"<div class=\"form-item\"><label>Taxonomy Terms</label><p>Set a hex "
"color value (like #ffffff) to use in the calendar legend for each "
"taxonomy term. Terms with empty values will have no stripe in the "
"calendar and will not be added to the legend.</p></div>"
msgstr ""
"<div class=\"form-item\"><label>Termíny taxonomie</label><p>Nastavte "
"šestnáctkovou hodnotu barvy (např. #ffffff) pro každý termín, "
"který je v kalendáři použít. Pokud nebude termínu přiřazena "
"barva, potom nebude tento termín v kalendáři nijak zvýrazněn a "
"ani nebude zahrnut do legendy.</p></div>"
msgid "The @style style requires a Date argument."
msgstr "Styl @style vyžaduje argument typu \"datum\"."
msgid ""
"The date argument date fields must be added to this query. You can "
"exclude them if you do not want them displayed in the calendar."
msgstr ""
"Pole, které slouží jako argument datumu musí být součástí "
"dotazu. Avšak není nutné jej zobrazovat."
msgid "Calendar day of week names"
msgstr "Názvy dnů v kalendáři"
msgid "The way day of week names should be displayed in a calendar."
msgstr ""
"Způsob jakým mají být v kalendáři zobrazena názvy dní v "
"týdnu."
msgid ""
"Whether or not to show week numbers in the left column of calendar "
"weeks and months."
msgstr ""
"Uvádět čísla týdnů v levém sloupci při zobrazení týdne nebo "
"měsíce?"
msgid "No items"
msgstr "Žádné položky"
msgid "Time grouping"
msgstr "Seskupení podle času"
msgid "Group items together into time periods based on their start time."
msgstr ""
"Seskup položky do časových období podle jejich počátečního "
"času."
msgid "Half hour"
msgstr "Půl hodiny"
msgid "Custom time grouping"
msgstr "Vlastní seskupování podle času"
msgid ""
"When choosing the 'custom' Time grouping option above, create custom "
"time period groupings as a comma-separated list of 24-hour times in "
"the format HH:MM:SS, like '00:00:00,08:00:00,18:00:00'. Be sure to "
"start with '00:00:00'. All items after the last time will go in the "
"final group."
msgstr ""
"Když je výše zvoleno vlastní seskupování dle času, je nutné "
"vytvořit vlastní časové intervaly jako čárkami oddělený seznam "
"ve 24-hodinovém formátu HH:MM:SS (např. "
"'00:00:00,08:00:00,18:00:00'). Ujistěte se, že začínáte časem "
"'00:00:00'. Všechny položky po posledním čase budou zařazeny do "
"konečné skupiny."
msgid "Field grouping"
msgstr "Seskupování polí"
msgid ""
"Optionally group items into columns by a field value, for instance "
"select the content type to show items for each content type in their "
"own column, or use a location field to organize items into columns by "
"location."
msgstr ""
"Volitelně je možné seskupit položky do sloupců dle hodnoty pole. "
"Např. vyberte typ obsahu pro zobrazení počtu položek každého "
"typu obsahu ve vlastním sloupci, nebo použijte políčko místa pro "
"roztřídění položek do sloupců dle místa."

View file

@ -0,0 +1,3 @@
Just some credits.
The throbber is from thickbox and the x is from a jquery tooltip library, although I cannot remember which.

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

@ -0,0 +1,49 @@
div#calpopup {
display: block;
border: thin solid gray;
/* This is css3 stuff that will not work in IE<=8.
* What is here is a curved border for firefox and webkit
* and a drop shadow that will only appear in webkit.
**/
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
-webkit-box-shadow: 10px 10px 5px #888;
/* End CSS3 stuff */
background-color: white;
width: 25%;
position: absolute;
top: 20em;
left: 20em;
/* CSS to make sure that the popup is on top */
z-index: 800;
}
div#calpopup-body div.node {
margin: 0;
border: 0;
}
div#calpopup-body {
margin: 1em;
max-height: 20em;
overflow-y: auto;
/* IE7 Hack
* This keeps the date from sticking in one place while scrolling.
*/
position: relative;
}
#popup-close {
text-align: right;
padding: 1em 1em 0 1em;
}
div#nodelink {
margin: 1em;
}
img#popthrobber {
text-align: center;
margin: 3em;
}

View file

@ -0,0 +1,14 @@
; $Id: jcalendar.info,v 1.1.4.2 2008/06/23 14:55:01 karens Exp $
name = Calendar Popup
description = "Replaces the links to calendar items with a javascript popup that gracefully regresses if javascript is not enabled"
dependencies[] = calendar
dependencies[] = views
core = 6.x
package = Date/Time
; Information added by drupal.org packaging script on 2011-01-03
version = "6.x-2.4"
core = "6.x"
project = "calendar"
datestamp = "1294072550"

View file

@ -0,0 +1,82 @@
if (Drupal.jsEnabled) {
$(document).ready(function() {
// I am assuming that all of the links are refering to an internal node
// add the attribute rel=facebox to all of the links I want to have a popup
$('div.view-field > a').attr('class', 'popup');
// on click of a link
$('a.popup').click(function(a) {
// Make sure that other stuff is closed. This seems to cause a problem in Fx2 and IE7.
$('div#calpopup').fadeOut();
$('div#calpopup').remove();
// create div to hold data and add it to the end of the body
var div = $('<div id="calpopup"><div id="popup-close"><img id="popup-close-img" src="' + Drupal.settings.jcalendar.path + '/images/cross.png" /></div><div id="calpopup-body"><img src="' + Drupal.settings.jcalendar.path + '/images/throbber.gif" id="popthrobber" /></div></div>').attr('style','display: none');
div.appendTo(document.body);
// Locate Popup
var offset = $(this).offset();
// Check position with window width.
var offset_left = offset.left + 5;
if ($(window).width() < $('#calpopup').width() + offset.left) {
offset_left -= $('#calpopup').width() + 5;
if (offset_left < 0) {
offset_left = 0;
}
}
var offset_top = offset.top + 25;
if ($(window).height() < $('#calpopup').height() + offset_top) {
offset_top -= $('#calpopup').height() + 25;
if (offset_top < 0) {
offset_top = 0;
}
}
$('#calpopup').css('left', offset_left);
$('#calpopup').css('top', offset_top);
// Show Popup
$('#calpopup').fadeIn('slow');
// If sucessful call this
function domCallback(msg) {
$('#calpopup-body').html(msg);
}
// Get NodeID and ItemID
var ids = $(this).parent().parent().attr('class');
var arrs = ids.split(" ");
var arr = arrs[0].split(".");
var nid = arr[1];
var id = arr[4];
// fill the div with data
$.ajax({
type: "GET",
url: Drupal.settings.basePath + "?q=jcalendar/getnode/"+nid+"/"+ids,
success: function(msg){
domCallback(msg);
}
});
// On click of the close image
$('img#popup-close-img').click(function(x) {
$('div#calpopup').fadeOut();
$('div#calpopup').remove();
});
$(document).click(function(y) {
var $tgt = $(y.target);
if (!$tgt.parents().is('div#calpopup')) {
$('div#calpopup').fadeOut();
$('div#calpopup').remove();
$(document).unbind("click");
}
});
// Don't Follow the real link
return false;
});
});
}

View file

@ -0,0 +1,97 @@
<?php
// $Id: jcalendar.module,v 1.1.4.17 2010/11/21 12:24:45 karens Exp $
/**
* @file
* jQuery Calendar UI features.
*/
/**
* Display help and module information
* @param section which section of the site we're displaying help
* @return help text for section
*/
function jcalendar_help($path, $arg) {
$output = '';
switch ($path) {
case "admin/help#jcalendar":
$output = '<p>'. t("Creates a popup for calendar dates.") .'</p>';
break;
}
return $output;
} // function jcalendar_help
/**
* Get calendar node for popup
* @param integer nid Node id.
* @param string id Date field unique id.
* @return string HTML for node
*/
function get_calendar_node($nid, $id) {
$GLOBALS['devel_shutdown'] = FALSE;
if (is_numeric($nid)) {
if ($node = node_load($nid)) {
if (node_access("view", $node)) {
$node->date_id = $id;
$node->date_repeat_show = FALSE;
print theme('jcalendar_view', $node);
}
}
}}
/**
* Implemetation of hook_menu()
*/
function jcalendar_menu() {
$items['jcalendar/getnode'] = array(
'title' => 'Get Calendar Node',
'page callback' => 'get_calendar_node',
'page arguments' => array(2, 3),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Override the calendar view to inject javascript.
* @param view Which view we are using.
* @return unknown as of yet.
*/
function jcalendar_views_pre_view(&$view, &$display_id) {
static $js_added = false;
if ($js_added) {
return;
}
foreach ($view->display as $display) {
if ($display->display_plugin == 'calendar') {
$js_added = true;
$path = drupal_get_path('module', 'jcalendar');
$settings['jcalendar']['path'] = base_path() . $path;
drupal_add_js($settings, 'setting');
drupal_add_js($path .'/jcalendar.js');
drupal_add_css($path .'/jcalendar.css');
}
}
}
/**
* Implementation of hook_theme().
*/
function jcalendar_theme() {
return array(
'jcalendar_view' => array('arguments' => array('node' => NULL)),
);
}
/**
* Overrideable theme for the jcalendar popup view.
*
* Defaults to show the standard teaser view of the node.
*/
function theme_jcalendar_view($node) {
$output = node_view($node, TRUE);
$output .= '<div id="nodelink">'. l(t('more', array(), $node->language), calendar_get_node_link($node)) .'</div>';
return $output;
}

View file

@ -0,0 +1,28 @@
# $Id: jcalendar.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
#
# Czech translation of Calendar (6.x-2.2)
# Copyright (c) 2010 by the Czech translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (6.x-2.2)\n"
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
"PO-Revision-Date: 2010-09-29 20:42+0000\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
msgid "Creates a popup for calendar dates."
msgstr "Vytvoří popup okno pro data kalendáře"
msgid "Calendar Popup"
msgstr "Calendar Popup"
msgid ""
"Replaces the links to calendar items with a javascript popup that "
"gracefully regresses if javascript is not enabled"
msgstr ""
"Nahradí odkaz na položku kalendáře vyskakovacím oknem. Vyžaduje "
"povolený javascript."
msgid "Get Calendar Node"
msgstr "Získej uzel kalendáře"

View file

@ -0,0 +1,27 @@
# Hungarian translation of Calendar (all releases)
# Copyright (c) 2009 by the Hungarian translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (all releases)\n"
"POT-Creation-Date: 2009-11-10 16:39+0000\n"
"PO-Revision-Date: 2009-10-31 09:55+0000\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
msgid "Creates a popup for calendar dates."
msgstr "Hozzárendel egy felugró ablakot a naptár napjaihoz."
msgid "Calendar Popup"
msgstr "Calendar Popup"
msgid ""
"Replaces the links to calendar items with a javascript popup that "
"gracefully regresses if javascript is not enabled"
msgstr ""
"Egy javscript felugró ablakra cseréli a naptár elemek "
"hivatkozásait, ami elegánsan eltűnik, ha a javascript nem "
"engedélyezett."
msgid "Get Calendar Node"
msgstr "Naptár tartalom lekérdezése"

View file

@ -0,0 +1,49 @@
# $Id: jcalendar.pot,v 1.1.2.1 2009/02/17 11:06:21 karens Exp $
#
# LANGUAGE translation of Drupal (general)
# Copyright YEAR NAME <EMAIL@ADDRESS>
# Generated from files:
# jcalendar.module,v 1.1.4.15 2009/01/10 20:14:16 karens
# jcalendar.info,v 1.1.4.2 2008/06/23 14:55:01 karens
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2009-02-17 05:04-0600\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: jcalendar.module:18
msgid "Creates a popup for calendar dates."
msgstr ""
#: jcalendar.module:90
msgid "more"
msgstr ""
#: jcalendar.module:48
msgid "Get Calendar Node"
msgstr ""
#: jcalendar.module:0
msgid "jcalendar"
msgstr ""
#: jcalendar.info:0
msgid "Calendar Popup"
msgstr ""
#: jcalendar.info:0
msgid "Replaces the links to calendar items with a javascript popup that gracefully regresses if javascript is not enabled"
msgstr ""
#: jcalendar.info:0
msgid "Date/Time"
msgstr ""

View file

@ -0,0 +1,40 @@
// $Id: calendar_colorpicker.js,v 1.1.4.3 2008/11/21 22:04:56 karens Exp $
/**
* Implementation of hook_elements.
*
* Much of the colorpicker code was adapted from the Colorpicker module.
* That module has no stable release yet nor any D6 branch.
*/
/*
* Bind the colorpicker event to the form element
*/
Drupal.behaviors.calendarColorpicker = function (context) {
// do we have multiple calendar_colors?
if ($("div.calendar_colorpicker").size() > 0) {
// loop over each calendar_color type
$("div.calendar_colorpicker").each(function() {
// create the farbtastic colorpicker
var farb = $.farbtastic(this);
// get the id of the current matched colorpicker wrapper div
var id = $(this).attr("id");
// get the calendar_color_textfields associated with this calendar_color
$("input.calendar_colorfield").filter("." + id).each(function () {
// set the background colors of all of the textfields appropriately
farb.linkTo(this);
// when clicked, they get linked to the farbtastic colorpicker that they are associated with
$(this).click(function () {
farb.linkTo(this);
});
});
});
}
};

View file

@ -0,0 +1,33 @@
Creates calendar displays of Views results.
Create a new calendar by enabling or cloning the default calendar,
changing the date argument to use the correct date field(s), and setting
up the year, month, day, week, and block views with the desired styles
and fields.
Unlike previous versions of the Calendar module, there is just a single
Date argument instead of year, month, and day arguments. The argument
value will be YYYY-MM-DD for a day, YYYY-MM for a month, YYYY for a
year, and YYYY-W99 for a week. There is a default option to set the
argument to the current date when the argument is empty.
A calendar display creates calendar navigation and links to
multiple displays for the year, month, day, or week views. The actual
displays are created by attaching calendar views that use whatever
styles are desired for those pages.
Calendar views are attachments to create the year, month, day,
and week displays. They can be set to use any style, either a
calendar style or any other Views style, like teasers or lists.
If you don't want to use one of them, don't attach it to
anything. Only the attached views will show up in the calendar.
A calendar block will create a calendar block for the
view results. Attach a block view to the block and set up the
desired style in the block view.
If the Calendar iCal module is enabled, an iCal feed can be
attached to the view.

View file

@ -0,0 +1,19 @@
<?php
// $Id: calendar-datebox.tpl.php,v 1.2.2.3 2010/11/21 14:15:32 karens Exp $
/**
* @file
* Template to display the date box in a calendar.
*
* - $view: The view.
* - $granularity: The type of calendar this box is in -- year, month, day, or week.
* - $mini: Whether or not this is a mini calendar.
* - $class: The class for this box -- mini-on, mini-off, or day.
* - $day: The day of the month.
* - $date: The current date, in the form YYYY-MM-DD.
* - $link: A formatted link to the calendar day view for this day.
* - $url: The url to the calendar day view for this day.
* - $selected: Whether or not this day has any items.
* - $items: An array of items for this day.
*/
?>
<div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print $selected ? $link : $day; ?> </div>

View file

@ -0,0 +1,53 @@
<?php
// $Id: calendar-day-node.tpl.php,v 1.2.2.4 2010/11/21 13:19:37 karens Exp $
/**
* @file
* Template to display a view item as a calendar day node.
*
* $node
* A node object for this calendar item. Note this is
* not a complete node object, but it will have $node->nid
* that you can use to load the full object, and
* $node->type to tell the content type of the node.
*
* $fields
* An array of information for every field selected in the 'Fields'
* section of this view, formatted as requested in the View setup.
*
* Calendar info for this individual calendar item is in local time --
* the user timezone where configurable timezones are allowed and set,
* otherwise the site timezone. If this item has extends over more than
* one day, it has been broken apart into separate nodes for each calendar
* date and calendar_start will be no earlier than the start of
* the current day and calendar_end will be no later than the end
* of the current day.
*
* $calendar_start - A formatted datetime start date for this item.
* i.e. '2008-05-12 05:26:15'.
* $calendar_end - A formatted datetime end date for this item,
* the same as the start date except for fields that have from/to
* fields defined, like Date module dates.
* $calendar_start_date - a PHP date object for the start time.
* $calendar_end_date - a PHP date object for the end time.
*
* You can use PHP date functions on the date object to display date
* information in other ways, like:
*
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
*
* @see template_preprocess_calendar_day_node.
*/
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="<?php print $node->date_id; ?> calendar dayview">
<?php print theme('calendar_stripe_stripe', $node); ?>
<?php foreach ($fields as $field): ?>
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
<?php if ($field['label']): ?>
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
<?php endif; ?>
<?php print $field['data']; ?>
</div>
<?php endforeach; ?>
</div>
</div>

View file

@ -0,0 +1,81 @@
<?php
// $Id: calendar-day.tpl.php,v 1.7.2.10 2010/11/21 13:19:37 karens Exp $
/**
* @file
* Template to display a view as a calendar day, grouped by time
* and optionally organized into columns by a field value.
*
* @see template_preprocess_calendar_day.
*
* $rows: The rendered data for this day.
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
* $rows['datebox'] - the formatted datebox for this day.
* $rows['empty'] - empty text for this day, if no items were found.
* $rows['all_day'] - an array of formatted all day items.
* $rows['items'] - an array of timed items for the day.
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
* $rows['items'][$time_period][$column]['values'] - An array of formatted
* items for a time period and field column.
*
* $view: The view.
* $columns: an array of column names.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
* The width of the columns is dynamically set using <col></col>
* based on the number of columns presented. The values passed in will
* work to set the 'hour' column to 10% and split the remaining columns
* evenly over the remaining 90% of the table.
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="day-view">
<table>
<col width="<?php print $first_column_width?>"></col>
<?php foreach ($columns as $column): ?>
<col width="<?php print $column_width; ?>%"></col>
<?php endforeach; ?>
<thead>
<tr>
<th class="calendar-dayview-hour"><?php print $by_hour_count > 0 ? t('Time') : ''; ?></th>
<?php foreach ($columns as $column): ?>
<th class="calendar-agenda-items"><?php print $column; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<td class="<?php print $agenda_hour_class ?>">
<span class="calendar-hour"><?php print $by_hour_count > 0 ? date_t('All day', 'datetime') : ''; ?></span>
</td>
<?php foreach ($columns as $column): ?>
<td class="calendar-agenda-items">
<div class="calendar">
<div class="inner">
<?php print isset($rows['all_day'][$column]) ? implode($rows['all_day'][$column]) : '&nbsp;';?>
</div>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php foreach ($rows['items'] as $hour): ?>
<tr>
<td class="calendar-agenda-hour">
<span class="calendar-hour"><?php print $hour['hour']; ?></span>
<span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
</td>
<?php foreach ($columns as $column): ?>
<td class="calendar-agenda-items">
<div class="calendar">
<div class="inner">
<?php print isset($hour['values'][$column]) ? implode($hour['values'][$column]) : '&nbsp;'; ?>
</div>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,26 @@
<?php
// $Id: calendar-main.tpl.php,v 1.2.2.4 2009/01/10 20:04:18 karens Exp $
/**
* @file
* Template to display calendar navigation and links.
*
* @see template_preprocess_calendar_main.
*
* $view: The view.
* $calendar_links: Array of formatted links to other calendar displays - year, month, week, day.
* $calendar_popup: The popup calendar date selector.
* $display_type: year, month, day, or week.
* $mini: Whether this is a mini view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar">
<?php if (!empty($calendar_popup)) print $calendar_popup;?>
<?php if (!empty($calendar_add_date)) print $calendar_add_date; ?>
<?php if (empty($block)) print theme('links', $calendar_links);?>
<?php print theme('date_navigation', $view) ?>
</div>

View file

@ -0,0 +1,47 @@
<?php
// $Id: calendar-mini.tpl.php,v 1.1.2.7 2010/11/21 13:19:37 karens Exp $
/**
* @file
* Template to display a view as a mini calendar month.
*
* @see template_preprocess_calendar_mini.
*
* $day_names: An array of the day of week names for the table header.
* $rows: An array of data for each day of the week.
* $view: The view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
* $show_title: If the title should be displayed. Normally false since the title is incorporated
* into the navigation, but sometimes needed, like in the year view of mini calendars.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="month-view">
<?php if ($view->date_info->show_title): ?>
<?php print theme('date_navigation', $view); ?>
<?php endif; ?>
<table class="mini">
<thead>
<tr>
<?php foreach ($day_names as $cell): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ((array) $rows as $row): ?>
<tr>
<?php foreach ($row as $cell): ?>
<td class="<?php print $cell['class']; ?> <?php print $cell['id']; ?>">
<?php print $cell['data']; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,28 @@
<?php
// $Id: calendar-month-multiple-node.tpl.php,v 1.1.2.6 2010/11/21 13:19:37 karens Exp $
/**
* @file
* Template to display a summary of the days items as a calendar month node.
*
*
* @see template_preprocess_calendar_month_multiple_node.
*/
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="<?php print $curday; ?> calendar monthview">
<?php foreach ($types as $type): ?>
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<?php print theme('calendar_stripe_stripe', $type); ?>
<?php endif; ?>
<?php endforeach; ?>
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<div class="multiple-events">
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
</div>
</div>
<?php else: ?>
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
<?php endif; ?>
</div>
</div>

View file

@ -0,0 +1,53 @@
<?php
// $Id: calendar-month-node.tpl.php,v 1.2.2.6 2010/11/21 13:19:37 karens Exp $
/**
* @file
* Template to display a view item as a calendar month node.
*
* $node
* A node object for this calendar item. Note this is
* not a complete node object, but it will have $node->nid
* that you can use to load the full object, and
* $node->type to tell the content type of the node.
*
* $fields
* An array of information for every field selected in the 'Fields'
* section of this view, formatted as requested in the View setup.
*
* Calendar info for this individual calendar item is in local time --
* the user timezone where configurable timezones are allowed and set,
* otherwise the site timezone. If this item has extends over more than
* one day, it has been broken apart into separate nodes for each calendar
* date and calendar_start will be no earlier than the start of
* the current day and calendar_end will be no later than the end
* of the current day.
*
* $calendar_start - A formatted datetime start date for this item.
* i.e. '2008-05-12 05:26:15'.
* $calendar_end - A formatted datetime end date for this item,
* the same as the start date except for fields that have from/to
* fields defined, like Date module dates.
* $calendar_start_date - a PHP date object for the start time.
* $calendar_end_date - a PHP date object for the end time.
*
* You can use PHP date functions on the date object to display date
* information in other ways, like:
*
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
*
* @see template_preprocess_calendar_month_node.
*/
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="<?php print $node->date_id; ?> calendar monthview">
<?php print theme('calendar_stripe_stripe', $node); ?>
<?php foreach ($fields as $field): ?>
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
<?php if ($field['label']): ?>
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
<?php endif; ?>
<?php print $field['data']; ?>
</div>
<?php endforeach; ?>
</div>
</div>

View file

@ -0,0 +1,46 @@
<?php
// $Id: calendar-month.tpl.php,v 1.6.2.3 2008/06/19 22:55:56 karens Exp $
/**
* @file
* Template to display a view as a calendar month.
*
* @see template_preprocess_calendar_month.
*
* $day_names: An array of the day of week names for the table header.
* $rows: An array of data for each day of the week.
* $view: The view.
* $calendar_links: Array of formatted links to other calendar displays - year, month, week, day.
* $display_type: year, month, day, or week.
* $block: Whether or not this calendar is in a block.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $date_id: a css id that is unique for this date,
* it is in the form: calendar-nid-field_name-delta
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="month-view">
<table>
<thead>
<tr>
<?php foreach ($day_names as $cell): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ((array) $rows as $row): ?>
<tr>
<?php foreach ($row as $cell): ?>
<td id="<?php print $cell['id']; ?>" class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,27 @@
<?php
// $Id: calendar-week-multiple-node.tpl.php,v 1.1.2.5 2010/11/21 13:19:37 karens Exp $
/**
* @file
* Template to display a summary of the days items as a calendar week node.
*
* @see template_preprocess_calendar_week_multiple_node.
*/
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="<?php print $curday; ?> calendar weekview">
<?php foreach ($types as $type): ?>
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<?php print theme('calendar_stripe_stripe', $type); ?>
<?php endif; ?>
<?php endforeach; ?>
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
<div class="multiple-events">
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
</div>
</div>
<?php else: ?>
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
<?php endif; ?>
</div>
</div>

View file

@ -0,0 +1,53 @@
<?php
// $Id: calendar-week-node.tpl.php,v 1.2.2.3 2010/11/21 13:19:37 karens Exp $
/**
* @file
* Template to display a view item as a calendar week node.
*
* $node
* A node object for this calendar item. Note this is
* not a complete node object, but it will have $node->nid
* that you can use to load the full object, and
* $node->type to tell the content type of the node.
*
* $fields
* An array of information for every field selected in the 'Fields'
* section of this view, formatted as requested in the View setup.
*
* Calendar info for this individual calendar item is in local time --
* the user timezone where configurable timezones are allowed and set,
* otherwise the site timezone. If this item has extends over more than
* one day, it has been broken apart into separate nodes for each calendar
* date and calendar_start will be no earlier than the start of
* the current day and calendar_end will be no later than the end
* of the current day.
*
* $calendar_start - A formatted datetime start date for this item.
* i.e. '2008-05-12 05:26:15'.
* $calendar_end - A formatted datetime end date for this item,
* the same as the start date except for fields that have from/to
* fields defined, like Date module dates.
* $calendar_start_date - a PHP date object for the start time.
* $calendar_end_date - a PHP date object for the end time.
*
* You can use PHP date functions on the date object to display date
* information in other ways, like:
*
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
*
* @see template_preprocess_calendar_week_node.
*/
?>
<div class="view-item view-item-<?php print $view->name ?>">
<div class="<?php print $node->date_id; ?> calendar weekview">
<?php print theme('calendar_stripe_stripe', $node); ?>
<?php foreach ($fields as $field): ?>
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
<?php if ($field['label']): ?>
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
<?php endif; ?>
<?php print $field['data']; ?>
</div>
<?php endforeach; ?>
</div>
</div>

View file

@ -0,0 +1,80 @@
<?php
// $Id: calendar-week.tpl.php,v 1.5.2.6 2009/02/16 23:46:22 karens Exp $
/**
* @file
* Template to display a view as a calendar week.
*
* @see template_preprocess_calendar_week.
*
* $day_names: An array of the day of week names for the table header.
* $rows: The rendered data for this week.
*
* For each day of the week, you have:
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
* $rows['datebox'] - the formatted datebox for this day.
* $rows['empty'] - empty text for this day, if no items were found.
* $rows['all_day'] - an array of formatted all day items.
* $rows['items'] - an array of timed items for the day.
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
*
* $view: The view.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
//dsm($rows);
//dsm($items);
?>
<div class="calendar-calendar"><div class="week-view">
<table>
<thead>
<tr>
<th class="calendar-agenda-hour"><?php print $by_hour_count > 0 ? t('Time') : ''; ?></th>
<?php foreach ($day_names as $cell): ?>
<th class="<?php print $cell['class']; ?>">
<?php print $cell['data']; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<td class="<?php print $agenda_hour_class ?>">
<span class="calendar-hour"><?php print $by_hour_count > 0 ? date_t('All day', 'datetime') : ''; ?></span>
</td>
<?php foreach ($rows as $day): ?>
<td class="calendar-agenda-items">
<?php print $day['datebox']; ?>
<div class="calendar">
<div class="inner">
<?php print array_key_exists('all_day', $day) && count($day['all_day']) ? implode($day['all_day']) : '&nbsp;';?>
</div>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php foreach ($items as $time): ?>
<tr>
<td class="calendar-agenda-hour">
<span class="calendar-hour"><?php print $time['hour']; ?></span>
<span class="calendar-ampm"><?php print $time['ampm']; ?></span>
</td>
<?php foreach ($columns as $column): ?>
<td class="calendar-agenda-items">
<div class="calendar">
<div class="inner">
<?php print isset($time['values'][$column]) ? implode($time['values'][$column]) : '&nbsp;'; ?>
</div>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,27 @@
<?php
// $Id: calendar-year.tpl.php,v 1.6.2.1 2008/06/14 11:38:34 karens Exp $
/**
* @file
* Template to display a view as a calendar year.
*
* @see template_preprocess_calendar_year.
*
* $view: The view.
* $months: An array with a formatted month calendar for each month of the year.
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
*
*/
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
?>
<div class="calendar-calendar"><div class="year-view">
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
<tbody>
<tr><td><?php print $months[1] ?></td><td><?php print $months[2] ?></td><td><?php print $months[3] ?></td></tr>
<tr><td><?php print $months[4] ?></td><td><?php print $months[5] ?></td><td><?php print $months[6] ?></td></tr>
<tr><td><?php print $months[7] ?></td><td><?php print $months[8] ?></td><td><?php print $months[9] ?></td></tr>
<tr><td><?php print $months[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
</tbody>
</table>
</div></div>

View file

@ -0,0 +1,745 @@
<?php
// $Id: theme.inc,v 1.10.2.80 2011/01/03 12:45:27 karens Exp $
/**
* Display a calendar navigation and links
*/
function template_preprocess_calendar_main(&$vars) {
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
$view = $vars['view'];
$result = (array) $view->result;
$options = $view->style_plugin->options;
$handler = $view->style_plugin;
$vars['display_type'] = $view->date_info->granularity;
$vars['min_date_formatted'] = !empty($view->date_info->min_date) ? date_format($view->date_info->min_date, DATE_FORMAT_DATETIME) : '';
$vars['max_date_formatted'] = !empty($view->date_info->end_date) ? date_format($view->date_info->max_date, DATE_FORMAT_DATETIME) : '';
$view->date_info->mini = isset($view->date_info->mini) ? $view->date_info->mini : $view->date_info->granularity == 'year';
$url = $view->get_url();
$view->date_info->url = $url;
$arg = $view->date_info->date_arg;
$displays = $view->date_info->display_types;
// Set up the links to other calendar views.
$current_date = $view->date_info->min_date;
if (!empty($date->info->day)) {
$current_date = date_make_date($date_info->date_arg .' 00:00:00');
}
elseif (!empty($view->date_info->week)) {
$week = date_week_range($view->date_info->week, $view->date_info->year);
$current_date = $week[0];
}
elseif (!empty($view->date_info->month)) {
$current_date = date_make_date($view->date_info->year .'-'. date_pad($view->date_info->month) .'-01 00:00:00');
}
else {
$current_date = date_make_date($view->date_info->year .'-01-01 00:00:00');
}
if (empty($view->date_info->month) || $view->date_info->month == $view->argument['date_argument']->options['wildcard']) {
$view->date_info->month = date_format($current_date, 'm');
}
if (empty($view->date_info->day) || $view->date_info->day == $view->argument['date_argument']->options['wildcard']) {
$view->date_info->day = date_format($current_date, 'd');
}
if (empty($view->date_info->week) || $view->date_info->week == $view->argument['date_argument']->options['wildcard']) {
$view->date_info->week = date_week($view->date_info->year .'-'. date_pad($view->date_info->month) .'-'. date_pad($view->date_info->day));
}
$calendar_links = array();
$base = array('attributes' => array('rel' => 'nofollow'));
if (!empty($displays['year'])) {
$calendar_links['calendar calendar-year'] = $base + array('title' => date_t('Year', 'datetime'), 'href' => date_real_url($view, 'year'));
}
if (!empty($displays['month'])) {
$calendar_links['calendar calendar-month'] = $base + array('title' => date_t('Month', 'datetime'), 'href' => date_real_url($view, 'month'));
}
if (!empty($displays['week'])) {
$calendar_links['calendar calendar-week'] = $base + array('title' => date_t('Week', 'datetime'), 'href' => date_real_url($view, 'week'));
}
if (!empty($displays['day'])) {
$calendar_links['calendar calendar-day'] = $base + array('title' => date_t('Day', 'datetime'), 'href' => date_real_url($view, 'day'));
}
$vars['calendar_links'] = $calendar_links;
// If the Date Popup module is enabled, add a popup date selector.
if (!empty($view->date_info->calendar_popup)) {
$vars['calendar_popup'] = '<div class="clear-block">'. calendar_date_select($view) .'</div>';
}
// If an 'Add new ... link is provided, add it here.
// the query will bring the user back here after adding the node.
if (!empty($view->date_info->calendar_date_link)
&& (user_access("administer nodes") || user_access('create '. $view->date_info->calendar_date_link .' content'))) {
$name = node_get_types('name', $view->date_info->calendar_date_link);
$href = 'node/add/'. str_replace('_', '-', $view->date_info->calendar_date_link);
$query = 'destination='. $view->date_info->url;
$vars['calendar_links']['calendar calendar-add'] = $base + array(
'title' => t('Add+'),
'href' => $href,
'query' => $query,
);
}
$vars['view'] = $view;
$vars['mini'] = !empty($view->date_info->mini);
$vars['block'] = !empty($view->date_info->block);
$vars['block_identifier'] = date_block_identifier($view);
}
/**
* Display a view as a calendar.
*
* This preprocessor does all the work needed for all types of calendar
* views and the template takes care of displaying links to related views.
*/
function template_preprocess_calendar(&$vars) {
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
$view = $vars['view'];
// Make sure we only run through this function one time.
if (!empty($view->date_info->calendar_processed)) {
return;
}
$result = (array) $view->result;
$options = $view->style_plugin->options;
$handler = $view->style_plugin;
$fields = $view->field;
// Render each field into an output array. We have to do the rendering
// here because we don't apppear to have full access to the view
// handlers in the theme functions.
$items = array();
$calendar_fields = date_api_fields($view->base_table);
$calendar_fields = array_keys($calendar_fields['alias']);
foreach ($result as $num => $row) {
$copy = drupal_clone($row);
$items[$num] = $row;
$items[$num]->raw = $copy;
$items[$num]->calendar_fields = new stdClass();
foreach ($row as $key => $value) {
if (in_array($key, $calendar_fields)) {
$items[$num]->calendar_fields->$key = $value;
}
}
foreach ($fields as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($field) && is_object($field)) {
// Theme the copy instead of the original row so duplicate date
// fields each get a fresh copy of the original data to theme.
$items[$num]->{$field_alias} = $field->theme($copy);
}
if (!empty($field->options['exclude'])) {
if (isset($items[$num]->{$field_alias})) unset($items[$num]->{$field_alias});
}
}
}
$vars['display_type'] = $view->date_info->granularity;
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
// Massage the resulting items into formatted calendar items.
$items = calendar_build_nodes($view, $items);
// Merge in items from other sources.
foreach (module_implements('calendar_add_items') as $module) {
$function = $module .'_calendar_add_items';
if (function_exists($function)) {
if ($feeds = $function($view)) {
foreach ($feeds as $feed) {
$items = $feed;
}
}
}
}
$view->date_info->mini = isset($view->date_info->mini) ? $view->date_info->mini : $view->date_info->granularity == 'year';
// Create the calendar day names and rows.
$rows = calendar_build_calendar($view, $items);
$vars['items'] = $items;
$vars['rows'] = $rows;
$view->date_info->calendar_processed = TRUE;
$vars['view'] = $view;
$vars['mini'] = !empty($view->date_info->mini);
$vars['block'] = !empty($view->date_info->block);
}
/**
* Display a month view.
*/
function template_preprocess_calendar_month(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
template_preprocess_calendar($vars);
$view = $vars['view'];
$rows = $vars['rows'];
if (sizeof($rows) > 1) {
$day_names = array_shift($rows);
}
else {
$day_names = $rows;
$rows = array();
}
$month_rows = $rows;
foreach ($rows as $weekno => $row) {
foreach ($row as $day => $data) {
$cell = $data['data'];
// If this cell is already rendered, like the weekno column,
// move to the next item.
if (!is_array($cell)) {
$month_rows[$weekno][$day]['data'] = $cell;
continue;
}
$data = $cell['datebox'];
if ($cell['empty']) {
$data .= $cell['empty'];
}
else {
$data .= implode($cell['all_day']);
foreach ($cell['items'] as $hour => $item) {
$data .= implode($item);
}
$data .= $cell['link'];
}
if ($view->date_info->mini) {
$month_rows[$weekno][$day]['data'] = $data;
}
else {
$month_rows[$weekno][$day]['data'] = '<div class="inner">'. $data .'</div>';
}
}
}
$vars['rows'] = $month_rows;
$vars['day_names'] = $day_names;
$vars['display_type'] = $view->date_info->granularity;
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
}
/**
* Display a mini month view.
*/
function template_preprocess_calendar_mini(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
template_preprocess_calendar_month($vars);
$view = $vars['view'];
$view->date_info->show_title = !empty($view->date_info->show_title) ? $view->date_info->show_title : FALSE;
$vars['show_title'] = $view->date_info->show_title;
$vars['view'] = $view;
}
/**
* Display a year view.
*/
function template_preprocess_calendar_year(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
$vars['view']->date_info->style_with_weekno = FALSE;
template_preprocess_calendar($vars);
// Get the url of the year view and remove the year argument from it.
// TODO clean this up in case there is another arg that looks like
// the year to make sure only the year gets removed.
$view = $vars['view'];
$year = date_format($view->date_info->min_date, 'Y');
// Construct a calendar for each month, adjusting the $view passed
// to the theme so it will produce the right results.
$view = drupal_clone($vars['view']);
$rows = $vars['rows'];
$months = array();
foreach ($rows as $month => $month_rows) {
$view->date_info->month = $month;
$view->date_info->granularity = 'month';
$view->date_info->mini = TRUE;
$view->date_info->hide_nav = TRUE;
$view->date_info->show_title = TRUE;
$view->date_info->url = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month));
$view->date_info->min_date = date_make_date($view->date_info->year .'-'. date_pad($month) .'-01 00:00:00', date_default_timezone_name());
$view->date_info->max_date = drupal_clone($view->date_info->min_date);
date_modify($view->date_info->max_date, '+1 month');
date_modify($view->date_info->max_date, '-1 second');
$months[$month] = theme('calendar_mini', $view, $vars['options'], $month_rows);
}
$vars['months'] = $months;
$vars['view']->date_info->hide_nav = FALSE;
$vars['view']->date_info->granularity = 'year';
}
/**
* Display a day view.
*/
function template_preprocess_calendar_day(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
$vars['view']->style_with_weekno = FALSE;
template_preprocess_calendar($vars);
$view = $vars['view'];
$rows = $vars['rows'];
$item_count = 0;
$by_hour_count = 0;
$grouping_field = $view->date_info->style_groupby_field;
// If we're not grouping by time, move all items into the 'all day' array.
if (empty($view->date_info->style_groupby_times)) {
// Items are already grouped into times, so we need to process each time-group.
foreach ($rows['items'] as $time => $items) {
foreach($items as $item) {
$rows['all_day'][] = $item;
}
}
$rows['items'] = array();
}
$columns = array();
// Move all_day items into the right columns and render them.
$grouped_items = array();
foreach ($rows['all_day'] as $item) {
if (isset($item->{$grouping_field})) {
$column = $item->{$grouping_field};
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
if (!in_array($column, $columns)) {
$columns[] = $column;
}
}
else {
$column = t('Items');
}
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
$grouped_items[$column][] = theme($theme, $item, $view);
$item_count++;
}
$vars['rows']['all_day'] = $grouped_items;
// Moved timed items into the right columns and render them.
$start_times = $view->date_info->style_groupby_times;
$show_empty_times = $view->date_info->style_show_empty_times;
$end_start_time = '23:59:59';
$start_time = array_shift($start_times);
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
$grouped_items = array();
foreach ($rows['items'] as $time => $items) {
foreach ($items as $item) {
if (isset($item->{$grouping_field})) {
$column = $item->{$grouping_field};
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
if (!in_array($column, $columns)) {
$columns[] = $column;
}
}
else {
$column = t('Items');
}
// Find the next time slot and fill it. Populate the skipped
// slots if the option to show empty times was chosen.
while ($time >= $next_start_time && $time < $end_start_time) {
if ((!empty($show_empty_times)) && !array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
$grouped_items[$start_time]['values'][$column][] = theme($theme, $item, $view);
$item_count++;
$by_hour_count++;
}
}
// Finish out the day's time values if we want to see empty times.
if (!empty($show_empty_times)) {
while ($start_time < $end_start_time) {
if (!array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
}
// Do the headers last, once we know what the actual values are.
$i = 0;
$start_times = array_keys($grouped_items);
foreach ($start_times as $start_time) {
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $rows['date']);
$grouped_items[$start_time]['hour'] = $heading['hour'];
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
$i++;
}
ksort($grouped_items);
$vars['rows']['items'] = $grouped_items;
if (empty($columns)) {
$columns = array(t('Items'));
}
$vars['columns'] = $columns;
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
$first_column_width = 10;
if (empty($view->date_info->style_groupby_times)) {
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
$first_column_width = 1;
}
$vars['first_column_width'] = $first_column_width;
if (count($columns)) {
$vars['column_width'] = round((100 - $first_column_width)/count($columns));
}
else {
$vars['column_width'] = (100 - $first_column_width);
}
$vars['item_count'] = $item_count;
$vars['by_hour_count'] = $by_hour_count;
return;
}
/**
* Display a week view.
*/
function template_preprocess_calendar_week(&$vars) {
// Add in all the $vars added by the main calendar preprocessor.
$vars['view']->style_with_weekno = FALSE;
template_preprocess_calendar($vars);
$view = $vars['view'];
$rows = $vars['rows'];
$item_count = 0;
$by_hour_count = 0;
if (sizeof($rows) > 1) {
$day_names = array_shift($rows);
}
else {
$day_names = $rows;
$rows = array();
}
// Moved timed items into the right columns and render them.
$show_empty_times = $view->date_info->style_show_empty_times;
$end_start_time = '23:59:59';
$grouped_items = array();
$vars['rows'] = $rows[0];
foreach ($rows[0] as $weekno => $row) {
$vars['rows'][$weekno] = $row['data'];
// If we're not grouping by time, move all items into the 'all day' array.
if (empty($view->date_info->style_groupby_times)) {
foreach ($row['data']['items'] as $item) {
$row['data']['all_day'] = array_merge($row['data']['all_date'], $item);
}
$row['data']['items'] = array();
}
$columns[] = $weekno;
$start_times = $view->date_info->style_groupby_times;
$start_time = array_shift($start_times);
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
foreach ($row['data']['all_day'] as $key => $item) {
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
$vars['rows'][$weekno]['all_day'][$key] = theme($theme, $item, $view);
$item_count++;
}
foreach ($row['data']['items'] as $time => $items) {
foreach ($items as $item) {
// Find the next time slot and fill it. Populate the skipped
// slots if the option to show empty times was chosen.
while ($time >= $next_start_time && $time < $end_start_time) {
if (($show_empty_times) && !array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'][$weekno] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
$grouped_items[$start_time]['values'][$weekno][] = theme($theme, $item, $view);
$item_count++;
$by_hour_count++;
}
}
// Finish out the day's time values if we want to see empty times.
if ($show_empty_times) {
while ($start_time < $end_start_time) {
if (!array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'][$weekno] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
}
}
ksort($grouped_items);
// Do the headers last, once we know what the actual values are.
$i = 0;
$start_times = array_keys($grouped_items);
foreach ($start_times as $start_time) {
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $row['data']['date']);
$grouped_items[$start_time]['hour'] = $heading['hour'];
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
}
$vars['items'] = $grouped_items;
$vars['day_names'] = $day_names;
$vars['columns'] = $columns;
$vars['start_times'] = $view->date_info->style_groupby_times;
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
$first_column_width = 10;
if (empty($view->date_info->style_groupby_times)) {
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
$first_column_width = 1;
}
$vars['item_count'] = $item_count;
$vars['by_hour_count'] = $by_hour_count;
return;
}
/**
* Create the calendar date box.
*/
function template_preprocess_calendar_datebox(&$vars) {
$date = $vars['date'];
$view = $vars['view'];
$vars['day'] = intval(substr($date, 8, 2));
$force_view_url = !empty($view->date_info->block) ? TRUE : FALSE;
$vars['url'] = date_real_url($view, NULL, $date, $force_view_url);
$vars['link'] = !empty($view->date_info->display_types['day']) ? l($vars['day'], $vars['url']) : $vars['day'];
$vars['granularity'] = $view->date_info->granularity;
$vars['mini'] = $view->date_info->mini;
if ($view->date_info->mini) {
if (!empty($vars['selected'])) {
$vars['class'] = 'mini-day-on';
}
else {
$vars['class'] = 'mini-day-off';
}
}
else {
$vars['class'] = 'day';
}
}
/**
* Format an calendar node for display.
*/
function template_preprocess_calendar_node(&$vars) {
$node = $vars['node'];
$view = $vars['view'];
$fields = array();
foreach ($view->field as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($node->$field_alias)) {
$data = $node->$field_alias;
$label = $field->options['label'];
// CCK has some special label options.
if (!empty($field->content_field)) {
switch ($field->options['label_type']) {
case 'none':
$label = '';
break;
case 'widget':
$label = $field->content_field['widget']['label'];
break;
}
}
$fields[$field_alias] = array(
'id' => views_css_safe($field_alias),
'label' => $label,
'data' => $data,
);
}
}
$vars['fields'] = $fields;
$vars['calendar_start'] = $node->calendar_start;
$vars['calendar_end'] = $node->calendar_end;
$vars['calendar_start_date'] = $node->calendar_start_date;
$vars['calendar_end_date'] = $node->calendar_end_date;
// We added the node type to the results in the query,
// but it will show up as $node->node_type instead of
// $node->type. Rename it to match the normal way it
// would show up on a node object.
$vars['node']->type = $vars['node']->node_type;
}
/**
* Format an calendar month node for display.
*/
function template_preprocess_calendar_month_node(&$vars) {
template_preprocess_calendar_node($vars);
}
/**
* Format an calendar month node for display.
*/
function template_preprocess_calendar_month_multiple_node(&$vars) {
$view = $vars['view'];
$curday = $vars['curday'];
// get the year month and date
$parts = explode('-', substr($curday, 0, 10));
$year = $parts[0];
$month = intval($parts[1]);
$day = intval($parts[2]);
// create the link to the day
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($day));
}
/**
* Format an calendar day node for display.
*/
function template_preprocess_calendar_day_node(&$vars) {
template_preprocess_calendar_node($vars);
$node = $vars['node'];
// Remote items may have a teaser to show.
if (!empty($node->remote) && !empty($node->teaser)) {
$fields['teaser'] = '<div class="content">'. ($node->teaser) ."</div>\n";
}
}
/**
* Format an calendar week node for display.
*/
function template_preprocess_calendar_week_node(&$vars) {
template_preprocess_calendar_node($vars);
}
/**
* Format an calendar week node for display.
*/
function template_preprocess_calendar_week_multiple_node(&$vars) {
$view = $vars['view'];
$curday = $vars['curday'];
// get the year month and date
$parts = explode('-', substr($curday, 0, 10));
$year = $parts[0];
$month = intval($parts[1]);
$day = intval($parts[2]);
// create the link to the day
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($day));
}
/**
* Format the time row headings in the week and day view.
*/
function theme_calendar_time_row_heading($start_time, $next_start_time, $curday_date) {
static $format_hour, $format_ampm;
if (empty($format_hour)) {
$format = variable_get('date_format_short', 'm/d/Y - H:i');
$format_hour = str_replace(array('a', 'A'), '', date_limit_format($format, array('hour', 'minute')));
$format_ampm = strstr($format, 'a') ? 'a' : (strstr($format, 'A') ? 'A' : '');
}
if ($start_time == '00:00:00' && $next_start_time == '23:59:59') {
$hour = t('All times');
}
elseif ($start_time == '00:00:00') {
$date = date_create($curday_date .' '. $next_start_time);
$hour = t('Before @time', array('@time' => date_format($date, $format_hour)));
}
else {
$date = date_create($curday_date .' '. $start_time);
$hour = date_format($date, $format_hour);
}
if (!empty($date)) {
$ampm = date_format($date, $format_ampm);
}
else {
$ampm = '';
}
return array('hour' => $hour, 'ampm' => $ampm);
}
/**
* Format a node stripe legend
*/
function theme_calendar_stripe_legend() {
if (empty($GLOBALS['calendar_stripes'])) {
return '';
}
$header = array(
array('class' => 'calendar-legend', 'data' => t('Item')),
array('class' => 'calendar-legend', 'data' => t('Key'))
);
$rows = array();
$output = '';
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
if($stripe){
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'">&nbsp;</div>');
}
}
if (!empty($rows)) {
$output .= theme('table', $header, $rows, array('class' => 'mini calendar-legend'));
}
return $output;
}
/**
* Format node stripes
*/
function theme_calendar_stripe_stripe($node) {
if (empty($node->stripe) || (!count($node->stripe))) {
return;
}
$output = '';
if(is_array($node->stripe_label)){
foreach($node->stripe_label as $k => $stripe_label){
if(!empty($node->stripe[$k]) && !empty($stripe_label)) {
$GLOBALS['calendar_stripes'][$stripe_label] = $node->stripe[$k];
$output.= '<div style="background-color:'. $node->stripe[$k] .';color:'. $node->stripe[$k] .'" class="stripe" title="Key: '. $node->stripe_label[$k] .'">&nbsp;</div>'."\n";
}
}
}
return $output;
}
/**
* Format an empty day on a calendar
*
* @param day
* The day to display.
*/
function theme_calendar_empty_day($curday, $view) {
if ($view->date_info->calendar_type != 'day') {
return '<div class="calendar-empty">&nbsp;</div>'."\n";
}
else {
return '<div class="calendar-dayview-empty">'. t('Empty day') .'</div>';
}
}
/** @} End of addtogroup themeable */

View file

@ -0,0 +1,30 @@
# $Id: theme.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
#
# Czech translation of Calendar (6.x-2.2)
# Copyright (c) 2010 by the Czech translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (6.x-2.2)\n"
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
"PO-Revision-Date: 2010-09-29 21:22+0000\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
msgid "Item"
msgstr "Položka"
msgid "Items"
msgstr "Položky"
msgid "Key"
msgstr "Klíč"
msgid "Add+"
msgstr "Přidat+"
msgid "All times"
msgstr "Všechny časy"
msgid "Before @time"
msgstr "Před @time"
msgid "Empty day"
msgstr "Den bez události"

View file

@ -0,0 +1,102 @@
# $Id$
#
# LANGUAGE translation of Drupal (general)
# Copyright YEAR NAME <EMAIL@ADDRESS>
# Generated from files:
# calendar.module,v 1.121.2.35 2009/02/14 16:51:50 karens
# calendar.info,v 1.8 2008/04/23 23:42:53 karens
# calendar.install,v 1.13.2.10 2009/02/15 13:39:01 karens
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2009-02-17 05:01-0600\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: calendar.module:28
msgid "<p>View complete documentation at !link.</p>"
msgstr ""
#: calendar.module:141
msgid "Calendar Legend."
msgstr ""
#: calendar.module:147
msgid "Calendar Legend"
msgstr ""
#: calendar.module:159
msgid "Year"
msgstr ""
#: calendar.module:159
msgid "Month"
msgstr ""
#: calendar.module:159
msgid "Day"
msgstr ""
#: calendar.module:159
msgid "Week"
msgstr ""
#: calendar.module:339
msgid "Change date"
msgstr ""
#: calendar.module:423
msgid "The Date argument in this view must be set up to provide a default value set to the current date. Edit the argument, find 'Action to take if argument is not present.', choose 'Provide default argument', then select 'Current date'."
msgstr ""
#: calendar.module:460
msgid " is not a valid hex color"
msgstr ""
#: calendar.module:501 calendar.info:0
msgid "Calendar"
msgstr ""
#: calendar.module:503
msgid "View the calendar."
msgstr ""
#: calendar.module:0
msgid "calendar"
msgstr ""
#: calendar.install:146;169;185
msgid "Calendar module cannot be updated until after Views has been updated. Please return to <a href=\"@update-php\">update.php</a> and run the remaining updates."
msgstr ""
#: calendar.install:147;170;186
msgid "calendar.module has updates, but cannot be updated until views.module is updated first."
msgstr ""
#: (duplicate) calendar.install:26 ;35
msgid "Calendar requirements"
msgstr ""
#: (duplicate) calendar.install:27
msgid "The Calendar module requires a more current version of the Date API. Please check for a newer version."
msgstr ""
#: (duplicate) calendar.install:36
msgid "The Calendar module requires the latest version of the Date API, be sure you are installing the latest versions of both modules."
msgstr ""
#: calendar.info:0
msgid "Views plugin to display views containing dates as Calendars."
msgstr ""
#: calendar.info:0
msgid "Date/Time"
msgstr ""

View file

@ -0,0 +1,578 @@
# $Id$
#
# LANGUAGE translation of Drupal (general)
# Copyright 2009 NAME <EMAIL@ADDRESS>
# Generated from files:
# calendar.module,v 1.121.2.38 2009/03/17 18:03:36 karens
# calendar.info,v 1.8 2008/04/23 23:42:53 karens
# calendar.views.inc,v 1.1.2.9 2009/01/23 21:05:41 karens
# calendar.install,v 1.13.2.11 2009/03/17 18:03:36 karens
# calendar_ical.info,v 1.1.2.1 2008/09/05 11:03:42 karens
# jcalendar.info,v 1.1.4.2 2008/06/23 14:55:01 karens
# calendar_ical.views.inc,v 1.1.2.6 2009/02/16 23:46:22 karens
# calendar_ical_admin.inc,v 1.1.2.2 2008/10/02 20:23:49 karens
# calendar_plugin_display_ical.inc,v 1.1.2.5 2008/11/25 16:12:36 karens
# calendar_view_plugin_style.inc,v 1.1.2.19 2009/02/17 18:09:35 karens
# calendar_plugin_style_ical.inc,v 1.1.2.17 2009/04/28 22:47:29 karens
# calendar_plugin_style.inc,v 1.1.2.15 2009/05/11 23:52:15 karens
# calendar_ical.module,v 1.1.2.6 2008/11/24 15:48:15 karens
# calendar_plugin_display_attachment.inc,v 1.1.2.17 2009/03/17 18:03:36 karens
# calendar_plugin_display_page.inc,v 1.1.2.20 2009/07/24 19:44:09 karens
# calendar_plugin_display_block.inc,v 1.1.2.10 2008/12/06 14:56:15 karens
# jcalendar.module,v 1.1.4.16 2009/07/28 21:38:07 karens
# calendar-month-multiple-node.tpl.php,v 1.1.2.5 2009/02/14 16:51:50 karens
# calendar-week-multiple-node.tpl.php,v 1.1.2.4 2008/11/20 12:29:14 karens
# calendar-day.tpl.php,v 1.7.2.9 2009/07/28 21:50:50 karens
# calendar-week.tpl.php,v 1.5.2.6 2009/02/16 23:46:22 karens
# theme.inc,v 1.10.2.72 2009/07/02 14:42:08 karens
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2009-10-19 14:31+0200\n"
"PO-Revision-Date: 2009-10-19 18:32+0100\n"
"Last-Translator: Thomas Zahreddin <thomas@voicehero.net>\n"
"Language-Team: German <tz@it-arts.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: German\n"
"X-Poedit-Country: Germany\n"
"X-Poedit-SourceCharset: utf8\n"
#: calendar.module:28
msgid "<p>View complete documentation at !link.</p>"
msgstr "<a href=\"!link\"> Komplette Dokumentation</a></p>"
#: calendar.module:138
msgid "Calendar Legend."
msgstr "Kalender Legende."
#: calendar.module:144
msgid "Calendar Legend"
msgstr "Kalender Legende."
#: calendar.module:156
msgid "Year"
msgstr "Jahr"
#: calendar.module:156
msgid "Month"
msgstr "Monat"
#: calendar.module:156
msgid "Day"
msgstr "Tag"
#: calendar.module:156
msgid "Week"
msgstr "Woche"
#: calendar.module:336
msgid "Change date"
msgstr "Datum ändern"
#: calendar.module:394
msgid "The Date argument in this view must be set up to provide a default value set to the current date. Edit the argument, find 'Action to take if argument is not present.', choose 'Provide default argument', then select 'Current date'."
msgstr "Für das Datum als Argument muss in dieser Ansicht ein Standardwert eingerichtet werden z.B. das aktuelle Datum. Legen Sie fest, wie sich das System verhält, 'Wenn kein Argument vorhanden ist, dann ... \", wird dieses durch das \"Standard-Argument \" ersetzt, z.B. das aktuelles Datum ."
#: calendar.module:431
msgid " is not a valid hex color"
msgstr " Keine gültige Farbe (im Hex-Format)"
#: calendar.module:472
#: calendar.info:0
#: includes/calendar.views.inc:195
msgid "Calendar"
msgstr "Kalender"
#: calendar.module:474
msgid "View the calendar."
msgstr "Kalender anzeigen"
#: calendar.install:147;170;186
msgid "Calendar module cannot be updated until after Views has been updated. Please return to <a href=\"@update-php\">update.php</a> and run the remaining updates."
msgstr "Calendar-Modul kann erst aktualisiert werden, nachdem Views aktualisiert wurde. Bitte auf <a href=\\\"@update-php\\\">update.php</a> die ausstehenden Updates durchfürhren."
#: calendar.install:148;171;187
msgid "calendar.module has updates, but cannot be updated until views.module is updated first."
msgstr "Bitte das Views Modul für diese Version des Calendar.module aktualisieren."
#: (duplicate) calendar.install:26
#: ;35
msgid "Calendar requirements"
msgstr "Anforderungen des Moduls Calendar"
#: (duplicate) calendar.install:27
msgid "The Calendar module requires a more current version of the Date API. Please check for a newer version."
msgstr "Das Calendar Modul ist auf eine aktuelle Version des Moduls Date API angewiesen. Bitte prüfen Sie die Version beider Module. Bitte überprüfen Sie für eine neuere Version."
#: (duplicate) calendar.install:36
msgid "The Calendar module requires the latest version of the Date API, be sure you are installing the latest versions of both modules."
msgstr "[fuzzy] Das Calendar Modul ist auf eine aktuelle Version des Moduls Date API angewiesen. Bitte prüfen Sie die Version beider Module."
#: calendar.info:0
msgid "Views plugin to display views containing dates as Calendars."
msgstr "Plugin für Views zur Anzeige von Kalendern."
#: calendar.info:0
#: calendar_ical/calendar_ical.info:0
#: jcalendar/jcalendar.info:0
msgid "Date/Time"
msgstr "Datum / Zeit"
#: calendar_ical/calendar_ical.views.inc:30;42;64
msgid "iCal feed"
msgstr "ical NewsFeed"
#: calendar_ical/calendar_ical.views.inc:31
msgid "Display the view as an iCal feed."
msgstr "Die Ansicht als Newsfeed anzeigen, mit ical-Daten."
#: calendar_ical/calendar_ical.views.inc:65
msgid "Generates an iCal feed from a view."
msgstr " Generiert einen ical-Newsfeed aus einer Ansicht."
#: calendar_ical/calendar_ical_admin.inc:22
msgid "Expire iCal cache"
msgstr "iCal Cache leeren"
#: calendar_ical/calendar_ical_admin.inc:24
msgid "iCal feeds are cached to improve performance. Set an expiration time for cached feeds."
msgstr "iCal-Feeds zwischenspeichern, um die Leistung zu verbessern. Legen Sie eine Ablaufzeit für NewsFeeds im Cache fest."
#: calendar_ical/calendar_ical_admin.inc:30
msgid "iCal Feeds"
msgstr "RSS-Newsfeeds mit iCal-Dateien"
#: calendar_ical/calendar_ical_admin.inc:31
msgid "Use this section to set up iCal feeds that should be displayed in this calendar. They will be shown along with any internal items that match the calendar criteria."
msgstr "Einen iCal-Feed einrichten, dessen Einträge in diesem Kalender angezeigt werden. Sie werden mit den Kalendereinträgen, die den Kriterien entsprechen, zusammen angezeigt."
#: calendar_ical/calendar_ical_admin.inc:42
msgid "Feed type"
msgstr "Typ des RSS-Newsfeed"
#: calendar_ical/calendar_ical_admin.inc:47
msgid "Name"
msgstr "Name"
#: calendar_ical/calendar_ical_admin.inc:50
msgid "The name of a feed to include in this calendar."
msgstr "Der Name eines RSS-Newsfeeds, der in einen Kalender aufgenommen wird."
#: calendar_ical/calendar_ical_admin.inc:53
msgid "Url"
msgstr "URL"
#: calendar_ical/calendar_ical_admin.inc:57
msgid "The external feed url or internal file path and name. Change 'webcal://' to 'http://'."
msgstr "Die Feed-URL externe oder interne Dateipfade und -namen. Wandele \"webcal://' zu 'http:// '."
#: calendar_ical/calendar_ical_admin.inc:61
msgid "Stripe color"
msgstr "Die Farbe der Streifen"
#: calendar_ical/calendar_ical_admin.inc:67
msgid "The hex color value (like #ffffff) to use for this feed's calendar stripe."
msgstr "Eine Farbe hexadezimal z.B. #ffffff angegeben, um einen RSS-Newsfeed eines Kalenders mit Streifen zu versehen."
#: calendar_ical/calendar_ical_admin.inc:77
msgid "Submit"
msgstr "Speichern"
#: calendar_ical/calendar_plugin_display_ical.inc:81
msgid "iCal settings"
msgstr "iCal Einstellungen"
#: calendar_ical/calendar_plugin_display_ical.inc:85
msgid "Using the site name"
msgstr "Der Name der Website wird verwendet"
#: calendar_ical/calendar_plugin_display_ical.inc:93
msgid "Multiple displays"
msgstr "Mehrere Anzeigen"
#: calendar_ical/calendar_plugin_display_ical.inc:103
#: includes/calendar_view_plugin_style.inc:87
msgid "None"
msgstr "Keine"
#: calendar_ical/calendar_plugin_display_ical.inc:108;135
msgid "Attach to"
msgstr "Anhängen an"
#: calendar_ical/calendar_plugin_display_ical.inc:127
msgid "Use the site name for the title"
msgstr "Den Namen der Website für den Titel verwenden."
#: calendar_ical/calendar_plugin_display_ical.inc:144
msgid "The ical icon will be shown only on the selected displays."
msgstr "Die iCal Symbol wird nur auf den ausgewählten Displays angezeigt."
#: calendar_ical/calendar_plugin_display_ical.inc:150
msgid "This view will be displayed by visiting this path on your site. It is recommended that the path be something like \"path/%/%/ical\", putting one % in the path for each argument you have defined in the view."
msgstr "Diese Ansicht wird dem Benutzer unter diesem Pfad auf Ihrer Website angezeigt werden. Es wird empfohlen, dass die URL so etwas wie \"pfad_zur_Ansicht/%/%/ical\", enthält, jedes % ist eine Variable für das Modul Views."
#: calendar_ical/calendar_plugin_display_ical.inc:203
msgid "A Calendar period display will not work without a Date argument or a Date filter."
msgstr "Zur Anzeige eines Zeitraums im Kalender ist ein Datum oder ein Datumsfilter erforderlich."
#: calendar_ical/calendar_plugin_style_ical.inc:70
msgid "Map the View fields to the values they should represent in the iCal feed. Only fields that have been added to the view are available to use in this way. You can add additional fields to the view and mark them 'Exclude from display' if you only want them in the iCal feed."
msgstr "Felder aus der Ansicht Feldern im iCal-Feed zuordnen. Nur Felder, die der Ansicht hinzugefügt wurden, lassen sich in dieser Weise nutzen. Sie können zusätzliche Felder zur Ansicht hinzufügen und markieren diese mit \"Ausschließen aus der Anzeige\", wenn die Felder nur im iCal-Feed.erscheinen sollen."
#: calendar_ical/calendar_plugin_style_ical.inc:74
msgid "Title"
msgstr "Titel"
#: calendar_ical/calendar_plugin_style_ical.inc:81
msgid "Description"
msgstr "Beschreibung"
#: calendar_ical/calendar_plugin_style_ical.inc:87
msgid "Location"
msgstr "Standort"
#: calendar_ical/calendar_plugin_style_ical.inc:107
msgid "The @style style requires a Date argument or a Date filter."
msgstr "@style erfordert ein Datum als Argument oder einen Datums Filter."
#: calendar_ical/calendar_plugin_style_ical.inc:120
msgid "The @style style requires a Title field for the iCal export."
msgstr "@style erfordert ein Feld Titel für iCal."
#: calendar_ical/calendar_plugin_style_ical.inc:134
#: includes/calendar_plugin_style.inc:106
msgid "The date field '@field' used by the display '@display_title' cannot be set to 'Group multiple values'."
msgstr "Das Feld mit Datum '@field' verwendet zur Anzeige über '@display_title' kann nicht zum gruppieren verwendet werden."
#: calendar_ical/calendar_ical.module:29;29
msgid "Add to calendar"
msgstr "Zum Kalender hinzufügen"
#: calendar_ical/calendar_ical.info:0
msgid "Calendar iCal"
msgstr "Kalender iCal"
#: calendar_ical/calendar_ical.info:0
msgid "Adds ical functionality to Calendar views."
msgstr "iCals zu Kalenderansichten hinzufügen."
#: includes/calendar.views.inc:114;127
msgid "Calendar page"
msgstr "Kalenderblatt"
#: includes/calendar.views.inc:115
msgid "Calendar page. Attach Calendar period attachments to this page, set to show the year, month, day, and week views."
msgstr "Kalenderblatt Einen Kalender Zeitraum als Anhänge zu dieser Seite hinzufügen, kann auf Jahr, Monat, Tag und Woche gesetzt werden."
#: includes/calendar.views.inc:136;149
msgid "Calendar block"
msgstr "Kalender-Block"
#: includes/calendar.views.inc:137
msgid "Calendar page. Attach a Calendar period attachment to this block, set to show the year, month, day, or week view."
msgstr "Kalenderblatt Einen Kalender Zeitraum als Anhange zu diesem Block hinzufügen, kann auf Jahr, Monat, Tag und Woche gesetzt werden."
#: includes/calendar.views.inc:154
#: includes/calendar_plugin_display_attachment.inc:185;224
msgid "Calendar period"
msgstr "Kalender Zeitraum"
#: includes/calendar.views.inc:155
msgid "An attachment for a Year, Month, Day, or Week calendar display, using any style you choose. Attach to a Calendar page and/or a Calendar block."
msgstr "Ein Anhang für ein Jahr, Monat, Tag oder Woche im Kalender anzeigen. Eine Kalender-Seite und / oder einen Kalender-Block hinzufügen."
#: includes/calendar.views.inc:165
msgid "Calendar page year, month, week, or day view"
msgstr "Kalender für Jahres-, Monats-, Wochen-oder Tagesansicht"
#: includes/calendar.views.inc:180
msgid "Calendar navigation"
msgstr "Kalender Navigation"
#: includes/calendar.views.inc:181
msgid "Creates back/next navigation and calendar links."
msgstr "Erstellt zurück-, weiter- und Kalender-Links."
#: includes/calendar.views.inc:196
msgid "Displays Views results in a calendar."
msgstr "Ansicht als Kalender ausgeben"
#: includes/calendar_plugin_display_attachment.inc:94
msgid "A Calendar period display will not work without a Date argument."
msgstr "Zur Anzeige eines Zeitraums ist ein Datum oder ein Datumsfilter erforderlich."
#: includes/calendar_plugin_display_attachment.inc:188
msgid "Select the calendar time period for this display."
msgstr "Wählen Sie den Kalender Zeitraum für diese Anzeige."
#: includes/calendar_plugin_display_attachment.inc:219
#: includes/calendar_plugin_display_page.inc:79
msgid "Calendar settings"
msgstr "Die Einstellungen für Kalender"
#: includes/calendar_plugin_display_block.inc:26
msgid "The Calendar period display '@display_title' will not work without a Date argument."
msgstr "Zur Anzeige eines Zeitraums '@display_title' ist ein Datum oder ein Datumsfilter erforderlich."
#: includes/calendar_plugin_display_page.inc:22
msgid "The Calendar display '@display_title' will not work without a Date argument."
msgstr "Zur Anzeige eines Zeitraums '@display_title' ist ein Datum oder ein Datumsfilter erforderlich."
#: includes/calendar_plugin_display_page.inc:86
msgid "Legend Content Types"
msgstr "Legende für Inhaltstypen"
#: includes/calendar_plugin_display_page.inc:87;92;97
msgid "Edit"
msgstr "Bearbeiten"
#: includes/calendar_plugin_display_page.inc:91
msgid "Legend Vocabularies"
msgstr "Legende für Vokabularien"
#: includes/calendar_plugin_display_page.inc:96
msgid "Legend Terms"
msgstr "Legende für Begriffe"
#: includes/calendar_plugin_display_page.inc:103;125
msgid "Date changer"
msgstr "[fuzzy] !date !username"
#: includes/calendar_plugin_display_page.inc:109;135
msgid "Add new date link"
msgstr "Einen Link für Datum hinzufügen"
#: includes/calendar_plugin_display_page.inc:116
#: includes/calendar_view_plugin_style.inc:65
msgid "No"
msgstr "Nein"
#: includes/calendar_plugin_display_page.inc:116
#: includes/calendar_view_plugin_style.inc:65
msgid "Yes"
msgstr "Ja"
#: includes/calendar_plugin_display_page.inc:130
msgid "Display a popup calendar date selector?"
msgstr "Einen Popup-Kalender zu Datumsauswahl anzeigen?"
#: includes/calendar_plugin_display_page.inc:139
msgid "No link"
msgstr "Kein Link"
#: includes/calendar_plugin_display_page.inc:140
msgid "Display a link to add a new date of the specified content type. Displayed only to users with appropriate permissions."
msgstr "Anzeigen eines Links, um ein Datum zu einem Inhaltstpy hinzuzufügen. Nur für Benutzer mit entsprechenden Berechtigungen anzeigen."
#: includes/calendar_plugin_display_page.inc:147
msgid "Content Type Legend Colors"
msgstr "Inhaltstyp Farblegende"
#: includes/calendar_plugin_display_page.inc:149
msgid "<div class=\"form-item\"><label>Content Type</label><p>Set a hex color value (like #ffffff) to use in the calendar legend for each content type. Types with empty values will have no stripe in the calendar and will not be added to the legend.</p></div>"
msgstr "<div class=\\\"form-item\\\"> <label>Inhaltstyp</label><p> Legen Sie einen Hex-Farbwert (zB # FFFFFF) für die Legende des Kalenders an. Die Legende nimmt nur existierende Werte auf.</p></div>"
#: includes/calendar_plugin_display_page.inc:182
msgid "Vocabulary Legend Types"
msgstr "Legende für Vokabularien"
#: includes/calendar_plugin_display_page.inc:189
msgid "<div class=\"form-item\"><label>Vocabularies</label>Select vocabularies to use for setting calendar legend colors by taxonomy term. This works best for vocabularies with only a limited number of possible terms.</div>"
msgstr "<div class=\\\"form-item\\\"> Wählen Sie <label>Vokabularien</label> Vokabularien für die Legende von Kalendern auswählen, um die Farben durch Taxonomie Begriffe zu definieren. Dies funktioniert am besten mit Vokabularien, die eine begrenzten Anzahl von Begriffen enthalten.</div>"
#: includes/calendar_plugin_display_page.inc:195
msgid "Taxonomy Legend Colors"
msgstr "Farben in der Legende für Taxonomie"
#: includes/calendar_plugin_display_page.inc:198
msgid "<div class=\"form-item warning\">Please select Legend vocabularies first!</div>"
msgstr "<div class=\\\"form-item warning\\\"> Bitte wählen Sie für die Legende zuerst ein Vokabular! </div>"
#: includes/calendar_plugin_display_page.inc:200
msgid "<div class=\"form-item\"><label>Taxonomy Terms</label><p>Set a hex color value (like #ffffff) to use in the calendar legend for each taxonomy term. Terms with empty values will have no stripe in the calendar and will not be added to the legend.</p></div>"
msgstr "<div class=\\\"form-item\\\"> <label>Taxonomy Begriff</label> <p> Legen Sie einen Hex-Farbwert (zB # FFFFFF) für die Legende des Kalenders für jeden einzelnen Taxonomie-Begriff fest. Die Legende nimmt nur existierende Werte auf.</p></div>"
#: includes/calendar_plugin_style.inc:75
msgid "The @style style requires a Date argument."
msgstr "@style erfordert ein Datumsargument."
#: includes/calendar_plugin_style.inc:114
msgid "The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar."
msgstr "Das Argument für das Datum muss dieser Abfrage hinzugefügt werden. Schließen Sie aus, was nicht im Kalender angezeigt werden soll."
#: includes/calendar_view_plugin_style.inc:55
msgid "Calendar day of week names"
msgstr "[fuzzy] Der Name des Wochentages"
#: includes/calendar_view_plugin_style.inc:58
msgid "First letter of name"
msgstr "Ersten Buchstaben des Namens"
#: includes/calendar_view_plugin_style.inc:58
msgid "First two letters of name"
msgstr "Die ersten beiden Buchstaben des Namens"
#: includes/calendar_view_plugin_style.inc:58
msgid "Abbreviated name"
msgstr "Abgekürzter Name"
#: includes/calendar_view_plugin_style.inc:58
msgid "Full name"
msgstr "Vollständiger Name"
#: includes/calendar_view_plugin_style.inc:59
msgid "The way day of week names should be displayed in a calendar."
msgstr "Die Art und Weise, wie die Namen von Wochentagen in Kalendern angezeigt werden."
#: includes/calendar_view_plugin_style.inc:62
msgid "Show week numbers"
msgstr "Wochennummer anzeigen"
#: includes/calendar_view_plugin_style.inc:66
msgid "Whether or not to show week numbers in the left column of calendar weeks and months."
msgstr "Wochennummer in der linken Spalte anzeigen bei Wochen und Monaten."
#: includes/calendar_view_plugin_style.inc:69
msgid "Maximum items"
msgstr "Maximale Anzahl von Elementen"
#: includes/calendar_view_plugin_style.inc:71
msgid "Unlimited"
msgstr "Unbegrenzt"
#: includes/calendar_view_plugin_style.inc:71
msgid "No items"
msgstr "Keine Einträge"
#: includes/calendar_view_plugin_style.inc:71
msgid "3 items"
msgstr "3 Einträge"
#: includes/calendar_view_plugin_style.inc:71
msgid "5 items"
msgstr "5 Einträge"
#: includes/calendar_view_plugin_style.inc:71
msgid "10 items"
msgstr "10 Einträge"
#: includes/calendar_view_plugin_style.inc:73
msgid "Maximum number of items to show in calendar cells, used to keep the calendar from expanding to a huge size when there are lots of items in one day. "
msgstr "Maximale Anzahl von Einträgen in Kalender Zellen, um den Kalender überschaubar zu halten, wenn es um sehr viele Termine an einem Tag gibt. "
#: includes/calendar_view_plugin_style.inc:76
msgid "Too many items"
msgstr "Zu viele Einträge"
#: includes/calendar_view_plugin_style.inc:78
msgid "Show maximum, add 'more' link"
msgstr "Das Maximum und einen Link für weitere anzeigen"
#: includes/calendar_view_plugin_style.inc:78
msgid "Hide all, add link to day"
msgstr "Alles ausblenden, Link für Tag hinzufügen"
#: includes/calendar_view_plugin_style.inc:80
msgid "Behavior when there are more than the above number of items in a single day. When there more items than this limit, a link to the day view will be displayed."
msgstr "Verhalten, wenn es mehr als die oben Anzahl der Elemente in einem einzigen Tag. Wenn mehr Einträge für einen Tag vorhanden sind, als das Maximum vorsieht, so wir ein Link für den Tag eingeblendet."
#: includes/calendar_view_plugin_style.inc:83
msgid "Time grouping"
msgstr "Gruppierung nach Zeit"
#: includes/calendar_view_plugin_style.inc:86
msgid "Group items together into time periods based on their start time."
msgstr "Einträge gruppieren nach der Zeit"
#: includes/calendar_view_plugin_style.inc:87
msgid "Hour"
msgstr "Stunden"
#: includes/calendar_view_plugin_style.inc:87
msgid "Half hour"
msgstr "Eine halbe Stunde"
#: includes/calendar_view_plugin_style.inc:87
msgid "Custom"
msgstr "Benutzerdefiniert"
#: includes/calendar_view_plugin_style.inc:90
msgid "Custom time grouping"
msgstr "Benutzerdefiniert nach Zeiträumen gruppieren"
#: includes/calendar_view_plugin_style.inc:93
msgid "When choosing the 'custom' Time grouping option above, create custom time period groupings as a comma-separated list of 24-hour times in the format HH:MM:SS, like '00:00:00,08:00:00,18:00:00'. Be sure to start with '00:00:00'. All items after the last time will go in the final group."
msgstr "Bei der Wahl der benutzerdefinierten Zeiträume für die Gruppierungsoption oben, benutzerdefinierte Zeiträume als Komma-separierte Liste im 24-Stunden-Format HH: MM: SS, wie '00: 00:00,08:00:00, 18:00:00 angeben. Achten Sie darauf, mit '00:00:00 ' zu beginnen. Alle Einträge nach dem letzten Zeitraum erscheinen in der letzten Gruppe."
#: includes/calendar_view_plugin_style.inc:111
msgid "Field grouping"
msgstr "Gruppierungsfeld"
#: includes/calendar_view_plugin_style.inc:114
msgid "Optionally group items into columns by a field value, for instance select the content type to show items for each content type in their own column, or use a location field to organize items into columns by location."
msgstr "Optional Gruppieren von Elementen in Spalten durch einen Feldwert, zum Beispiel wählen Sie den Inhaltstyp, um Elemente für jedenInhaltstyp in einer eigenen Spalte zu zeigen oder einen Feld Ort verwenden, um Einträge in Spalten nach dem Ort zu ordnen."
#: jcalendar/jcalendar.module:18
msgid "Creates a popup for calendar dates."
msgstr "Ein Popup für Kalenderdaten erstellen."
#: jcalendar/jcalendar.module:90
#: theme/calendar-month-multiple-node.tpl.php:25
#: theme/calendar-week-multiple-node.tpl.php:24
msgid "more"
msgstr "Weiter"
#: jcalendar/jcalendar.module:48
msgid "Get Calendar Node"
msgstr "Kalendereintrag abrufen"
#: jcalendar/jcalendar.info:0
msgid "Calendar Popup"
msgstr "Kalender Popup "
#: jcalendar/jcalendar.info:0
msgid "Replaces the links to calendar items with a javascript popup that gracefully regresses if javascript is not enabled"
msgstr "Wenn Javascript verfügbar ist, werden Links zu Kalendereinträgen mit einem Javascript-Popup, ersetzt. Ist Javascript nicht verfügbar wird auf reguläre Links zurückgefallen."
#: theme/calendar-day.tpl.php:41
#: theme/calendar-week.tpl.php:36
msgid "Time"
msgstr "Zeit"
#: theme/calendar-month-multiple-node.tpl.php:21
#: theme/calendar-week-multiple-node.tpl.php:20
msgid "Click to see all @count events"
msgstr "Alle @count Termine anzeigen"
#: theme/theme.inc:59
msgid "Add+"
msgstr "[fuzzy] Hinzufügen"
#: theme/theme.inc:305;331;374
msgid "Items"
msgstr "Einträge"
#: theme/theme.inc:647
msgid "All times"
msgstr "Immer"
#: theme/theme.inc:651
msgid "Before @time"
msgstr "Vor @time"
#: theme/theme.inc:674
msgid "Item"
msgstr "Eintrag"
#: theme/theme.inc:675
msgid "Key"
msgstr "Schlüssel"
#: theme/theme.inc:721
msgid "Empty day"
msgstr "Tag ohne Eintrag"

View file

@ -0,0 +1,42 @@
# $Id: general.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
#
# Czech translation of Calendar (6.x-2.2)
# Copyright (c) 2010 by the Czech translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (6.x-2.2)\n"
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
"PO-Revision-Date: 2010-09-29 20:42+0000\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
msgid "more"
msgstr "více"
msgid "Yes"
msgstr "Ano"
msgid "No"
msgstr "Ne"
msgid "None"
msgstr "Žádné"
msgid "Time"
msgstr "Čas"
msgid "Calendar"
msgstr "Kalendář"
msgid "Date/Time"
msgstr "Datum/čas"
msgid "Calendar settings"
msgstr "Nastavení kalendáře"
msgid "Click to see all @count events"
msgstr "Klikněte pro zobrazení všech událostí - celkem: @count"
msgid ""
"The date field '@field' used by the display '@display_title' cannot be "
"set to 'Group multiple values'."
msgstr ""
"V definici zobrazení '@display_title' nelze u pole reprezentujícího "
"datum '@field' učinit nastavení 'Seskupit více hodnot'."
msgid "Calendar period"
msgstr "Období kalendáře"

View file

@ -0,0 +1,152 @@
# Hungarian translation of Calendar (all releases)
# Copyright (c) 2009 by the Hungarian translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (all releases)\n"
"POT-Creation-Date: 2009-11-10 16:39+0000\n"
"PO-Revision-Date: 2009-11-10 14:13+0000\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
msgid "Submit"
msgstr "Beküldés"
msgid "Item"
msgstr "Elem"
msgid "List"
msgstr "Lista"
msgid "more"
msgstr "tovább"
msgid "Yes"
msgstr "Igen"
msgid "No"
msgstr "Nem"
msgid "None"
msgstr "Nincs"
msgid "Name"
msgstr "Név"
msgid "Time"
msgstr "Idő"
msgid "Views"
msgstr "Nézetek"
msgid "Maximum items"
msgstr "Maximális elemszám"
msgid "Year"
msgstr "Év"
msgid "Url"
msgstr "Webcím"
msgid "Feed type"
msgstr "Hírcsatorna típusa"
msgid "Month"
msgstr "Hónap"
msgid "Unlimited"
msgstr "Korlátlan"
msgid "Calendar"
msgstr "Naptár"
msgid "Week"
msgstr "Hét"
msgid "Day"
msgstr "Nap"
msgid "Table"
msgstr "Táblázat"
msgid "Full name"
msgstr "Teljes név"
msgid "Key"
msgstr "Kulcs"
msgid "Teasers"
msgstr "Bevezetők"
msgid "Expire iCal cache"
msgstr "iCal gyorsítótár lejárata"
msgid ""
"iCal feeds are cached to improve performance. Set an expiration time "
"for cached feeds."
msgstr ""
"Az iCal hírcsatornák a teljesítmény javítása érdekében "
"gyorsítótárazva vannak. Be kell állítani egy lejárati időt a "
"gyorsítótárazott hírcsatornákhoz."
msgid "iCal Feeds"
msgstr "iCal hírcsatornák"
msgid ""
"Use this section to set up iCal feeds that should be displayed in this "
"calendar. They will be shown along with any internal items that match "
"the calendar criteria."
msgstr ""
"Itt lehet beállítani a naptárban megjeleníteni kívánt iCal "
"hírcsatornákat. Azokkal a belső elemekkel együtt fognak "
"megjelenni, amik megegyeznek a naptár feltételeivel."
msgid "The name of a feed to include in this calendar."
msgstr "A naptárba beillesztett hírcsatorna neve."
msgid ""
"The external feed url or internal file path and name. Change "
"'webcal://' to 'http://'."
msgstr ""
"A külső hírcsatorna URL-je vagy a belső fájl elérési útja és "
"neve. Módosítani kell a „webcal://” előtagot „http://” "
"formára."
msgid "Add to calendar"
msgstr "Hozzáadás a naptárhoz"
msgid "Calendar iCal"
msgstr "iCal naptár"
msgid "Date/Time"
msgstr "Dátum/Idő"
msgid "Calendar settings"
msgstr "Naptár beállításai"
msgid "First letter of name"
msgstr "A név első betűje"
msgid "First two letters of name"
msgstr "A név első két betűje"
msgid "Abbreviated name"
msgstr "Rövidített név"
msgid "Show week numbers"
msgstr "Hetek számának megjelenítése"
msgid "3 items"
msgstr "3 elem"
msgid "5 items"
msgstr "5 elem"
msgid "10 items"
msgstr "10 elem"
msgid ""
"Maximum number of items to show in calendar cells, used to keep the "
"calendar from expanding to a huge size when there are lots of items in "
"one day. "
msgstr ""
"A naptár cellákban megjelenített elemek számának felső határa, "
"megakadályozza a naptár nagyra növését ha egy napon nagyon sok "
"elem van. "
msgid "Too many items"
msgstr "Túl sok elem"
msgid "Show maximum, add 'more' link"
msgstr "Maximum megjelenítése, „tovább” hivatkozás hozzáadása"
msgid "Hide all, add link to day"
msgstr "Összes elrejtése, hivatkozás hozzáadása a naphoz"
msgid ""
"Behavior when there are more than the above number of items in a "
"single day. When there more items than this limit, a link to the day "
"view will be displayed."
msgstr ""
"A viselkedés, ha a fentinél több elem van egy napon. Ha a "
"korlátnál több elem van, egy, a napi nézetre mutató hivatkozás "
"fog megjelenni."
msgid "Stripe color"
msgstr "Sáv színe"
msgid ""
"The hex color value (like #ffffff) to use for this feed's calendar "
"stripe."
msgstr ""
"A hírcsatorna naptársávjához használt szín tizenhatos "
"számrendszerbeli értéke (például #ffffff)."
msgid "Click to see all @count events"
msgstr "Kattintás az összes (@count) esemény megtekintéséhez"
msgid "Adds ical functionality to Calendar views."
msgstr "Ical hozzáadása a Calendar nézetekhez."
msgid ""
"The date field '@field' used by the display '@display_title' cannot be "
"set to 'Group multiple values'."
msgstr ""
"„@display_title” képernyő által használt „@field” mezőn "
"nem beállítható a „Több érték csoportosítása”."
msgid "Calendar period"
msgstr "Naptári időszak"

View file

@ -0,0 +1,198 @@
# Hungarian translation of Calendar (all releases)
# Copyright (c) 2009 by the Hungarian translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (all releases)\n"
"POT-Creation-Date: 2009-11-10 16:39+0000\n"
"PO-Revision-Date: 2009-11-10 14:13+0000\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
msgid "Edit"
msgstr "Szerkesztés"
msgid "Custom"
msgstr "Egyedi"
msgid "Hour"
msgstr "Óra"
msgid "No link"
msgstr "Nincs hivatkozás"
msgid "Calendar page"
msgstr "Naptár oldal"
msgid ""
"Calendar page. Attach Calendar period attachments to this page, set to "
"show the year, month, day, and week views."
msgstr ""
"Naptár oldal. Naptári időszak csatolmányok vannak az oldalhoz "
"csatolva, amik az éves, havi, napi és heti nézetek "
"megjelenítésére vannak beállítva."
msgid "Calendar block"
msgstr "Naptár blokk"
msgid ""
"Calendar page. Attach a Calendar period attachment to this block, set "
"to show the year, month, day, or week view."
msgstr ""
"Naptár oldal. Egy Naptári időszak csatolmány van a blokkhoz "
"csatolva, ami az éves, havi, napi és heti nézetek "
"megjelenítésére van beállítva."
msgid ""
"An attachment for a Year, Month, Day, or Week calendar display, using "
"any style you choose. Attach to a Calendar page and/or a Calendar "
"block."
msgstr ""
"Egy csatolmány az Éves, Havi, Napi vagy Heti naptár "
"megjelenítéséhez, tetszőlegesen választott stílussal. Egy "
"Naptár oldalhoz és/vagy egy Naptár blokkhoz van csatolva."
msgid "Calendar page year, month, week, or day view"
msgstr "Naptár oldal éves, havi, heti vagy napi nézet."
msgid "Calendar navigation"
msgstr "Naptár navigáció"
msgid "Creates back/next navigation and calendar links."
msgstr ""
"Előző/következő navigációt és naptári hivatkozásokat hoz "
"létre."
msgid "Displays Views results in a calendar."
msgstr "Views eredmények megjelenítése egy naptárban."
msgid "A Calendar period display will not work without a Date argument."
msgstr ""
"A naptári időszak képernyő nem működik dátum argumentum "
"nélkül."
msgid "Select the calendar time period for this display."
msgstr "Naptári időszak kiválasztása ehhez a képernyőhöz."
msgid ""
"The Calendar period display '@display_title' will not work without a "
"Date argument."
msgstr ""
"„@display_title” naptári időszak képernyő nem fog működni "
"dátum argumentum nélkül."
msgid ""
"The Calendar display '@display_title' will not work without a Date "
"argument."
msgstr ""
"„@display_title” naptárképernyő nem fog működni dátum "
"argumentum nélkül."
msgid "Legend Content Types"
msgstr "Tartalomtípusok magyarázat"
msgid "Legend Vocabularies"
msgstr "Szótárak magyarázat"
msgid "Legend Terms"
msgstr "Kifejezések magyarázat"
msgid "Date changer"
msgstr "Dátumváltó"
msgid "Add new date link"
msgstr "Új dátumhivatkozás hozzáadása"
msgid "Display a popup calendar date selector?"
msgstr "Megjelenjen egy felugró-naptár dátumválasztó?"
msgid ""
"Display a link to add a new date of the specified content type. "
"Displayed only to users with appropriate permissions."
msgstr ""
"Megjelenít egy hivatkozást amivel új dátumot lehet hozzáadni a "
"meghatározott tartalomtípushoz. Csak a megfelelő jogosultságokkal "
"rendelkező felhasználóknak jelenik meg."
msgid "Content Type Legend Colors"
msgstr "Tartalomtípus magyarázatok színei"
msgid ""
"<div class=\"form-item\"><label>Content Type</label><p>Set a hex color "
"value (like #ffffff) to use in the calendar legend for each content "
"type. Types with empty values will have no stripe in the calendar and "
"will not be added to the legend.</p></div>"
msgstr ""
"<div class=\"form-item\"><label>Tartalomtípus</label><p>Egy szín "
"tizenhatos számrendszerbeli értékét kell megadni (például "
"#ffffff) ami a tartalomtípusoknál a naptár magyarázatban lesz "
"használva. Azok a típusok, melyeknek értéke üres, nem lesznek "
"csíkozva és nem lesznek hozzáadva a magyarázathoz.</p></div>"
msgid "Vocabulary Legend Types"
msgstr "Szótár magyarázattípusok"
msgid ""
"<div class=\"form-item\"><label>Vocabularies</label>Select "
"vocabularies to use for setting calendar legend colors by taxonomy "
"term. This works best for vocabularies with only a limited number of "
"possible terms.</div>"
msgstr ""
"<div class=\"form-item\"><label>Szótárak</label>Ki kell választani "
"a taxonómia kifejezésekhez tartozó naptár magyarázatok színeinek "
"beállításához használt szótárat. Azoknál a szótáraknál "
"működik a legjobban, ahol a lehetséges kifejezések száma "
"korlátozott.</div>"
msgid "Taxonomy Legend Colors"
msgstr "Taxonómia magyarázatok színei"
msgid ""
"<div class=\"form-item warning\">Please select Legend vocabularies "
"first!</div>"
msgstr ""
"<div class=\"form-item warning\">Először Szótár magyarázatot kell "
"választani!</div>"
msgid ""
"<div class=\"form-item\"><label>Taxonomy Terms</label><p>Set a hex "
"color value (like #ffffff) to use in the calendar legend for each "
"taxonomy term. Terms with empty values will have no stripe in the "
"calendar and will not be added to the legend.</p></div>"
msgstr ""
"<div class=\"form-item\"><label>Taxonómia kifejezések</label><p>Egy "
"szín hexadecimális kódját kell megadni (pl. #ffffff) ami a "
"taxonómia kifejezéseknél a naptár magyarázatban lesz használva. "
"Az üres érétket tartalmazó kifejezések nem lesznek csíkozva a "
"naptárban és nem lesznek hozzáadva a magyarázathoz.</p></div>"
msgid "The @style style requires a Date argument."
msgstr "@style stílushoz szükséges egy Dátum argumentum."
msgid ""
"The date argument date fields must be added to this query. You can "
"exclude them if you do not want them displayed in the calendar."
msgstr ""
"A dátum argumentum dátummezőket hozzá kell adni ehhez a "
"lekérdezéshez. A mezőket el lehet rejteni, ha nem kell "
"megjeleníteni azokat a naptárban."
msgid "Calendar day of week names"
msgstr "A hét napjainak elnevezése a naptárban"
msgid "The way day of week names should be displayed in a calendar."
msgstr ""
"A mód ahogy a hét napjainak neveit meg kell jeleníteni a "
"naptárban."
msgid ""
"Whether or not to show week numbers in the left column of calendar "
"weeks and months."
msgstr ""
"A hetek száma legyen-e mutatva a heti és havi naptárak bal oldali "
"oszlopában."
msgid "No items"
msgstr "Nincsenek elemek"
msgid "Time grouping"
msgstr "Időcsoportosítás"
msgid "Group items together into time periods based on their start time."
msgstr "Elemek csoportosítása időszakok szerint a kezdési idő alapján."
msgid "Half hour"
msgstr "Fél óra"
msgid "Custom time grouping"
msgstr "Egyéni időcsoportosítás"
msgid ""
"When choosing the 'custom' Time grouping option above, create custom "
"time period groupings as a comma-separated list of 24-hour times in "
"the format HH:MM:SS, like '00:00:00,08:00:00,18:00:00'. Be sure to "
"start with '00:00:00'. All items after the last time will go in the "
"final group."
msgstr ""
"Ha az „egyéni” Időcsoportosítás lett fentebb kiválasztva, "
"létre kell hozni egy egyéni időszak szerinti csoportosítást, ahol "
"egy vesszővel elválasztott listában 24 órás időpontokat kell "
"megadni ÓÓ:PP:MM formában, például így: "
"„00:00:00,08:00:00,18:00:00”. A listának „00:00:00” "
"értékkel kell kezdődnie. Az utolsó időpont utáni elemek az "
"utolsó csoportba kerülnek."
msgid "Field grouping"
msgstr "Mezőcsoportosítás"
msgid ""
"Optionally group items into columns by a field value, for instance "
"select the content type to show items for each content type in their "
"own column, or use a location field to organize items into columns by "
"location."
msgstr ""
"Az elemeket oszlopokba lehet csoportosítani egy mező értéke "
"szerint, például a tartalomtípust kiválasztva, a "
"tartalomtípusokhoz tartozó elemek a saját oszlopukban jelennek meg, "
"vagy egy helyszín mezőt használva, az elemek helyszín szerint "
"lesznek oszlopokba rendezve."

View file

@ -0,0 +1,30 @@
# $Id: installer.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
#
# Czech translation of Calendar (6.x-2.2)
# Copyright (c) 2010 by the Czech translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (6.x-2.2)\n"
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
"PO-Revision-Date: 2010-09-29 20:42+0000\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
msgid "Calendar requirements"
msgstr "Požadavky modulu Calendar"
msgid ""
"The Calendar module requires a more current version of the Date API. "
"Please check for a newer version."
msgstr ""
"Modul Calendar vyžaduje novější verzi modulu Date API. Proveďte "
"prosím aktualizaci."
msgid ""
"The Calendar module requires the latest version of the Date API, be "
"sure you are installing the latest versions of both modules."
msgstr ""
"Modul Calendar vyžaduje poslední verzi modulu Date API, ujistěte se "
"prosím, že instalujete poslední verze obou modulů."

View file

@ -0,0 +1,29 @@
# Hungarian translation of Calendar (all releases)
# Copyright (c) 2009 by the Hungarian translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (all releases)\n"
"POT-Creation-Date: 2009-11-10 16:39+0000\n"
"PO-Revision-Date: 2009-10-31 09:56+0000\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
msgid "Calendar requirements"
msgstr "Calendar előfeltételei"
msgid ""
"The Calendar module requires a more current version of the Date API. "
"Please check for a newer version."
msgstr ""
"A Calendar modulnak a Date API frissebb verziójára van szüksége. "
"Telepíteni kell egy újabb verziót."
msgid ""
"The Calendar module requires the latest version of the Date API, be "
"sure you are installing the latest versions of both modules."
msgstr ""
"A Naptár modulhoz a Date API legfrissebb változata szükséges. Meg "
"kell győződni arról, hogy mindkét modul legfrissebb verziója van "
"telepítve."

View file

@ -0,0 +1,79 @@
# $Id: root.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
#
# Czech translation of Calendar (6.x-2.2)
# Copyright (c) 2010 by the Czech translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (6.x-2.2)\n"
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
"PO-Revision-Date: 2010-09-29 20:43+0000\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
msgid "Year"
msgstr "Rok"
msgid "Month"
msgstr "Měsíc"
msgid "Week"
msgstr "Týden"
msgid "Day"
msgstr "Den"
msgid "<p>View complete documentation at !link.</p>"
msgstr "<p>Kompletní dokumentace je na adrese !link.</p>"
msgid "Calendar Legend."
msgstr "Legenda kalendáře."
msgid "Calendar Legend"
msgstr "Legenda kalendáře"
msgid " is not a valid hex color"
msgstr " není platná barva v šestnáctkovém zápisu"
msgid "Change date"
msgstr "Změnit datum"
msgid "Calendar requirements"
msgstr "Požadavky modulu Calendar"
msgid ""
"The Calendar module requires a more current version of the Date API. "
"Please check for a newer version."
msgstr ""
"Modul Calendar vyžaduje novější verzi modulu Date API. Proveďte "
"prosím aktualizaci."
msgid ""
"The Calendar module requires the latest version of the Date API, be "
"sure you are installing the latest versions of both modules."
msgstr ""
"Modul Calendar vyžaduje poslední verzi modulu Date API, ujistěte se "
"prosím, že instalujete poslední verze obou modulů."
msgid "Views plugin to display views containing dates as Calendars."
msgstr ""
"Plugin modulu Views pro zobrazování datumů prostřednictvím "
"kalendářů."
msgid ""
"The Date argument in this view must be set up to provide a default "
"value set to the current date. Edit the argument, find 'Action to take "
"if argument is not present.', choose 'Provide default argument', then "
"select 'Current date'."
msgstr ""
"V rámci tohoto pohledu je potřeba nastavit argument reprezentující "
"datum tak, aby jeho výchozí hodnota odpovídala aktuálnímu datu. "
"Upravte argument a vyhledejte položku 'Jakou akci spustit, pokud "
"nebyl nalezen žádný argument', zvolte 'Poskytnout výchozí "
"argument', z nabídky vyberte 'Aktuální datum'."
msgid "View the calendar."
msgstr "Zobrazit kalendář."
msgid ""
"Calendar module cannot be updated until after Views has been updated. "
"Please return to <a href=\"@update-php\">update.php</a> and run the "
"remaining updates."
msgstr ""
"Modul Calendar nemůže být aktualizován, dokud není aktualizován "
"modul Views. Opakujte <a href=\"@update-php\">update.php</a> a "
"spusťte zbývající aktualizace."
msgid ""
"calendar.module has updates, but cannot be updated until views.module "
"is updated first."
msgstr ""
"Modul kalendář má k dispozici aktualizace, ale nebude aktualizován "
"dokud nebude nejdříve aktualizován modul Views."

View file

@ -0,0 +1,294 @@
# Hungarian translation of Calendar (all releases)
# Copyright (c) 2009 by the Hungarian translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (all releases)\n"
"POT-Creation-Date: 2009-11-10 16:39+0000\n"
"PO-Revision-Date: 2009-11-10 14:07+0000\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
msgid "Setup"
msgstr "Beállítás"
msgid "Nodes"
msgstr "Tartalmak"
msgid "Display options"
msgstr "Megjelenítési beállítások"
msgid "next"
msgstr "előző"
msgid "Mon"
msgstr "h"
msgid "Tue"
msgstr "k"
msgid "Wed"
msgstr "sze"
msgid "Thu"
msgstr "cs"
msgid "Fri"
msgstr "p"
msgid "Sat"
msgstr "szo"
msgid "Sun"
msgstr "v"
msgid "all day"
msgstr "egész nap"
msgid "All day"
msgstr "Egész nap"
msgid "Full Nodes"
msgstr "Teljes nézet"
msgid "You can only set on Default Sort on one field."
msgstr "Az Alapértelmezett rendezésnél csak egy mező adható meg."
msgid "The Calendar View requires at least one field."
msgstr ""
msgid "Calendar arguments must be set to 'Display All Values'."
msgstr ""
msgid ""
"The Calendar requres as arguments Calendar: Year, Calendar: Month, and "
"Calendar: Day, or Calendar: Year and Calendar: Week"
msgstr ""
msgid ""
"Calendar CCK Date fields must be set to 'Do not group multiple "
"values'."
msgstr ""
msgid "Time format"
msgstr "Időformátum"
msgid "The format to use for the time-only date display."
msgstr ""
msgid "Year display"
msgstr "Év képernyő"
msgid "Month display"
msgstr "Hónap képernyő"
msgid "Week display"
msgstr "Hét képernyő"
msgid "Day display"
msgstr "Nap képernyő"
msgid "Block display"
msgstr "Blokk képernyő"
msgid "Wildcard argument"
msgstr ""
msgid ""
"A character or short text string to use for empty calendar arguments. "
"For instance, 'all' would create the url 2007/12/all to show all days "
"in December of 2007. Note that non-ASCII characters will not display "
"correctly in urls."
msgstr ""
msgid "Calendar: Year"
msgstr "Calendar: Év"
msgid "Filter by the calendar year (YYYY)."
msgstr ""
msgid "Calendar: Month"
msgstr "Calendar: Hónap"
msgid ""
"Filter by the calendar month (1-12). Place this argument after a "
"'Year' argument."
msgstr ""
msgid "Calendar: Day"
msgstr "Calendar: Nap"
msgid ""
"Filter by the calendar day (1-31). Place this argument after a 'Year' "
"and a 'Month' argument."
msgstr ""
msgid "Calendar: Week"
msgstr "Calendar: Hét"
msgid ""
"Filter by the week number (1-52). Place this argument after a 'Year' "
"argument and use a 'W' in front of the week number in the url."
msgstr ""
msgid "calendar"
msgstr "naptár"
msgid ""
"Calendar view of any date field, add a date field to the view to use "
"it."
msgstr ""
msgid "<p>View complete documentation at !link.</p>"
msgstr "<p>A teljes dokumentáció itt !link található.</p>"
msgid "Calendar setup."
msgstr "Naptár beállítása."
msgid "Calendar Legend."
msgstr "Naptár magyarázat."
msgid "Switch Calendar."
msgstr "Naptár váltása."
msgid "Calendar Legend"
msgstr "Naptár magyarázat"
msgid "Switch Calendar"
msgstr "Naptár váltása"
msgid "Switch"
msgstr "Váltás"
msgid "iCal"
msgstr "iCal"
msgid "iCal setup."
msgstr "iCal beállítása."
msgid "Calendar: iCal Feed"
msgstr "Calendar: iCal hírcsatorna"
msgid "<h3>Stripe options</h3>"
msgstr "<h3>Csíkozás beállításai</h3>"
msgid "Stripe"
msgstr "Csíkozás"
msgid "The color stripe to use for this feed (not working yet)."
msgstr ""
msgid ""
"Add this as the last argument to a calendar view to provide an iCal "
"feed of the view."
msgstr ""
msgid "Week @week @year"
msgstr "@year @week. hét"
msgid "Week of @date"
msgstr "@date hete"
msgid "prev"
msgstr "következő"
msgid "view this item"
msgstr "megtekintés"
msgid "!month / !day"
msgstr "!month / !day"
msgid ""
"Adds date calendar themes to views that can display any type of date "
"field, and creates default calendar views."
msgstr ""
msgid "Adds ical functionality to calendar views."
msgstr ""
msgid " is not a valid hex color"
msgstr " érvénytelen hexadecimális szín"
msgid "Dates"
msgstr "Dátumok"
msgid "The Calendar View requires at least one date field."
msgstr ""
msgid ""
"The Calendar requires as arguments Calendar: Year, Calendar: Month, "
"and Calendar: Day, or Calendar: Year and Calendar: Week"
msgstr ""
msgid "Mini day name size"
msgstr ""
msgid "The way day of week names should be displayed in a mini calendar."
msgstr ""
msgid "Full day name size"
msgstr ""
msgid "The way day of week names should be displayed in a full size calendar."
msgstr ""
msgid ""
"Whether or not to display a clickable week number link on the left "
"side of each calendar week."
msgstr ""
msgid "Popup date selector"
msgstr ""
msgid ""
"Whether or not to display a popup date selector to change the calendar "
"period. (Only works when the Date Popup module is enabled.)"
msgstr ""
msgid "Truncate length"
msgstr ""
msgid ""
"Truncate size for titles in month and week view so things fit better "
"into the calendar cell. For instance, change the title from 'Very Very "
"Very Long Name' to something like 'Very Very...'."
msgstr ""
msgid ""
"Choose the way the calendar entries should be displayed. Selecting "
"'None' will hide links to that option."
msgstr ""
msgid "Date year range"
msgstr "Dátum évtartomány"
msgid ""
"Set the allowable minimum and maximum year range for this view, either "
"a -X:+X offset from the current year, like '-3:+3' or an absolute "
"minimum and maximum year, like '2005:2010'. When the argument is set "
"to a date outside the range, the page will be returned as 'Page not "
"found (404)'."
msgstr ""
msgid ""
"<h3>Content Type</h3><p>Set a hex color value (like #ffffff) to use in "
"the calendar legend for each content type. Types with empty values "
"will have no stripe in the calendar and will not be added to the "
"legend.</p>"
msgstr ""
msgid "Legend colors"
msgstr "Magyarázat színei"
msgid "Date year range must be in the format -9:+9 or 2005:2010."
msgstr "A dátum évtartományát -9:+9 vagy 2005:2010 formában kell megadni."
msgid "Calendar settings have been updated."
msgstr ""
msgid "Calendar legend settings have been updated."
msgstr ""
msgid "Feed @delta"
msgstr "@delta hírcsatorna"
msgid "iCal url"
msgstr ""
msgid ""
"The ical url, either an external feed url or internal file path and "
"name. Change 'webcal://' to 'http://'."
msgstr ""
msgid "Default link"
msgstr ""
msgid ""
"A url to use to link back to ical items without a url, generally the "
"public link to the calendar these items are coming from."
msgstr ""
msgid "Calendar Setup"
msgstr ""
msgid "Customize calendar settings options."
msgstr ""
msgid "Legend"
msgstr ""
msgid "Calendar Switcher."
msgstr ""
msgid "Calendar Switcher"
msgstr ""
msgid "Change date"
msgstr "Dátum változtatása"
msgid " !period "
msgstr ""
msgid " !period "
msgstr ""
msgid "more»"
msgstr ""
msgid "Calendar requirements"
msgstr "Calendar előfeltételei"
msgid ""
"The Calendar module requires a more current version of the Date API. "
"Please check for a newer version."
msgstr ""
"A Calendar modulnak a Date API frissebb verziójára van szüksége. "
"Telepíteni kell egy újabb verziót."
msgid ""
"The Calendar module requires the latest version of the Date API, be "
"sure you are installing the latest versions of both modules."
msgstr ""
"A Naptár modulhoz a Date API legfrissebb változata szükséges. Meg "
"kell győződni arról, hogy mindkét modul legfrissebb verziója van "
"telepítve."
msgid "Views plugin to display views containing dates as Calendars."
msgstr ""
"Views beépülő, dátumokat és naptárakat tartalmazó nézetek "
"megjelenítéséhez."
msgid ""
"The Date argument in this view must be set up to provide a default "
"value set to the current date. Edit the argument, find 'Action to take "
"if argument is not present.', choose 'Provide default argument', then "
"select 'Current date'."
msgstr ""
"A Dátum argumentumot ebben a nézetben úgy kell beállítani, hogy "
"az alapértelmezett értéke az aktuális dátum legyen. Szerkeszteni "
"kell az argumentumot, a „Műveletvégzés, ha az argumentum nincs "
"jelen” részben ki kell választani az „Alapértelmezett "
"argumentum megadása” beállítást és a „Jelenlegi dátum”-ot "
"kell beállítani."
msgid "View the calendar."
msgstr "A naptár megtekintése."
msgid ""
"Calendar module cannot be updated until after Views has been updated. "
"Please return to <a href=\"@update-php\">update.php</a> and run the "
"remaining updates."
msgstr ""
"A Calendar modult nem lehet frissíteni amíg a Views nincs "
"frissítve. Vissza kell térni az <a "
"href=\"@update-php\">update.php</a>-hez és lefuttatni a hátralévő "
"frissítéseket."
msgid ""
"calendar.module has updates, but cannot be updated until views.module "
"is updated first."
msgstr ""
"A calendar.modul-hoz frissítések érhetőek el, de nem lehet "
"frissíteni a views.modul frissítése előtt."

View file

@ -0,0 +1,24 @@
# Hungarian translation of Calendar (all releases)
# Copyright (c) 2009 by the Hungarian translation team
#
msgid ""
msgstr ""
"Project-Id-Version: Calendar (all releases)\n"
"POT-Creation-Date: 2009-11-10 16:39+0000\n"
"PO-Revision-Date: 2009-10-30 17:25+0000\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
msgid "Items"
msgstr "Elemek"
msgid "Add+"
msgstr "Hozzáadás+"
msgid "All times"
msgstr "Mindig"
msgid "Before @time"
msgstr "@time előtt"
msgid "Empty day"
msgstr "Üres nap"