$newfolder = new mess_folders(); $newfolder->fname = $name; $newfolder->from_id = get_uid(); if ($error = $newfolder->Add($error)) { $error_flag = 1; } } if (!$error) { header("Location: " . $_SERVER["REQUEST_URI"]); exit; } break; case "delfolder": require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/mess_folders.php"; $id = intval($_GET['id']); $newfolder = new mess_folders(); $newfolder->from_id = get_uid(); $newfolder->id = $id; $newfolder->Del(); break; default: if ($_SERVER["REQUEST_METHOD"] == 'POST' && empty($_POST)) { $alert[1] = 'Вы превысили максимально допустимый размер файлов'; } break; } $css_file = array('contacts.css', '/css/nav.css', '/css/block/b-search/b-search.css', '/css/block/b-captcha/b-captcha.css'); $js_file = array('note.js'); if ($chat_with) { if ($chat_with != $_SESSION['login']) { $inner = "dialog.php";
function RnFolder($form_values) { session_start(); $fuid = get_uid(false); $objResponse = new xajaxResponse(); $bError = false; $fld = new mess_folders(); $msgs = new messages(); $contacts = $msgs->GetContacts($fuid); $users_folders = $msgs->GetUsersInFolders($fuid); if (!isset($form_values['id'])) { $objResponse->alert("Не выбрана папка."); $bError = true; } else { $folder_id = intval($form_values['id']); $cur_folder = intval($form_values['cur_folder']); $cont = intval($form_values['cont']); $logins = addslashes($form_values['logins']); $arr_logins = split('~', $logins); if ($folder_id <= 0) { $objResponse->alert("Не выбрана папка."); } else { if (!isset($form_values['new_name'])) { $objResponse->alert("Не указано новое имя папки."); } else { // $folder_name = addslashes($form_values['new_name']); $folder_name = substr(change_q($form_values['new_name'], false, 64), 0, 64); $request_folder_name = substr(change_q(stripslashes($form_values['new_name']), false, 64), 0, 64); $srch = array("<", ">"); $folder_name = trim(str_replace($srch, "", $folder_name)); if (empty($folder_name) || $folder_name == '') { $objResponse->alert("Не указано новое имя папки."); $objResponse->assign("savebtn", "disabled", false); } else { $fld->fname = $folder_name; $fld->id = $folder_id; $fld->from_id = get_uid(false); if (!($ermsg = $fld->Rename($folder_id))) { $GLOBALS['xajax']->setCharEncoding("windows-1251"); $objResponse->script("old_name='" . $folder_name . "';"); if ($cur_folder == $folder_id) { $folder_html = "<img class=\"li\" src=\"/images/ico_dir.gif\" />" . reformat($request_folder_name, 15, 0, 1); $folder_header = 'Сообщения / ' . reformat($folder_name, 15, 0, 1); $objResponse->assign("cht", "innerHTML", $folder_header); } else { $folder_html = "<a href=\"/contacts/?folder=" . $folder_id . "\"><span style=\"float:left;\"><img class=\"li\" src=\"/images/ico_dir.gif\" /></a></span><a href=\"/contacts/?folder=" . $folder_id . "\" class=\"blue\">" . reformat($request_folder_name, 15, 0, 1) . "</a>"; } foreach ($arr_logins as $login) { $objResponse->assign("folder" . $folder_id . "u" . $login, "innerHTML", reformat($folder_name, 25, 0, 1)); $objResponse->assign("vfolder" . $folder_id . "u" . $login, "innerHTML", reformat($folder_name, 25, 0, 1)); } $folder_html .= " (<span id=\"fldcount" . $folder_id . "\">" . $cont . "</span>)"; $folder_html .= "<div style=\"margin-top: 17px; text-align:right\"><a href=\"/contacts/?action=delfolder&id=" . $folder_id . "\" onClick=\"return warning(9)\" title=\"Удалится только папка. Контакты переместятся в папку «Все».\">Удалить</a> | <a href='javascript:rename(\"" . $folder_id . "\",\"" . $cur_folder . "\",\"" . str_replace("\\", "\\\\", htmlspecialchars($request_folder_name)) . "\",\"" . $cont . "\",\"" . $logins . "\");'>Переименовать</a></div>"; $objResponse->assign("li_folder" . $folder_id, "innerHTML", $folder_html); } else { $objResponse->alert($ermsg); $objResponse->assign("savebtn", "disabled", false); } } } } } return $objResponse; }
/** * Возвращает папки пользователя в личных сообщениях. * * @see mess_folders::GetAll() * * @return array */ protected function x____getMessFolders() { require_once ABS_PATH . '/classes/mess_folders.php'; $mf = new mess_folders(); $mf->from_id = $this->_sess->_uid; $result = null; if ($flds = $mf->GetAll()) { foreach ($flds as $key => $f) { $result[$key] = $this->pg2exRow($this->_mCfg['fields'], $f); } } return $result; }
e.addClass('b-layout_hide'); } } function mouseout(num) { setTimeout("hide_fpopup('"+num+"')", 500); } //--> </script> <?php if ($inner) { include $inner; } else { require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/mess_folders.php"; $cf = new mess_folders(); $cf->from_id = get_uid(); $folders = $cf->GetAll(); // Определяю название текущей папки. Лучше вынести в метод или функцию. if (!$pm_folder) { if ($cur_folder > 0) { foreach ($folders as $folder) { if ($folder['id'] == $cur_folder) { $cur_folder_name = $folder['fname']; } } } else { switch ($cur_folder) { case -1: $cur_folder_name = 'Избранные'; $sSuff = 'team/';