Please uninstall module before replacing file.
Code: Select all
<?php
/**
*
* ULTIMATE Seo Urls (version 3.0.5)
*
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU Public License
* Copyright 2021 JMC
* Portions Copyright 2008-2009 FWR Media, 2005 Bobby Easland
* @Id path_rewrite.php
*/
class ht_hreflang extends abstract_executable_module {
const CONFIG_KEY_BASE = 'MODULE_HEADER_TAGS_HREFLANG_USU_';
public function __construct() {
parent::__construct(__FILE__);
}
function execute() {
global $oscTemplate, $lng;
$alternate ="";
if (USU_ENABLED == 'True') {
hreflang::i()->initiate($_SESSION['navigation']->path);
$pages_array = array();
foreach (hreflang::i()->lang_array() as $lang_array) {
$alternate .= '<link rel="alternate" hreflang="' . $lang_array['code'] . '" href="' . $lang_array['href'] . '" />' . PHP_EOL;
if ($lang_array['code'] == DEFAULT_LANGUAGE) {
$alternate .= '<link rel="alternate" hreflang="x-default" href="' . $lang_array['href'] . '" />' . PHP_EOL;
}
}
// echo $this->group;
$oscTemplate->addBlock($alternate, $this->group);
}
}
protected function get_parameters() {
return [
$this->config_key_base . 'STATUS' => [
'title' => 'Enable Robot hreflang Module',
'value' => 'True',
'desc' => 'Do you want to add the module to your shop?',
'set_func' => "tep_cfg_select_option(['True', 'False'], ",
],
$this->config_key_base . 'SORT_ORDER' => [
'title' => 'Sort Order',
'value' => '110',
'desc' => 'Sort order of display. Lowest is displayed first.',
],
];
}
}