/** * @param stdClass $sitemap * @param array $items * @param array $extensions */ public function __construct(stdClass $sitemap, array &$items, array &$extensions) { parent::__construct($sitemap, $items, $extensions); $languageTag = JFactory::getLanguage()->getTag(); $this->base = JUri::getInstance()->toString(array('scheme', 'user', 'pass', 'host', 'port')); if (in_array($languageTag, array('zh-cn', 'zh-tw'))) { $this->defaultLanguage = $languageTag; } else { $this->defaultLanguage = XmapHelper::getLanguageCode(); } }
url: '<?php echo JUri::root(); ?> index.php', dataType: 'json', type: 'POST', data: { option: 'com_xmap', format: 'json', task: 'sitemap.editElement', action: 'toggleElement', id: $this.data('id'), uid: $this.data('uid'), itemid: $this.data('itemid'), lang: '<?php echo XmapHelper::getLanguageCode(); ?> ', '<?php echo JSession::getFormToken(); ?> ': 1 }, success: function (response) { $this.removeClass('icon-remove-sign icon-ok-sign'); $this.attr('title', response.message).tooltip('fixTitle').tooltip('show'); if (response.success) { $this.addClass(response.data.state ? 'icon-ok-sign' : 'icon-remove-sign'); } else { $this.addClass('icon-circle-question-mark');