Файл: adultscript-2.0.3-pro/files/admin/modules/language/language.php
Строк: 72
<?php
defined('_VALID') or die('Restricted Access!');
class VModule_Admin_language
{
private $components = array(
'manage' => 1,
'install' => 1,
'uninstall' => 1,
'edit' => 1,
'clone' => 1,
'export' => 1,
'files' => 1,
'files_edit' => 1,
'files_install' => 1,
'files_unistall' => 1,
'files_clone' => 1
);
protected $db;
public function __construct()
{
$this->db = VF::factory('database');
}
public function render()
{
$component = (VUri::request(1)) ? VUri::request(1) : 'manage';
$subcomponent = (VUri::request(2)) ? VUri::request(2) : NULL;
if (isset($this->components[$component]) && $this->components[$component] === 1) {
if (isset($subcomponent) && $component == 'files') {
$component = 'files_'.$subcomponent;
}
$component_file = ADMIN_DIR.'/modules/language/components/'.$component.'.php';
$component_class = 'VComponent_Admin_language_'.$component;
try {
require $component_file;
$obj = new $component_class();
$obj->render();
} catch (Exception $e) {
throw new Exception($e);
}
} else {
throw new VException('Invalid admin language component specified!');
}
}
}