Skip to content

Commit

Permalink
Better integration of calendar and wysiwyg editors into database mang…
Browse files Browse the repository at this point in the history
…er 'adminer'
  • Loading branch information
dleffler committed Nov 16, 2012
1 parent e8b7766 commit 6de918a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Expand Up @@ -9,15 +9,17 @@ Added / Fixed / changed for 2.1.0
# This release focuses on new calendar & forms modules, e-Commerce as OOTB experience, integration of jQuery/Twitter Bootstrap
- adds optional nested comments, and optional per-item comment disabling
- adds optional comments to filedownload module items
- adds optional external file url for file download item
- removes extra themes to reduce size of package, available as separate addon downloads
- adds better version change information to initial upgrade page
- adds optional color/style to categories
- upgrades calendar to a 2.0 event controller with categories & tags
-- converts existing calendars
-- optionally upgrades and converts existing calendars
-- adds color-coded categories and tags
-- add color-coded aggregation of external Google & iCal calendars, and online event registrations
- adds new 'mega-menu' navigation view with new free-form page/menu type for embedding modules
- adds random sorting/sequence to photo album/slideshows
- adds optional user selects email destination on form submission
- adds new built-in database manager
- plus many, many other tweaks, fixes, and features

Expand Down
8 changes: 6 additions & 2 deletions external/adminer/plugins/ckeditor.php
Expand Up @@ -57,8 +57,12 @@ function editInput($table, $field, $attrs, $value) {
$lang = get_lang();
$lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang);
}
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
CKEDITOR.replace('fields-" . js_escape($field["field"]) . "');
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='6' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
CKEDITOR.replace('fields-" . js_escape($field["field"]) . "',{
height : '80',
toolbarStartupExpanded : false,
scayt_autoStartup : true,
});
</script>";
}
}
Expand Down
17 changes: 9 additions & 8 deletions external/adminer/plugins/edit-calendar.php
Expand Up @@ -37,15 +37,16 @@ function head() {

function editInput($table, $field, $attrs, $value) {
// if (ereg("date|time", $field["type"])) {
if (ereg("date", $field["field"]) || ereg("edited_at", $field["field"]) || ereg("created_at", $field["field"]) || ereg("publish", $field["field"])) {
$dateFormat = "changeYear: true, changeMonth: true, defaultDate: null, dateFormat: '@', showOn: 'both', buttonImage: '".PATH_RELATIVE."framework/core/assets/images/add.png', buttonImageOnly: true,beforeShow: function(input,inst){jQuery(input).val(jQuery(input).val()*1000);}, onClose: function() {jQuery('#fields-" . js_escape($field['field']) . "').val(parseInt(jQuery('#fields-" . js_escape($field['field']) . "').val()) / 1000);}"; //! yy-mm-dd regional
$timeFormat = "showSecond: true, timeFormat: 'hh:mm:ss'";
if (ereg("date", $field["field"]) || ereg("_at", $field["field"]) || ereg("publish", $field["field"])) {
$dateFormat = "changeYear: true,changeMonth: true,defaultDate: null,dateFormat: '@', showOn: 'both', buttonImage: '".PATH_RELATIVE."framework/core/subsystems/forms/controls/assets/calendar/calbtn.gif', buttonImageOnly: true,beforeShow: function(input,inst){jQuery('#fields-" . js_escape($field['field']) . "c').val(parseInt(jQuery('#fields-" . js_escape($field['field']) . "').val()) * 1000);},onClose: function() {jQuery('#fields-" . js_escape($field['field']) . "').val(parseInt(jQuery('#fields-" . js_escape($field['field']) . "c').val()) / 1000);}";
$timeFormat = "showSecond: true,timeFormat: 'hh:mm:ss',showOn: 'both',buttonImage: '".PATH_RELATIVE."framework/core/subsystems/forms/controls/assets/calendar/calbtn.gif', buttonImageOnly: true,beforeShow: function(input,inst){jQuery('#fields-" . js_escape($field['field']) . "c').val(parseInt(jQuery('#fields-" . js_escape($field['field']) . "').val()));},onClose: function() {jQuery('#fields-" . js_escape($field['field']) . "').val(parseInt(jQuery('#fields-" . js_escape($field['field']) . "c').val()) );}";
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . (+$field["length"] ? " maxlength='" . (+$field["length"]) . "'" : "") . $attrs. ">".
"<script type='text/javascript'>jQuery('#fields-" . js_escape($field["field"]) . "')."
. ($field["type"] == "time" ? "timepicker({ $timeFormat })"
: (ereg("time", $field["type"]) ? "datetimepicker({ $dateFormat, $timeFormat })"
: "datepicker({ $dateFormat })"
)) . ";</script>";
"<input type=hidden id='fields-" . h($field["field"]) . "c' value='" . h($value) . "'" . (+$field["length"] ? " maxlength='" . (+$field["length"]) . "'" : "") . $attrs. ">".
"<script type='text/javascript'>jQuery('#fields-" . js_escape($field["field"]) . "c')."
. ((ereg("eventstart", $field["field"]) || ereg("eventend", $field["field"])) ? "timepicker({ $timeFormat })"
: (ereg("time", $field["type"]) ? "datetimepicker({ $dateFormat, $timeFormat })"
: "datepicker({ $dateFormat })"
)) . ";</script>";
}
}

Expand Down
6 changes: 3 additions & 3 deletions framework/modules/events/controllers/eventController.php
Expand Up @@ -416,7 +416,7 @@ function showall() {
$extitem = array();
foreach ($extitems as $key => $days) {
foreach ($days as $key => $event) {
if ($viewrange == 'upcoming' && $event->eventdate->date < time()) break;
if (empty($event->eventdate->date) || ($viewrange == 'upcoming' && $event->eventdate->date < time())) break;
if (empty($event->eventstart)) $event->eventstart = $event->eventdate->date;
$extitem[] = $event;
}
Expand Down Expand Up @@ -1019,6 +1019,7 @@ function getExternalEvents($loc, $startdate, $enddate) {
$url++;
if (!empty($startdate)) $begin = date("Y-m-d\Th:i:sP", expDateTime::startOfDayTimestamp($startdate));
if (!empty($enddate)) $end = date("Y-m-d\Th:i:sP", expDateTime::endOfDayTimestamp($enddate));
else $end = date("Y-m-d\Th:i:sP", (expDateTime::endOfDayTimestamp($startdate + ((3600*24)*30))));

if (substr($extgcalurl, -5) == 'basic') {
$extgcalurl = substr($extgcalurl, 0, strlen($extgcalurl) - 5) . 'full';
Expand Down Expand Up @@ -1062,7 +1063,6 @@ function getExternalEvents($loc, $startdate, $enddate) {
foreach ($entries as $item) {
$times = $item->getElementsByTagName("when");
$dtstart = $times->item(0)->getAttributeNode("startTime")->value;
// //FIXME must convert $dtstart & $dtend timezone
$eventdate = expDateTime::startOfDayTimestamp(strtotime($dtstart));
$extevents[$eventdate][$dy] = new stdClass();
$extevents[$eventdate][$dy]->eventdate = $eventdate;
Expand Down Expand Up @@ -1090,6 +1090,7 @@ function getExternalEvents($loc, $startdate, $enddate) {
$extevents[$eventdate][$dy]->color = !empty($this->config['pull_gcal_color'][$key]) ? $this->config['pull_gcal_color'][$key] : null;
$dy++;
}
$tmp=1;
}
if (!empty($this->config['pull_ical'])) foreach ($this->config['pull_ical'] as $key=>$exticalurl) {
$url++;
Expand Down Expand Up @@ -1118,7 +1119,6 @@ function getExternalEvents($loc, $startdate, $enddate) {
$eventArray = $v->selectComponents($startYear, $startMonth, $startDay, $endYear, $endMonth, $endDay, 'vevent');
$tzarray = getTimezonesAsDateArrays($v);
$url = 0;
$dy = 0;
if (!empty($eventArray)) foreach ($eventArray as $year => $yearArray) {
if (!empty($yearArray)) foreach ($yearArray as $month => $monthArray) {
if (!empty($monthArray)) foreach ($monthArray as $day => $dailyEventsArray) {
Expand Down
4 changes: 3 additions & 1 deletion install/changes/2.1.0.txt
Expand Up @@ -2,14 +2,16 @@ version 2.1.0
This release focuses on new calendar & forms modules, e-Commerce as OOTB experience, integration of jQuery/Twitter Bootstrap
- adds optional nested comments, and optional per-item comment disabling
- adds optional comments to filedownload module items
- adds optional external file url for file download item
* removes extra themes to reduce size of package, available as separate addon downloads
- adds better version change information to initial upgrade page
- adds optional color/style to categories
- upgrades calendar to a 2.0 event controller with categories & tags
*- converts existing calendars
*- optionally upgrades and converts existing calendars
-- adds color-coded categories and tags
-- add color-coded aggregation of external Google & iCal calendars, and online event registrations
- adds new 'mega-menu' navigation view with new free-form page/menu type for embedding modules
- adds random sorting/sequence to photo album/slideshows
- adds optional user selects email destination on form submission
- adds new built-in database manager
- plus many, many other tweaks, fixes, and features

0 comments on commit 6de918a

Please sign in to comment.