protected function actionContent($params) { if (!isset($params['slug'])) { $params['slug'] = ''; } $content = \GO\Site\Model\Content::model()->findBySlug($params['slug']); if (!$content) { header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); echo $this->render('/site/404'); } else { $this->setPageTitle($content->metaTitle); if (!empty($content->meta_description)) { \Site::scripts()->registerMetaTag($content->meta_description, 'description'); } if (!empty($content->meta_keywords)) { \Site::scripts()->registerMetaTag($content->meta_keywords, 'keywords'); } // Check if the template is not empty if (empty($content->template)) { $defaultTemplate = \Site::config()->getDefaultTemplate(); if (!empty($defaultTemplate)) { $content->template = $defaultTemplate; } } echo $this->render($content->template, array('content' => $content)); } }
/** * Render an empty div where the uploader will eventualy be rendered after the javascript loads * @return type */ public function render() { \Site::scripts()->registerScript('plupload#' . $this->id, $this->createjs(), \GO\Site\Components\Scripts::POS_END); return '<div id="' . $this->id . '">Loading upload widget...</div>'; }
public function dateField($model, $attribute, $htmlAttributes = array(), $datePickerOptions = array()) { $this->_nDateFields++; $currentUser = \GO::user(); $dateFormatArr = array(); $goDateFormat = !empty($currentUser) ? $currentUser->date_format : \GO::config()->default_date_format; $goDateSeparator = !empty($currentUser) ? $currentUser->date_separator : \GO::config()->default_date_separator; for ($i = 0; $i < 3; $i++) { if ($goDateFormat[$i] == 'Y') { $dateFormatArr[] = 'yy'; } else { $dateFormatArr[] = $goDateFormat[$i] . $goDateFormat[$i]; } } $datePickerOptionsString = ''; $allowedWeekdaysArray = '[0,1,2,3,4,5,6]'; foreach ($datePickerOptions as $name => $value) { if ($name == 'allowedWeekDays') { $allowedWeekdaysArray = json_encode($value); } else { $datePickerOptionsString .= ',' . $name . ': ' . var_export($value, true) . ''; } } \Site::scripts()->registerGapiScript('jquery'); \Site::scripts()->registerGapiScript('jquery-ui'); \Site::scripts()->registerCssFile('http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css'); \Site::scripts()->registerScript('datepicker' . $this->_nDateFields, ' $(function() { $( "#datepicker' . $this->_nDateFields . '" ).datepicker({ dateFormat: "' . implode($goDateSeparator, $dateFormatArr) . '" ' . $datePickerOptionsString . ' // ,beforeShow:function(input) { // $(input).css({ // "position": "relative", // "z-index": 999999 // }); // } }); }); '); $htmlAttributes['id'] = 'datepicker' . $this->_nDateFields; return $this->_inputField('text', $model, $attribute, $htmlAttributes); }
echo '<div class="col-md-12">'; } ?> <?php function printContentRecursive($content, $level = 1) { echo '<h' . $level . ' id="' . $content->baseslug . '">' . $content->title . '</h' . $level . '>'; echo '<div>' . $content->getHtml() . '</div>'; // echo '<div class="top-link"><a title="Jump to the top of the page" href="#top"><span class="glyphicon glyphicon-chevron-up"></span></a></div>'; foreach ($content->children() as $child) { printContentRecursive($child, $level + 1); } } printContentRecursive($content); ?> </div> </div> <div id="top-link" data-spy="affix" data-offset-top="400"> <a title="Jump to the top of the page" href="#header"> <span class="glyphicon glyphicon-chevron-up"></span> </a> </div> <?php Site::scripts()->registerScript('scrollspy', "\$('body').scrollspy({ target: '.toc' });\$('body').scrollspy({ target: '#top-link' })");
<?php \Site::scripts()->registerCssFile(\Site::file('css/ticket.css')); ?> <div class="external-ticket-page ticket"> <div class="wrapper"> <?php if (\GO::user()) { ?> << <a id="back-to-overview-button" href="<?php echo \Site::urlManager()->createUrl('tickets/externalpage/ticketlist'); ?> "><?php echo \GO::t('ticketBackToList', 'defaultsite'); ?> </a> <?php } ?> <h2><?php echo \GO::t('ticket', 'defaultsite') . ' ' . $ticket->ticket_number; ?> </h2> <!-- <h3><?php echo \GO::t('ticketContactInfo', 'defaultsite'); ?> </h3>
/** * Render a view file with layout wrapped * * @param string $view name of the view to be rendered * @param array $data data tp be extracted om PHP variables * @param boolean $return return rendering result if true * @return string the redering result if $return is true */ public function render($view, $data = null) { $output = $this->renderPartial($view, $data); if (($layoutFile = $this->getLayoutFile($this->layout)) !== false) { $output = $this->renderFile($layoutFile, array('content' => $output), true); } \Site::scripts()->render($output); return $output; }