예제 #1
0
파일: JsCalendar.php 프로젝트: rjsmelo/tiki
 function renderInput($context = array())
 {
     global $prefs;
     if ($prefs['feature_jquery_ui'] !== 'y') {
         // fall back to simple date field
         return parent::renderInput($context);
     }
     $smarty = TikiLib::lib('smarty');
     $smarty->loadPlugin('smarty_function_jscalendar');
     $params = array('fieldname' => $this->getInsertId());
     $params['showtime'] = $this->getOption('datetime') === 'd' ? 'n' : 'y';
     if (empty($context['inForm'])) {
         $params['date'] = $this->getValue();
         if (empty($params['date'])) {
             $params['date'] = $this->getConfiguration('value');
         }
         if (empty($params['date']) && $this->getOption('useNow')) {
             $params['date'] = TikiLib::lib('tiki')->now;
         }
     } else {
         $params['date'] = '';
     }
     return smarty_function_jscalendar($params, $smarty);
 }