<?php defined('is_running') or die('Not an entry point...'); gpPlugin::Incl('Languages.php'); class MultiLang_Common { var $config_file; var $config; var $lists = array(); var $titles = array(); var $langs = array(); var $lang; var $language; function Init() { global $addonPathData, $config, $ml_languages; $this->config_file = $addonPathData . '/config.php'; $this->lang = $config['language']; $this->GetData(); } function GetData() { global $ml_languages; $config = array(); if (file_exists($this->config_file)) { require $this->config_file; } $config += array('titles' => array(), 'lists' => array(), 'langs' => array()); $this->config = $config; $this->FixConfig(); $this->lists = $this->config['lists'];
<?php defined('is_running') or die('Not an entry point...'); gpPlugin::Incl('Common.php'); class MultiLang_Admin extends MultiLang_Common { protected $cmds = array(); //executable commands public function __construct() { global $config; $config += array('menus' => array()); parent::__construct(); $this->AddResources(); $this->cmds['TitleSettingsSave'] = ''; $this->cmds['TitleSettings'] = ''; $this->cmds['RemoveTitle'] = 'TitleSettings'; $this->cmds['NotTranslated'] = ''; $this->cmds['SaveLanguages'] = 'SelectLanguages'; $this->cmds['SelectLanguages'] = ''; $this->cmds['PrimaryLanguage'] = ''; $this->cmds['PrimaryLanguageSave'] = 'DefaultDisplay'; $this->cmds['AllTitles'] = ''; $cmd = common::GetCommand(); $this->RunCommands($cmd); } /** * Run Commands * See \gp\Base::RunCommands() (available in TS 5.0) * */