function ds_createTrayIconPopUpMenu() { if (!isset(self::$wb_controls[IndexWindow])) { self::$wb_controls[IndexWindow] = array(); } self::$wb_controls[IndexWindow][IndexPopUpTray] = false; self::$wb_controls[IndexWindow][IndexPopUpTray] = new TPopupMenu(); $popup =& self::$wb_controls[IndexWindow][IndexPopUpTray]; if (isset(self::$wb_windows[FloatWindow])) { $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('Показать окно [1xЛКМ]'); $menu->onClick = function () { dsSpy::showWindow(FloatWindow); }; $popup->addItem($menu); } $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI((self::$Pause ? 'Снять с паузы' : 'Пауза') . ' [2xЛКМ]'); $menu->onClick = function () { dsSpy::switchPause(); }; $menu->picture->transparent = false; $menu->picture->loadFromFile(DOC_ROOT . '/files/images/' . (self::$Pause ? 'iconpause0.ico' : 'iconpause1.ico'), 'ico'); $popup->addItem($menu); // разделитель $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('-'); $popup->addItem($menu); $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('Открыть ' . self::$Host . ' [СКМ]'); $menu->onClick = function () { dsSpy::RunURL('http://' . dsSpy::$Host); }; $menu->picture->transparent = false; $menu->picture->loadFromFile(DOC_ROOT . '/files/images/community_fav.ico', 'ico'); $popup->addItem($menu); $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('Открыть develnet.ru'); $menu->onClick = function () { dsSpy::RunURL('http://develnet.ru'); }; $menu->picture->transparent = false; $menu->picture->loadFromFile(DOC_ROOT . '/files/images/develnet_fav.ico', 'ico'); $popup->addItem($menu); $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('Открыть DS Wiki (ds-wiki.ru)'); $menu->onClick = function () { dsSpy::RunURL('http://ds-wiki.ru'); }; $popup->addItem($menu); $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('Перейти на страницу DS в VK'); $menu->onClick = function () { dsSpy::RunURL('http://vk.com/develstudioru'); }; $menu->picture->transparent = false; $menu->picture->loadFromFile(DOC_ROOT . '/files/images/vk_fav.ico', 'ico'); $popup->addItem($menu); // разделитель $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('-'); $popup->addItem($menu); $menu = new TMenuItem(); $act = !self::getAutoRun(); $menu->caption = self::encoding_toGUI($act ? 'Поставить в автозагрузку' : 'Убрать из автозагрузки'); $menu->onClick = function () use(&$act) { dsSpy::setAutoRun($act); }; $popup->addItem($menu); unset($act); $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI(self::$Options['downloadImages'] ? 'Запретить загрузку картинок' : 'Разрешить загрузку картинок'); $menu->onClick = function () { dsSpy::$Options['downloadImages'] = !dsSpy::$Options['downloadImages']; }; $popup->addItem($menu); // разделитель $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('-'); $popup->addItem($menu); $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('Закрыть dsSpy'); $menu->onClick = function () { app::close(); }; $popup->addItem($menu); $menu = new TMenuItem(); $menu->caption = self::encoding_toGUI('Отмена'); $popup->addItem($menu); WinAPI_USER::GetCursorPos($mx, $my); $popup->popup(max(0, $mx - 150), $my + 2); }
<?php app::close();
function update($restart = false, $backup = "back_00_00", $temp = "temp_00_00") { $eh = set_error_handler(array(new $this(), 'TUDSAEH')); $result = $this->updateFn($backup, $temp); if ($result != 1) { set_error_handler($eh); return $result; } set_error_handler($eh); global $_PARAMS, $APPLICATION; $exec = false; if (trim($this->arr->exec) != "") { $exec = trim($this->arr->exec); $this->arr->exec = basename($_PARAMS[0]); } $this->arr->asXML("update.xml"); if (is_dir($backup)) { $this->removeDirectory($backup); } if (is_dir($temp)) { $this->removeDirectory($temp); } if ($restart) { $exec === FALSE ? Shell_Execute(0, "open", $_PARAMS[0], nil, nil, SW_RESTORE) : Shell_Execute(0, "open", dirname($_PARAMS[0]) . "\\" . $exec, nil, nil, SW_RESTORE); app::close(); $APPLICATION->terminate(); } return true; }