<?php
class setting extends control
{
    /**
     * Download xxd.
     *
     * @param  string $type
     * @param  string $os
     * @access public
     * @return void
     */
    public function downloadXXD($type = '', $os = '')
    {
        if(in_array($type, array('config', 'package')))
        {
            $server = $this->loadModel('im')->getServer();
            if(strpos($server, '127.0.0.1') !== false) die(js::alert($this->lang->im->xxdServerError));

            $setting     = $this->config->xuanxuan;
            $setting->os = $os;
            $result      = $this->im->downloadXXD($setting, $type);

            return $this->send($result);
        }
        die("Params error.");
    }
}
