本文整理汇总了PHP中FabrikWorker::getMultiLangURLCode方法的典型用法代码示例。如果您正苦于以下问题:PHP FabrikWorker::getMultiLangURLCode方法的具体用法?PHP FabrikWorker::getMultiLangURLCode怎么用?PHP FabrikWorker::getMultiLangURLCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FabrikWorker
的用法示例。
在下文中一共展示了FabrikWorker::getMultiLangURLCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterJS
/**
* If used as a filter add in some JS code to watch observed filter element's changes
* when it changes update the contents of this elements dd filter's options
*
* @param bool $normal is the filter a normal (true) or advanced filter
* @param string $container container
*
* @return void
*/
public function filterJS($normal, $container)
{
$element = $this->getElement();
$observerId = $this->getWatchId();
$observerId .= 'value';
$formModel = $this->getFormModel();
$formId = $formModel->get('id');
// 3.1 Cdd filter set up elsewhere
if ($element->filter_type == 'dropdown') {
$params = $this->getParams();
$default = $this->getDefaultFilterVal($normal);
if ($default === '') {
$default = $params->get('cascadingdropdown_noselectionvalue', '');
}
$filterId = $this->getHTMLId() . 'value';
FabrikHelperHTML::script('plugins/fabrik_element/cascadingdropdown/filter.js');
$opts = new stdClass();
$opts->formid = $formId;
$opts->filterid = $filterId;
$opts->elid = $this->getId();
$opts->def = $default;
$opts->advanced = $this->getAdvancedSelectClass();
$opts->noselectionvalue = $params->get('cascadingdropdown_noselectionvalue', '');
$opts->filterobj = 'Fabrik.filter_' . $container;
$opts->lang = FabrikWorker::getMultiLangURLCode();
$opts = json_encode($opts);
return "Fabrik.filter_{$container}.addFilter('{$element->plugin}', new CascadeFilter('{$observerId}', {$opts}));\n";
}
}
示例2: globalReplacements
/**
* Get an associative array of replacements strings and values
*
* @return array
* @throws Exception
*/
public static function globalReplacements()
{
$app = JFactory::getApplication();
$itemId = self::itemId();
$config = JFactory::getConfig();
$session = JFactory::getSession();
$token = $session->get('session.token');
$lang = JFactory::getLanguage()->getTag();
$lang = str_replace('-', '_', $lang);
$shortlang = explode('_', $lang);
$shortlang = $shortlang[0];
$multilang = FabrikWorker::getMultiLangURLCode();
$replacements = array('{$jConfig_live_site}' => COM_FABRIK_LIVESITE, '{$jConfig_offset}' => $config->get('offset'), '{$Itemid}' => $itemId, '{$jConfig_sitename}' => $config->get('sitename'), '{$jConfig_mailfrom}' => $config->get('mailfrom'), '{where_i_came_from}' => $app->input->server->get('HTTP_REFERER', '', 'string'), '{date}' => date('Ymd'), '{mysql_date}' => date('Y-m-d H:i:s'), '{lang}' => $lang, '{multilang}' => $multilang, '{shortlang}' => $shortlang, '{session.token}' => $token);
foreach ($_SERVER as $key => $val) {
if (!is_object($val) && !is_array($val)) {
$replacements['{$_SERVER->' . $key . '}'] = $val;
$replacements['{$_SERVER->' . $key . '}'] = $val;
}
}
return $replacements;
}
示例3: jsOpts
/**
* Load the JavaScript ini options
*
* @since 3.1b
*
* @return stdClass
*/
protected function jsOpts()
{
$input = $this->app->input;
/** @var FabrikFEModelForm $model */
$model = $this->getModel();
$fbConfig = JComponentHelper::getParams('com_fabrik');
$form = $model->getForm();
$params = $model->getParams();
$listModel = $model->getlistModel();
$table = $listModel->getTable();
$opts = new stdClass();
$opts->admin = $this->app->isAdmin();
$opts->ajax = $model->isAjax();
$opts->ajaxValidation = (bool) $params->get('ajax_validations');
$opts->lang = FabrikWorker::getMultiLangURLCode();
$opts->toggleSubmit = (bool) $params->get('ajax_validations_toggle_submit');
$opts->showLoader = (bool) $params->get('show_loader_on_submit', '0');
$key = FabrikString::safeColNameToArrayKey($table->db_primary_key);
$opts->primaryKey = $key;
$opts->error = @$form->origerror;
$opts->pages = $model->getPages();
$opts->plugins = array();
$opts->multipage_save = (int) $model->saveMultiPage();
$opts->editable = $model->isEditable();
$opts->print = (bool) $input->getInt('print');
$startPage = isset($model->sessionModel->last_page) ? (int) $model->sessionModel->last_page : 0;
if ($startPage !== 0) {
$this->app->enqueueMessage(FText::_('COM_FABRIK_RESTARTING_MULTIPAGE_FORM'));
} else {
// Form submitted but fails validation - needs to go to the last page
$startPage = $input->getInt('currentPage', 0);
}
$opts->start_page = $startPage;
$opts->inlineMessage = (bool) $this->isMambot;
// $$$rob don't int this as keys may be string
$opts->rowid = (string) $model->getRowId();
// 3.0 needed for ajax requests
$opts->listid = (int) $this->get('ListModel')->getId();
$errorIcon = FabrikWorker::j3() ? $fbConfig->get('error_icon', 'exclamation-sign') . '.png' : 'alert.png';
$this->errorIcon = FabrikHelperHTML::image($errorIcon, 'form', $this->tmpl);
$imgs = new stdClass();
$imgs->alert = FabrikHelperHTML::image($errorIcon, 'form', $this->tmpl, '', true);
$imgs->action_check = FabrikHelperHTML::image('action_check.png', 'form', $this->tmpl, '', true);
//$imgs->ajax_loader = FabrikHelperHTML::image('ajax-loader.gif', 'form', $this->tmpl, '', false);
$imgs->ajax_loader = FabrikHelperHTML::icon('icon-spinner icon-spin');
$opts->images = $imgs;
// $$$rob if you are loading a list in a window from a form db join select record option
// then we want to know the id of the window so we can set its showSpinner() method
// 3.0 changed to fabrik_window_id (automatically appended by Fabrik.Window xhr request to load window data
$opts->fabrik_window_id = $input->get('fabrik_window_id', '');
$opts->submitOnEnter = (bool) $params->get('submit_on_enter', false);
// For editing groups with joined data and an empty joined record (i.e. no joined records)
$hidden = array();
$maxRepeat = array();
$minRepeat = array();
$showMaxRepeats = array();
$minMaxErrMsg = array();
foreach ($this->groups as $g) {
$hidden[$g->id] = $g->startHidden;
$maxRepeat[$g->id] = $g->maxRepeat;
$minRepeat[$g->id] = $g->minRepeat;
$showMaxRepeats[$g->id] = $g->showMaxRepeats;
$minMaxErrMsg[$g->id] = $g->minMaxErrMsg;
}
$opts->hiddenGroup = $hidden;
$opts->maxRepeat = $maxRepeat;
$opts->minRepeat = $minRepeat;
$opts->showMaxRepeats = $showMaxRepeats;
$opts->minMaxErrMsg = $minMaxErrMsg;
// $$$ hugh adding these so calc element can easily find joined and repeated join groups
// when it needs to add observe events ... don't ask ... LOL!
$opts->join_group_ids = array();
$opts->group_repeats = array();
$opts->group_joins_ids = array();
$groups = $model->getGroupsHiarachy();
foreach ($groups as $groupModel) {
if ($groupModel->getGroup()->is_join) {
$joinParams = $groupModel->getJoinModel()->getJoin()->params;
if (!(is_a($joinParams, 'Registry') || is_a($joinParams, 'JRegistry'))) {
$joinParams = new Registry($joinParams);
}
$groupId = $groupModel->getGroup()->id;
$opts->group_pk_ids[$groupId] = FabrikString::safeColNameToArrayKey($joinParams->get('pk'));
$opts->join_group_ids[$groupModel->getGroup()->join_id] = (int) $groupModel->getGroup()->id;
$opts->group_join_ids[$groupId] = (int) $groupModel->getGroup()->join_id;
$opts->group_repeats[$groupId] = $groupModel->canRepeat();
$opts->group_copy_element_values[$groupId] = $groupModel->canCopyElementValues();
$opts->group_repeat_intro[$groupId] = $groupModel->getParams()->get('repeat_intro', '');
}
}
return $opts;
}