public function do_get_control_defs(&$plugin_cookies) { $defs = array(); $epg_provider = isset($plugin_cookies->epg_provider) ? $plugin_cookies->epg_provider : 'ZTVApi'; $use_proxy = isset($plugin_cookies->use_proxy) ? $plugin_cookies->use_proxy : 'no'; $proxy_ip = isset($plugin_cookies->proxy_ip) ? $plugin_cookies->proxy_ip : '192.168.0.1'; $proxy_port = isset($plugin_cookies->proxy_port) ? $plugin_cookies->proxy_port : '8080'; $this->add_label($defs, '%tr%caption_ztv', ZTVConfig::PLUGIN_VERSION); $this->add_button($defs, 'register_button', null, '%tr%caption_account', 400); $profiles = array(); if ($this->profiles && $this->profile) { $init_profile = $this->profile->id; foreach ($this->profiles as $profile) { $profiles[$profile->id] = $profile->title; } } else { $init_profile = 1; $profiles[$init_profile] = '0+'; } $this->add_combobox($defs, 'profile', '%tr%caption_profile', $init_profile, $profiles, 0, true); $show_ops = array('ZTVApi' => 'ZTV', 'SWRNApi' => 'SWRN'); $this->add_combobox($defs, 'epg_provider', '%tr%caption_epg_provider', $epg_provider, $show_ops, 0, true); $show_ops = array('yes' => '%tr%caption_yes', 'no' => '%tr%caption_no'); $this->add_combobox($defs, 'use_proxy', '%tr%caption_use_proxy', $use_proxy, $show_ops, 0, true); if ($use_proxy == 'yes') { $this->add_text_field($defs, 'proxy_ip', '%tr%caption_proxy_ip', $proxy_ip, false, false, false, true, 500, false, true); $this->add_text_field($defs, 'proxy_port', '%tr%caption_proxy_port', $proxy_port, true, false, false, true, null, false, true); } $this->add_vgap($defs, 30); $this->add_label($defs, '%tr%caption_daemon', ZTVDaemonController::status()->output); $this->add_button($defs, 'daemon_start', null, '%tr%caption_daemon_start', 400); $this->add_button($defs, 'daemon_restart', null, '%tr%caption_daemon_restart', 400); $this->add_button($defs, 'daemon_stop', null, '%tr%caption_daemon_stop', 400); return $defs; }
public function do_get_control_defs(&$plugin_cookies) { $defs = array(); $use_proxy = isset($plugin_cookies->use_proxy) ? $plugin_cookies->use_proxy : 'no'; $proxy_ip = isset($plugin_cookies->proxy_ip) ? $plugin_cookies->proxy_ip : '192.168.0.1'; $proxy_port = isset($plugin_cookies->proxy_port) ? $plugin_cookies->proxy_port : '8080'; $this->add_label($defs, 'ZTV:', ZTVConfig::PLUGIN_VERSION); $this->add_button($defs, 'register_button', null, 'Уч. запись', 400); $profiles = array(); if ($this->profiles && $this->profile) { $init_profile = $this->profile->id; foreach ($this->profiles as $profile) { $profiles[$profile->id] = $profile->title; } } else { $init_profile = 1; $profiles[$init_profile] = '0+'; } $this->add_combobox($defs, 'profile', 'Профиль:', $init_profile, $profiles, 0, true); $show_ops = array('yes' => 'Да', 'no' => 'Нет'); $this->add_combobox($defs, 'use_proxy', 'Использовать UDP-прокси:', $use_proxy, $show_ops, 0, true); if ($use_proxy == 'yes') { $this->add_text_field($defs, 'proxy_ip', 'Адрес:', $proxy_ip, false, false, false, true, 500, false, true); $this->add_text_field($defs, 'proxy_port', 'Порт:', $proxy_port, true, false, false, true, null, false, true); } $daemon_status = ZTVDaemonController::status(); $this->add_vgap($defs, 30); $this->add_label($defs, 'Сервис ARES:', $daemon_status['output']); $this->add_button($defs, 'daemon_start_button', null, 'Запуск', 400); $this->add_button($defs, 'daemon_restart_button', null, 'Перезапуск', 400); $this->add_button($defs, 'daemon_stop_button', null, 'Стоп', 400); return $defs; }