HEX
Server: Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 mod_fcgid/2.3.9 PHP/5.4.16
System: Linux dvm.vladweb.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: region-gk.ru (1016)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: /home/temp/yarusvl.ru/adminx/core/TranslationsAdmin.php
<?php

require_once('api/Mgc.php');

class TranslationsAdmin extends Mgc {
    
    public function fetch() {

        $locked_theme = is_file('tpls/'.$this->settings->theme.'/locked');
        $this->design->assign('locked_theme', $locked_theme);

        // Обработка действий
        if(!$locked_theme && $this->request->method('post')) {
            // Действия с выбранными
            $ids = $this->request->post('check');
            if(is_array($ids)) {
                switch($this->request->post('action')) {
                    case 'delete': {
                        /*Удалить перевод*/
                        foreach($ids as $id) {
                            $this->translations->delete_translation($id);
                        }
                        break;
                    }
                }
            }
        }
        $language = $this->languages->get_language($this->languages->lang_id());

        $filter = array();
        $filter['lang'] = $language->label;
        $filter['sort'] = $this->request->get('sort', 'string');
        if (empty($filter['sort'])) {
            $filter['sort'] = 'label';
        }
        $this->design->assign('sort', $filter['sort']);

        $translations = $this->translations->get_translations($filter);
        $this->design->assign('translations', $translations);
        return $this->design->fetch('translations.tpl');
    }
    
}