public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
<div class="dparts monthlyCalendarTable"><div class="parts">
<div class="partsHeading"><h3><?php 
$is_community ? printf('[%s] ', $community->name) : '';
echo format_number_choice('[0]%ym%|[1]%ym% of %f%', array('%ym%' => op_format_date(mktime(0, 0, 0, $ym['month_disp'], 1, $ym['year_disp']), 'XCalendarMonth'), '%f%' => $member->name), $is_community ? 1 : $isSelf ? 0 : 1);
?>
</h3></div>

<?php 
if (!$is_community && $isSelf && opConfig::get('op_calendar_google_data_api_is_active', false)) {
    ?>
<div class="block topBox">
<p class="note_schedule">
<?php 
    if (opGoogleCalendarOAuth::getInstance()->isNeedRedirection()) {
        ?>
&nbsp;<?php 
        echo link_to(__('Enable to Google Calendar\'s permission settings'), '@calendar_api');
    } else {
        ?>
&nbsp;<?php 
        echo link_to(__('Add schedule to Google Calendar'), '@calendar_api_import');
    }
    ?>
</p>
</div>
<?php 
}
?>
<div class="block topBox">
<?php 
if (!$is_community && $isSelf) {
 public function preExecute()
 {
     $this->forward404Unless(opConfig::get('op_calendar_google_data_api_is_active', false));
     $this->opGoogleCalendarOAuth = opGoogleCalendarOAuth::getInstance();
 }