本文整理汇总了PHP中FabrikWorker::getShortLang方法的典型用法代码示例。如果您正苦于以下问题:PHP FabrikWorker::getShortLang方法的具体用法?PHP FabrikWorker::getShortLang怎么用?PHP FabrikWorker::getShortLang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FabrikWorker
的用法示例。
在下文中一共展示了FabrikWorker::getShortLang方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jsOptions
/**
* Get Js Options
*
* @return stdClass
* @throws Exception
*/
private function jsOptions()
{
$model = $this->getModel();
$app = JFactory::getApplication();
$package = $app->getUserState('com_fabrik.package', 'fabrik');
$params = $model->getParams();
$Itemid = FabrikWorker::itemId();
$urls = new stdClass();
$calendar = $this->row;
$j3 = FabrikWorker::j3();
$tpl = $params->get('fullcalendar_layout', $j3);
// Get all list where statements - which are then included in the ajax call to ensure we get the correct data set loaded
$urlFilters = new stdClass();
$urlFilters->where = $model->buildQueryWhere();
// Don't JRoute as its wont load with sef?
$urls->del = 'index.php?option=com_' . $package . '&controller=visualization.fullcalendar&view=visualization&task=deleteEvent&format=raw&Itemid=' . $Itemid . '&id=' . $model->getId();
$urls->add = 'index.php?option=com_' . $package . '&view=visualization&format=raw&Itemid=' . $Itemid . '&id=' . $model->getId();
$options = new stdClass();
$options->url = $urls;
$options->dateLimits = $model->getDateLimits();
$options->deleteables = $model->getDeleteAccess();
$options->eventLists = $model->getEventLists();
$options->calendarId = $calendar->id;
$options->popwiny = $params->get('yoffset', 0);
$options->urlfilters = $urlFilters;
$options->canAdd = $this->canAdd;
$options->showFullDetails = (bool) $params->get('show_full_details', false);
$options->restFilterStart = FabrikWorker::getMenuOrRequestVar('resetfilters', 0, false, 'request');
$options->tmpl = $tpl;
// $$$rob @TODO not sure this is need - it isn't in the timeline viz
$model->setRequestFilters();
$options->filters = $model->filters;
// End not sure
$options->Itemid = $Itemid;
$options->show_day = (bool) $params->get('show_day', true);
$options->show_week = (bool) $params->get('show_week', true);
$options->default_view = $params->get('fullcalendar_default_view', 'month');
$options->add_type = $params->get('add_type', 'both');
$options->time_format = $params->get('time_format', 'H(:mm)');
$options->first_week_day = (int) $params->get('first_week_day', 0);
$options->minDuration = $params->get('minimum_duration', "00:30:00");
$options->open = $params->get('open-hour', "00:00:00");
$options->close = $params->get('close-hour', "23:59:59");
$options->lang = FabrikWorker::getShortLang();
$options->showweekends = (bool) $params->get('show-weekends', true);
$options->greyscaledweekend = (bool) $params->get('greyscaled-weekend', false);
$options->readonly = (bool) $params->get('calendar-read-only', false);
$options->timeFormat = $params->get('time_format', '%X');
$options->readonlyMonth = (bool) $params->get('readonly_monthview', false);
$options->j3 = FabrikWorker::j3();
$options->calOptions = $params->get('calOptions', '{}');
$options->startOffset = (int) $params->get('startdate_hour_offset', '0');
return $options;
}
示例2: iniJs
/**
* Initialize the js
*
* @return void
*/
private function iniJs()
{
$model = $this->getModel();
$ref = $model->getJSRenderContext();
$json = json_encode($this->jsOptions());
$js = array();
$js[] = "\tvar {$ref} = new fabrikFullcalendar('{$ref}', {$json});";
$js[] = "\tFabrik.addBlock('" . $ref . "', {$ref});";
$js[] = "" . $model->getFilterJs();
$js = implode("\n", $js);
$mediaFolder = FabrikHelperHTML::getMediaFolder();
$srcs = FabrikHelperHTML::framework();
$srcs['FbListFilter'] = $mediaFolder . '/listfilter.js';
$srcs['fabrikFullcalendar'] = 'plugins/fabrik_visualization/fullcalendar/fullcalendar.js';
$shim = $model->getShim();
$paths = array('fullcalendar' => 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/fullcalendar.min');
$shim['fullcalendar'] = (object) array('deps' => array('lib/moment/moment'));
$shim['viz/fullcalendar/fullcalendar'] = (object) array('deps' => array('fullcalendar', 'jquery'));
$fcLangFolder = 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/lang/';
// Figure out what language we are using
$lang = strtolower(JFactory::getUser()->getParam('language', JFactory::getLanguage()->getTag()));
if (file_exists(JPATH_BASE . '/' . $fcLangFolder . $lang . '.js') === false) {
$lang = FabrikWorker::getShortLang();
if (file_exists(JPATH_BASE . '/' . $fcLangFolder . $lang . '.js') === false) {
$lang = '';
}
}
if ($lang != '' && $lang != 'en-gb') {
$shim['lang'] = (object) array('deps' => array('lib/moment/moment', 'fullcalendar'));
$shim['viz/fullcalendar/fullcalendar']->deps[] = 'lang';
$paths['lang'] = 'plugins/fabrik_visualization/fullcalendar/libs/fullcalendar/lang/' . $lang;
}
FabrikHelperHTML::iniRequireJs($shim, $paths);
FabrikHelperHTML::script($srcs, $js);
}