/*************************************************************************** * Dolphin Web Community Software * ------------------- * begin : Mon Mar 23 2006 * copyright : (C) 2007 BoonEx Group * website : http://www.boonex.com * * * ****************************************************************************/ /*************************************************************************** * * This is a free software; you can modify it under the terms of BoonEx * Product License Agreement published on BoonEx site at http://www.boonex.com/downloads/license.pdf * You may not however distribute it for free or/and a fee. * This notice may not be removed from the source code. You may not also remove any other visible * reference and links to BoonEx Group as provided in source code. * ***************************************************************************/ function ps_page_toggle(sPageName, iProfileId, iBlockId) { if($('body').find('div#dbPrivacyMenu' + iBlockId).length > 0){ $('body').find('div#dbPrivacyMenu' + iBlockId).dolPopup(); return; } $.post( site_url + 'member_privacy.php', { ps_action: 'get_chooser', ps_page_name: sPageName, ps_profile_id: iProfileId, ps_block_id: iBlockId }, function(oData) { if(parseInt(oData.code) == 0) { $('body').append($(oData.data).addClass('dbPrivacyMenu')); $('body').find('div#dbPrivacyMenu' + iBlockId).dolPopup(); } }, 'json' ); } function ps_page_select(oLink, iBlockId, iGroupId) { $.post( site_url + 'member_privacy.php', { ps_action: 'view_block', ps_block_id: iBlockId, ps_group_id: iGroupId }, function(oData) { if(parseInt(oData.code) == 0) { $(oLink).parents('.dbPrivacyMenu').dolPopupHide().find('.dbPrivacyGroupActive').removeClass('dbPrivacyGroupActive').addClass('dbPrivacyGroup'); $(oLink).removeClass('dbPrivacyGroup').addClass('dbPrivacyGroupActive'); $('#dbPrivacy' + iBlockId + ' a:first').attr('title', oData.group); } }, 'json' ); } function ps_showDialog(sType, iGroupId, oLink) { var oDiv = $('#ps-' + sType + '-members'); $("#ps-" + sType + "-member-form :hidden[name='ps-" + sType + "-member-group']").val(iGroupId); oDiv.dolPopup(); if(sType == 'del') { $('#ps-' + sType + '-members-loading').bx_loading(); $.post( sPSSiteUrl + 'member_privacy.php', { ps_action: 'members', ps_value: iGroupId }, function(sData) { $('#ps-' + sType + '-members-loading').bx_loading(); oDiv.find('.ps-search-results').html(sData); }, 'html' ); } } function ps_ad_search() { var sSearchValue = $('#ps-search-member-form').find(':text:first').val(); if(sSearchValue) { $('#ps-add-members-loading').bx_loading(); $.post( sPSSiteUrl + 'member_privacy.php', { ps_action: 'search', ps_value: sSearchValue }, function(sData) { $('#ps-add-members-loading').bx_loading(); $('#ps-add-members .ps-search-results').html(sData); }, 'html' ); } } /** * Checks/unchecks all tables * * @param string the form name * @param boolean whether to check or to uncheck the element * * @return boolean always true */ function setCheckboxes(the_form, do_check) { var elts = document.forms[the_form].getElementsByTagName('input'); var elts_cnt = elts.length; for ( i = 0; i < elts_cnt; i++) { elts[i].checked = do_check; if ( elts[i].type == "submit" ) elts[i].disabled = !do_check; } } function UpdateSubmit(the_form) { var elts = document.forms[the_form].getElementsByTagName('input'); var elts_cnt = elts.length; var bChecked = false; for ( i = 0; i < elts_cnt; i++) { if (elts[i].type == "checkbox" && elts[i].checked == true) { bChecked = true; } if ( elts[i].type == "submit" ) { elts[i].disabled = true; } } for ( i = 0; i < elts_cnt; i++) { if ( elts[i].type == "submit" ) { if (bChecked == true) { elts[i].disabled = false; } else { elts[i].disabled = true; } } } } /** * Allow open window with extra params * * @param sWindowUrl string * @param sWindowId string * @param aVarNames array * @param aVarValues array * @param sWindowParams string * @param sMethod string * @return mixed */ function openWindowWithParams(sWindowUrl, sWindowId, aVarNames, aVarValues, sWindowParams, sMethod) { var newWindow = window.open(sWindowUrl, sWindowId, sWindowParams); if (!newWindow) return false; var html = ''; html += '