-
-
Save JimMackin/2790722aa17a6bd20813 to your computer and use it in GitHub Desktop.
View on cal logic hook implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ViewOnCalHook{ | |
function addButton($focus, $event, $args){ | |
global $timedate; | |
$date = $timedate->fromUser($focus->date_start); | |
$year = $date->format('Y'); | |
$month = $date->format('m'); | |
$day = $date->format('d'); | |
$loc = "index.php?action=index&module=Calendar&view=week&&year={$year}&month={$month}&day={$day}&hour=0"; | |
$focus->view_on_cal_button = "<button onclick='document.location = \"{$loc}\"' type='button'>View on calendar</button>"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment