Changeset 15211 for trunk/administration
- Timestamp:
- 06/07/11 23:41:51 (12 months ago)
- Location:
- trunk/administration
- Files:
-
- 94 edited
-
admin_tools.php (modified) (1 diff)
-
advanced_settings.php (modified) (2 diffs)
-
antispam.php (modified) (27 diffs)
-
basic_settings.php (modified) (11 diffs)
-
cache.php (modified) (8 diffs)
-
categories.php (modified) (22 diffs)
-
css_file.php (modified) (6 diffs)
-
db.php (modified) (5 diffs)
-
email_templates.php (modified) (8 diffs)
-
fields.parse.php (modified) (1 diff)
-
fields.php (modified) (4 diffs)
-
flash.php (modified) (1 diff)
-
help.html (modified) (2 diffs)
-
host_tools.php (modified) (1 diff)
-
index.php (modified) (7 diffs)
-
ip_blacklist.php (modified) (2 diffs)
-
js/email_templates.js (modified) (2 diffs)
-
js/fields.js (modified) (10 diffs)
-
js/functions.admin.js (modified) (1 diff)
-
js/lang_file.js (modified) (5 diffs)
-
js/memb_levels.js (modified) (2 diffs)
-
js/menu_compose.js (modified) (5 diffs)
-
js/page_builder_tiny.js (modified) (2 diffs)
-
js/profiles.js (modified) (11 diffs)
-
lang_file.php (modified) (33 diffs)
-
login_form.html (modified) (1 diff)
-
manage_subscribers.php (modified) (3 diffs)
-
memb_levels.php (modified) (24 diffs)
-
member_menu_compose.php (modified) (18 diffs)
-
menu_compose_admin.php (modified) (11 diffs)
-
modules.php (modified) (2 diffs)
-
nav_menu_compose.php (modified) (10 diffs)
-
notifies.php (modified) (8 diffs)
-
notify_preview.php (modified) (1 diff)
-
pageBuilder.php (modified) (1 diff)
-
phpinfo.php (modified) (1 diff)
-
preValues.php (modified) (4 diffs)
-
profiles.php (modified) (24 diffs)
-
settings.php (modified) (3 diffs)
-
templates/base/_footer.html (modified) (1 diff)
-
templates/base/_header.html (modified) (2 diffs)
-
templates/base/_sub_header.html (modified) (2 diffs)
-
templates/base/antispam_dnsbl_recheck.html (modified) (2 diffs)
-
templates/base/antispam_manage_dnsbl.html (modified) (1 diff)
-
templates/base/boonex_promo.html (modified) (1 diff)
-
templates/base/categories.html (modified) (1 diff)
-
templates/base/css/activityTrac.css (modified) (1 diff)
-
templates/base/css/admin.css (modified) (7 diffs)
-
templates/base/css/anchor.css (modified) (1 diff)
-
templates/base/css/dashboard.css (modified) (3 diffs)
-
templates/base/css/fields.css (modified) (19 diffs)
-
templates/base/css/general.css (modified) (12 diffs)
-
templates/base/css/index.css (modified) (3 diffs)
-
templates/base/css/lang_file.css (modified) (5 diffs)
-
templates/base/css/login.css (modified) (6 diffs)
-
templates/base/css/memb_levels.css (modified) (2 diffs)
-
templates/base/css/menu_compose.css (modified) (11 diffs)
-
templates/base/css/modules.css (modified) (2 diffs)
-
templates/base/css/pageBuilder.css (modified) (9 diffs)
-
templates/base/css/predefined_values.css (modified) (1 diff)
-
templates/base/css/profiles.css (modified) (7 diffs)
-
templates/base/dashboard_content_info.html (modified) (2 diffs)
-
templates/base/default.html (modified) (1 diff)
-
templates/base/design_box_1.html (modified) (2 diffs)
-
templates/base/fields.html (modified) (1 diff)
-
templates/base/hosting_promo.html (modified) (1 diff)
-
templates/base/langs_form_create.html (modified) (1 diff)
-
templates/base/langs_form_import.html (modified) (1 diff)
-
templates/base/langs_key.html (modified) (3 diffs)
-
templates/base/login.html (modified) (2 diffs)
-
templates/base/main_menu.html (modified) (1 diff)
-
templates/base/manage_subscribers.html (modified) (2 diffs)
-
templates/base/menu_compose.html (modified) (1 diff)
-
templates/base/mlevels_action.html (modified) (3 diffs)
-
templates/base/mlevels_actions.html (modified) (1 diff)
-
templates/base/mlevels_list.html (modified) (1 diff)
-
templates/base/modules_results.html (modified) (1 diff)
-
templates/base/mp_controls.html (modified) (1 diff)
-
templates/base/mp_members.html (modified) (3 diffs)
-
templates/base/mp_members_extended.html (modified) (2 diffs)
-
templates/base/mp_members_geeky.html (modified) (2 diffs)
-
templates/base/notifies_filter.html (modified) (1 diff)
-
templates/base/page_10.html (modified) (1 diff)
-
templates/base/page_13.html (modified) (1 diff)
-
templates/base/page_3.html (modified) (2 diffs)
-
templates/base/page_4.html (modified) (1 diff)
-
templates/base/page_6.html (modified) (1 diff)
-
templates/base/page_7.html (modified) (2 diffs)
-
templates/base/page_8.html (modified) (1 diff)
-
templates/base/pbuilder_content.html (modified) (3 diffs)
-
templates/base/popup_form_wrapper.html (modified) (3 diffs)
-
templates/base/promo.html (modified) (1 diff)
-
templates/base/promo_images.html (modified) (1 diff)
-
templates/base/register.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/admin_tools.php
r15201 r15211 13 13 $oAdmTools = new BxDolAdminTools(); 14 14 function PageCompAdmTools($oAdmTools) { 15 $sRetHtml = $oAdmTools->GenCommonCode();15 $sRetHtml = $oAdmTools->GenCommonCode(); 16 16 17 switch (bx_get('action')) {18 case 'perm_table':19 $sRetHtml .= $oAdmTools->GenPermTable();20 break;21 case 'main_params':22 $sRetHtml .= $oAdmTools->GenMainParamsTable();23 break;24 case 'main_page':25 $sRetHtml .= $oAdmTools->GenTabbedPage();26 break;27 default:28 $sRetHtml .= $oAdmTools->GenTabbedPage();29 break;30 }17 switch (bx_get('action')) { 18 case 'perm_table': 19 $sRetHtml .= $oAdmTools->GenPermTable(); 20 break; 21 case 'main_params': 22 $sRetHtml .= $oAdmTools->GenMainParamsTable(); 23 break; 24 case 'main_page': 25 $sRetHtml .= $oAdmTools->GenTabbedPage(); 26 break; 27 default: 28 $sRetHtml .= $oAdmTools->GenTabbedPage(); 29 break; 30 } 31 31 32 return $sRetHtml;32 return $sRetHtml; 33 33 } 34 34 -
trunk/administration/advanced_settings.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 33 33 $logged['admin'] = member_auth( 1, true, true ); 34 34 35 $oSettings = new BxDolAdminSettings(0); 35 $oSettings = new BxDolAdminSettings(0); 36 36 37 37 //--- Process submit ---// -
trunk/administration/antispam.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 41 41 'action' => BX_DOL_URL_ADMIN . 'antispam.php?action=dnsbl_add&mode='.$sDefaultMode, 42 42 'method' => 'post', 43 ), 43 ), 44 44 45 45 'params' => array ( … … 50 50 ), 51 51 ), 52 53 'inputs' => array( 52 53 'inputs' => array( 54 54 55 55 'chain' => array( … … 65 65 ), 66 66 'db' => array ( 67 'pass' => 'Xss', 68 ), 69 ), 67 'pass' => 'Xss', 68 ), 69 ), 70 70 71 71 'zonedomain' => array( … … 79 79 ), 80 80 'db' => array ( 81 'pass' => 'Xss', 81 'pass' => 'Xss', 82 82 ), 83 83 ), … … 93 93 ), 94 94 'db' => array ( 95 'pass' => 'Xss', 95 'pass' => 'Xss', 96 96 ), 97 97 ), … … 102 102 'caption' => _t('_sys_adm_fld_dnsbl_url'), 103 103 'db' => array ( 104 'pass' => 'Xss', 104 'pass' => 'Xss', 105 105 ), 106 106 ), … … 111 111 'caption' => _t('_sys_adm_fld_dnsbl_recheck_url'), 112 112 'db' => array ( 113 'pass' => 'Xss', 113 'pass' => 'Xss', 114 114 ), 115 115 ), … … 120 120 'caption' => _t('_sys_adm_fld_dnsbl_comment'), 121 121 'db' => array ( 122 'pass' => 'Xss', 122 'pass' => 'Xss', 123 123 ), 124 124 ), … … 131 131 'value' => '1', 132 132 'db' => array ( 133 'pass' => 'Int', 134 ), 135 ), 133 'pass' => 'Int', 134 ), 135 ), 136 136 137 137 'Submit' => array ( … … 141 141 'colspan' => true, 142 142 ), 143 ), 143 ), 144 144 ); 145 145 … … 147 147 } 148 148 } 149 149 150 150 151 151 … … 161 161 'onsubmit' => "return bs_sys_adm_dbsbl_recheck($('#$sId').val());", 162 162 'method' => 'post', 163 ), 164 163 ), 164 165 165 'inputs' => array( 166 166 … … 179 179 'colspan' => true, 180 180 ), 181 ), 181 ), 182 182 ); 183 183 … … 196 196 197 197 case 'dnsbl_log': 198 $sPopupTitle = _t('_sys_adm_title_dnsbl_log'); 198 $sPopupTitle = _t('_sys_adm_title_dnsbl_log'); 199 199 $sPopupContent = PageCodeLog ('dnsbl'); 200 200 break; 201 201 202 202 case 'dnsbluri_log': 203 $sPopupTitle = _t('_sys_adm_title_dnsbluri_log'); 203 $sPopupTitle = _t('_sys_adm_title_dnsbluri_log'); 204 204 $sPopupContent = PageCodeLog ('dnsbluri'); 205 205 break; 206 206 207 207 case 'akismet_log': 208 $sPopupTitle = _t('_sys_adm_title_akismet_log'); 208 $sPopupTitle = _t('_sys_adm_title_akismet_log'); 209 209 $sPopupContent = PageCodeLog ('akismet'); 210 210 break; … … 245 245 'title' => $sPopupTitle, 246 246 'content' => $sPopupContent, 247 ); 247 ); 248 248 echo $GLOBALS['oFunctions']->transBox($GLOBALS['oSysTemplate']->parseHtmlByName('popup.html', $aVarsPopup), true); 249 249 exit; … … 262 262 $o = bx_instance('BxDolDNSBlacklists'); 263 263 $aChain = $GLOBALS['MySQL']->getAll("SELECT `zonedomain`, `postvresp` FROM `sys_dnsbl_rules` WHERE `id` = '".(int)$_POST['id']."' AND `active` = 1"); 264 264 265 265 $iRet = BX_DOL_DNSBL_FAILURE; 266 266 if ($aChain) { … … 271 271 $sUrl = preg_replace('/^www\./', '', $sUrl); 272 272 $oBxDolDNSURIBlacklists = bx_instance('BxDolDNSURIBlacklists'); 273 $aUrls = $oBxDolDNSURIBlacklists->validateUrls(array($sUrl)); 273 $aUrls = $oBxDolDNSURIBlacklists->validateUrls(array($sUrl)); 274 274 if ($aUrls) 275 275 $iRet = $o->dnsbl_lookup_uri($aUrls[0], $aChain); … … 292 292 case (isset($_POST['adm-dnsbl-activate'])): 293 293 foreach($_POST['rules'] as $iRuleId) 294 db_res("UPDATE `sys_dnsbl_rules` SET `active` = 1 WHERE `id` = " . (int)$iRuleId); 294 db_res("UPDATE `sys_dnsbl_rules` SET `active` = 1 WHERE `id` = " . (int)$iRuleId); 295 295 $oBxDolDNSBlacklists->clearCache(); 296 296 break; … … 310 310 case (isset($_GET['action']) && 'dnsbl_add' == $_GET['action'] && $_POST['dnsbl_add']): 311 311 $oForm = new BxDolAdmFormDnsblAdd (); 312 $oForm->initChecker(); 312 $oForm->initChecker(); 313 313 if ($oForm->isSubmittedAndValid () && $oForm->insert ()) 314 314 $sGlMsg = MsgBox(_t('_sys_sucess_result')); … … 354 354 $sActions = '<div class="dbTopMenu">'; 355 355 foreach ($aPages as $k => $r) 356 $sActions .= '356 $sActions .= ' 357 357 <div class="' . ($k == $sMode ? 'active' : 'notActive') . '" id="dbmenu_' . $k . '"> 358 358 <span> … … 366 366 367 367 $_page = array( 368 'name_index' => $iNameIndex, 368 'name_index' => $iNameIndex, 369 369 'header' => $sPageTitle, 370 370 'header_text' => $sPageTitle, … … 387 387 'adm-dnsbl-deactivate' => _t('_sys_adm_btn_dnsbl_deactivate'), 388 388 ), 'rules'); 389 389 390 390 $sChains = "'" . implode("','", $aChains) . "'"; 391 391 … … 408 408 $s = MsgBox(_t('_Empty')); 409 409 } 410 410 411 411 return DesignBoxContent ($GLOBALS['sPageTitle'], $s, 1, $GLOBALS['sActions']); 412 412 } … … 443 443 444 444 function PageCodeRecheckPopup ($aChains, $sFieldTitle, $sId, $sAction) { 445 445 446 446 $sChains = "'" . implode("','", $aChains) . "'"; 447 $aRules = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_dnsbl_rules` WHERE `chain` IN($sChains) AND `active` = 1 ORDER BY `chain`, `added` "); 447 $aRules = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_dnsbl_rules` WHERE `chain` IN($sChains) AND `active` = 1 ORDER BY `chain`, `added` "); 448 448 $oForm = new BxDolAdmFormDnsblRecheck($sFieldTitle, $sId); 449 449 return $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_dnsbl_recheck.html', array( … … 458 458 } 459 459 460 function PageCodeLog ($sMode) { 461 460 function PageCodeLog ($sMode) { 461 462 462 switch ($sMode) { 463 463 case 'dnsbl': … … 469 469 } 470 470 471 $iPage = isset($_GET['page']) && (int)$_GET['page'] > 0 ? (int)$_GET['page'] : 1; 471 $iPage = isset($_GET['page']) && (int)$_GET['page'] > 0 ? (int)$_GET['page'] : 1; 472 472 $iPerPage = 12; 473 473 $iStart = ($iPage-1) * $iPerPage; 474 474 475 475 $aLog = $GLOBALS['MySQL']->getAll("SELECT SQL_CALC_FOUND_ROWS * FROM `sys_antispam_block_log` WHERE `type` = '$sMode' ORDER BY `added` DESC LIMIT $iStart, $iPerPage"); 476 476 $iCount = $GLOBALS['MySQL']->getOne("SELECT FOUND_ROWS()"); -
trunk/administration/basic_settings.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 43 43 $mixedResultPromo = ''; 44 44 45 $oSettings = new BxDolAdminSettings(7); 45 $oSettings = new BxDolAdminSettings(7); 46 46 47 47 //--- Logo uploading ---// 48 48 if(isset($_POST['upload']) && isset($_FILES['new_file'])) 49 49 $mixedResultLogo = setLogo($_POST, $_FILES); 50 50 51 51 //--- Promo image uploading ---// 52 52 if(isset($_POST['save_image']) && isset($_FILES['browse_image'])) { … … 57 57 //--- Promo image deleting ---// 58 58 if (!empty($_GET['delete'])) { 59 $sFile = process_pass_data( $_GET['delete'] );60 61 $sFile = str_replace('\\', '', $sFile);62 $sFile = str_replace('/', '', $sFile);63 64 $bResult = @unlink($dir['imagesPromo'] . $sFile) && @unlink($dir['imagesPromo'] . 'original/' . $sFile);65 66 if(!$bResult)67 $mixedResultPromo = '_adm_txt_settings_file_cannot_delete';59 $sFile = process_pass_data( $_GET['delete'] ); 60 61 $sFile = str_replace('\\', '', $sFile); 62 $sFile = str_replace('/', '', $sFile); 63 64 $bResult = @unlink($dir['imagesPromo'] . $sFile) && @unlink($dir['imagesPromo'] . 'original/' . $sFile); 65 66 if(!$bResult) 67 $mixedResultPromo = '_adm_txt_settings_file_cannot_delete'; 68 68 } 69 69 … … 117 117 'name' => 'browse_image', 118 118 'caption' => _t('_adm_txt_settings_promo_browse'), 119 'value' => '', 119 'value' => '', 120 120 ), 121 121 'save_image' => array( … … 127 127 ); 128 128 $oFormImage = new BxTemplFormView($aFormImage); 129 129 130 130 $aFormText = array( 131 131 'form_attrs' => array( … … 151 151 'html' => 2, 152 152 'db' => array ( 153 'pass' => 'XssHtml', 153 'pass' => 'XssHtml', 154 154 ), 155 155 ), … … 162 162 ); 163 163 $oFormText = new BxTemplFormView($aFormText); 164 164 165 165 $bPromoImage = getParam('enable_flash_promo') == 'on'; 166 166 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('promo.html', array( … … 172 172 'content_text' => $oFormText->getCode() 173 173 )); 174 174 175 175 return DesignBoxAdmin(_t('_adm_box_cpt_promo'), $sResult); 176 176 } … … 239 239 ) 240 240 ); 241 241 242 242 $oForm = new BxTemplFormView($aForm); 243 243 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode())); 244 244 245 245 if($mixedResultLogo !== true && !empty($mixedResultLogo)) 246 246 $sResult = MsgBox(_t($mixedResultLogo), 3) . $sResult; … … 252 252 global $dir; 253 253 254 $aFileInfo = getimagesize($aFile['new_file']['tmp_name']);255 if(empty($aFileInfo))256 return '_adm_txt_settings_file_not_image';257 258 $sExt = '';259 switch( $aFileInfo['mime'] ) {260 case 'image/jpeg': $sExt = 'jpg'; break;261 case 'image/gif': $sExt = 'gif'; break;262 case 'image/png': $sExt = 'png'; break;263 }264 if(empty($sExt))265 return '_adm_txt_settings_file_wrong_format';254 $aFileInfo = getimagesize($aFile['new_file']['tmp_name']); 255 if(empty($aFileInfo)) 256 return '_adm_txt_settings_file_not_image'; 257 258 $sExt = ''; 259 switch( $aFileInfo['mime'] ) { 260 case 'image/jpeg': $sExt = 'jpg'; break; 261 case 'image/gif': $sExt = 'gif'; break; 262 case 'image/png': $sExt = 'png'; break; 263 } 264 if(empty($sExt)) 265 return '_adm_txt_settings_file_wrong_format'; 266 266 267 267 $sFileName = mktime() . '.' . $sExt; 268 $sFilePath = $dir['mediaImages'] . $sFileName;269 if(!move_uploaded_file($aFile['new_file']['tmp_name'], $sFilePath))270 return '_adm_txt_settings_file_cannot_move';271 272 if(!empty($aData['resize'])) {273 $iWidth = (int)$aData['new_width'];274 $iHeight = (int)$aData['new_height'];275 if($iWidth <= 0 || $iHeight <= 0)276 return '_adm_txt_settings_logo_wrong_size';277 278 if(imageResize($sFilePath, $sFilePath, $iWidth, $iHeight) != IMAGE_ERROR_SUCCESS)279 return '_adm_txt_settings_image_cannot_resize';280 }281 282 @unlink($dir['mediaImages'] . getParam('sys_main_logo'));283 setParam('sys_main_logo', $sFileName);284 285 return true;268 $sFilePath = $dir['mediaImages'] . $sFileName; 269 if(!move_uploaded_file($aFile['new_file']['tmp_name'], $sFilePath)) 270 return '_adm_txt_settings_file_cannot_move'; 271 272 if(!empty($aData['resize'])) { 273 $iWidth = (int)$aData['new_width']; 274 $iHeight = (int)$aData['new_height']; 275 if($iWidth <= 0 || $iHeight <= 0) 276 return '_adm_txt_settings_logo_wrong_size'; 277 278 if(imageResize($sFilePath, $sFilePath, $iWidth, $iHeight) != IMAGE_ERROR_SUCCESS) 279 return '_adm_txt_settings_image_cannot_resize'; 280 } 281 282 @unlink($dir['mediaImages'] . getParam('sys_main_logo')); 283 setParam('sys_main_logo', $sFileName); 284 285 return true; 286 286 } 287 287 function getPromoImages() { 288 global $site;289 290 $aFiles = getPromoImagesArray();291 if(empty($aFiles))292 return MsgBox(_t('_Empty'));293 294 $aResult = array(); 295 foreach($aFiles as $sFile) {296 $aResult[] = array(288 global $site; 289 290 $aFiles = getPromoImagesArray(); 291 if(empty($aFiles)) 292 return MsgBox(_t('_Empty')); 293 294 $aResult = array(); 295 foreach($aFiles as $sFile) { 296 $aResult[] = array( 297 297 'delete_url' => $GLOBALS['site']['url_admin'] . 'basic_settings.php?delete=' . urlencode($sFile), 298 298 'title' => $sFile 299 );300 }301 return $GLOBALS['oAdmTemplate']->parseHtmlByName('promo_images.html', array(299 ); 300 } 301 return $GLOBALS['oAdmTemplate']->parseHtmlByName('promo_images.html', array( 302 302 'bx_repeat:images' => $aResult, 303 303 'images_url' => $site['imagesPromo'] … … 307 307 global $dir; 308 308 309 $aFileInfo = getimagesize($aFile['browse_image']['tmp_name']);310 if(empty($aFileInfo))311 return '_adm_txt_settings_file_not_image';312 313 $sExt = '';314 switch( $aFileInfo['mime'] ) {315 case 'image/jpeg': $sExt = 'jpg'; break;316 case 'image/gif': $sExt = 'gif'; break;317 case 'image/png': $sExt = 'png'; break;318 }319 if(empty($sExt))320 return '_adm_txt_settings_file_wrong_format';309 $aFileInfo = getimagesize($aFile['browse_image']['tmp_name']); 310 if(empty($aFileInfo)) 311 return '_adm_txt_settings_file_not_image'; 312 313 $sExt = ''; 314 switch( $aFileInfo['mime'] ) { 315 case 'image/jpeg': $sExt = 'jpg'; break; 316 case 'image/gif': $sExt = 'gif'; break; 317 case 'image/png': $sExt = 'png'; break; 318 } 319 if(empty($sExt)) 320 return '_adm_txt_settings_file_wrong_format'; 321 321 322 322 $sFileName = $aFile['browse_image']['name']; 323 $sFilePath = $dir['imagesPromo'] . 'original/' . $sFileName;324 if(!move_uploaded_file($aFile['browse_image']['tmp_name'], $sFilePath))325 return '_adm_txt_settings_file_cannot_move';323 $sFilePath = $dir['imagesPromo'] . 'original/' . $sFileName; 324 if(!move_uploaded_file($aFile['browse_image']['tmp_name'], $sFilePath)) 325 return '_adm_txt_settings_file_cannot_move'; 326 326 327 327 ResizeAllPromos(); 328 return true;328 return true; 329 329 } 330 330 ?> -
trunk/administration/cache.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 32 32 switch($_POST['type']) { 33 33 case 'all': 34 //member menu35 bx_import('BxDolMemberMenu');34 //member menu 35 bx_import('BxDolMemberMenu'); 36 36 $oMemberMenu = new BxDolMemberMenu(); 37 37 $oMemberMenu -> deleteMemberMenuCaches(); 38 38 39 39 // page blocks 40 bx_import('BxDolPageViewAdmin'); 40 bx_import('BxDolPageViewAdmin'); 41 41 $oPageViewCacher = new BxDolPageViewCacher ('', ''); 42 42 $oCachePb = $oPageViewCacher->getBlocksCacheObject (); 43 43 $aResult = clearCacheObject ($oCachePb, 'pb_'); 44 if($aResult['code'] != 0) 44 if($aResult['code'] != 0) 45 45 break; 46 46 47 47 // users 48 48 $aResult = clearCache('user', BX_DIRECTORY_PATH_CACHE); 49 if($aResult['code'] != 0) 49 if($aResult['code'] != 0) 50 50 break; 51 51 … … 54 54 $oCacheDb = $GLOBALS['MySQL']->getDbCacheObject(); 55 55 $aResult = clearCacheObject ($oCacheDb, 'db_'); 56 if($aResult['code'] != 0) 56 if($aResult['code'] != 0) 57 57 break; 58 58 … … 60 60 $oCacheTemplates = $GLOBALS['oSysTemplate']->getTemplatesCacheObject(); 61 61 $aResult = clearCacheObject($oCacheTemplates, $GLOBALS['oSysTemplate']->_sCacheFilePrefix); 62 if($aResult['code'] != 0) 62 if($aResult['code'] != 0) 63 63 break; 64 64 65 65 // CSS 66 66 $aResult = clearCache($GLOBALS['oSysTemplate']->_sCssCachePrefix, BX_DIRECTORY_PATH_CACHE_PUBLIC); 67 if($aResult['code'] != 0) 67 if($aResult['code'] != 0) 68 68 break; 69 69 70 70 // JS 71 71 $aResult = clearCache($GLOBALS['oSysTemplate']->_sJsCachePrefix, BX_DIRECTORY_PATH_CACHE_PUBLIC); … … 73 73 74 74 case 'pb': 75 bx_import('BxDolPageViewAdmin'); 75 bx_import('BxDolPageViewAdmin'); 76 76 $oPageViewCacher = new BxDolPageViewCacher ('', ''); 77 77 $oCachePb = $oPageViewCacher->getBlocksCacheObject (); … … 80 80 81 81 case 'users': 82 //member menu83 bx_import('BxDolMemberMenu');82 //member menu 83 bx_import('BxDolMemberMenu'); 84 84 $oMemberMenu = new BxDolMemberMenu(); 85 85 $oMemberMenu -> deleteMemberMenuCaches(); … … 101 101 case 'js_css': 102 102 $aResult = clearCache($GLOBALS['oSysTemplate']->_sCssCachePrefix, BX_DIRECTORY_PATH_CACHE_PUBLIC); 103 if($aResult['code'] == 0) 103 if($aResult['code'] == 0) 104 104 $aResult = clearCache($GLOBALS['oSysTemplate']->_sJsCachePrefix, BX_DIRECTORY_PATH_CACHE_PUBLIC); 105 105 break; 106 106 } 107 107 108 $oJson = new Services_JSON(); 108 $oJson = new Services_JSON(); 109 109 echo $oJson->encode($aResult); 110 110 exit; … … 126 126 @unlink($sPath . $sFile); 127 127 } 128 else 128 else 129 129 $aResult = array('code' => 1, 'message' => _t('_adm_txt_dashboard_cache_clean_failed')); 130 130 -
trunk/administration/categories.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 35 35 $aBxSecurityExceptions = array (); 36 36 if (bx_get('pathes') !== false) { 37 $aPathes = bx_get('pathes');38 39 if(is_array($aPathes))40 for ($i=0; $i<count($aPathes); ++$i) {41 $aBxSecurityExceptions[] = 'POST.pathes.'.$i;42 $aBxSecurityExceptions[] = 'REQUEST.pathes.'.$i;43 }37 $aPathes = bx_get('pathes'); 38 39 if(is_array($aPathes)) 40 for ($i=0; $i<count($aPathes); ++$i) { 41 $aBxSecurityExceptions[] = 'POST.pathes.'.$i; 42 $aBxSecurityExceptions[] = 'REQUEST.pathes.'.$i; 43 } 44 44 } 45 45 … … 48 48 function actionAllCategories() { 49 49 $oDb = new BxDolDb(); 50 50 51 51 // check actions 52 52 if(bx_get('pathes') !== false) { 53 $aPathes = bx_get('pathes');54 55 if(is_array($aPathes) && !empty($aPathes))56 foreach($_POST['pathes'] as $sValue) {57 list($sCategory, $sId, $sType) = split('%%', $sValue);58 59 if (bx_get('action_disable') !== flase)60 $oDb->query("UPDATE `sys_categories` SET `Status` = 'passive' WHERE 61 `Category` = '$sCategory' AND `ID` = $sId AND `Type` = '$sType'");62 else if(bx_get('action_delete') !== false)63 $oDb->query("DELETE FROM `sys_categories` WHERE 64 `Category` = '$sCategory' AND `ID` = $sId AND `Type` = '$sType'");65 }66 } 67 53 $aPathes = bx_get('pathes'); 54 55 if(is_array($aPathes) && !empty($aPathes)) 56 foreach($_POST['pathes'] as $sValue) { 57 list($sCategory, $sId, $sType) = split('%%', $sValue); 58 59 if (bx_get('action_disable') !== flase) 60 $oDb->query("UPDATE `sys_categories` SET `Status` = 'passive' WHERE 61 `Category` = '$sCategory' AND `ID` = $sId AND `Type` = '$sType'"); 62 else if(bx_get('action_delete') !== false) 63 $oDb->query("DELETE FROM `sys_categories` WHERE 64 `Category` = '$sCategory' AND `ID` = $sId AND `Type` = '$sType'"); 65 } 66 } 67 68 68 $sContent = MsgBox(_t('_Empty')); 69 69 $aModules = array(); 70 70 $oCategories = new BxDolCategories(); 71 71 $oCategories->getTagObjectConfig(); 72 72 73 73 if (!empty($oCategories->aTagObjects)) 74 74 { … … 78 78 if (!$sModule) 79 79 $sModule = $sKey; 80 80 81 81 $aModules[] = array( 82 82 'value' => $sKey, … … 85 85 ); 86 86 } 87 87 88 88 $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('top_block_select.html', array( 89 89 'name' => _t('_categ_modules'), … … 91 91 'location_href' => BX_DOL_URL_ADMIN . 'categories.php?action=all&module=' 92 92 )); 93 93 94 94 $aCategories = $oDb->getAll("SELECT * FROM `sys_categories` WHERE `Status` = 'active' AND `Owner` = 0 AND `Type` = '$sModule'"); 95 95 96 96 if (!empty($aCategories)) 97 97 { 98 98 $aItems = array(); 99 99 $sFormName = 'categories_form'; 100 101 foreach($aCategories as $aCategory) 100 101 foreach($aCategories as $aCategory) 102 102 { 103 103 $aItems[] = array( … … 107 107 ); 108 108 } 109 109 110 110 $sControls = $sControls = BxTemplSearchResult::showAdminActionsPanel($sFormName, array( 111 111 'action_disable' => _t('_categ_btn_disable'), 112 112 'action_delete' => _t('_categ_btn_delete') 113 113 ), 'pathes'); 114 114 115 115 $sContent .= $GLOBALS['oAdmTemplate']->parseHtmlByName('categories_list.html', array( 116 116 'form_name' => $sFormName, … … 122 122 $sContent .= MsgBox(_t('_Empty')); 123 123 } 124 124 125 125 return $sContent; 126 126 } … … 131 131 $sFormName = 'categories_aprove_form'; 132 132 $aItems = array(); 133 133 134 134 if(is_array($_POST['pathes']) && !empty($_POST['pathes'])) 135 135 { … … 137 137 { 138 138 list($sCategory, $sId, $sType) = split('%%', $sValue); 139 $oDb->query("UPDATE `sys_categories` SET `Status` = 'active' WHERE 139 $oDb->query("UPDATE `sys_categories` SET `Status` = 'active' WHERE 140 140 `Category` = '$sCategory' AND `ID` = $sId AND `Type` = '$sType'"); 141 141 } 142 142 } 143 143 144 144 $aCategories = $oDb->getAll("SELECT * FROM `sys_categories` WHERE `Status` = 'passive'"); 145 145 146 146 if (!empty($aCategories)) 147 147 { 148 foreach($aCategories as $aCategory) 148 foreach($aCategories as $aCategory) 149 149 { 150 150 $aItems[] = array( … … 154 154 ); 155 155 } 156 156 157 157 $aButtons = array( 158 158 'action_activate' => _t('_categ_btn_activate'), 159 ); 159 ); 160 160 $sControls = BxTemplSearchResult::showAdminActionsPanel($sFormName, $aButtons, 'pathes'); 161 161 162 162 return $GLOBALS['oAdmTemplate']->parseHtmlByName('categories_list.html', array( 163 163 'form_name' => $sFormName, … … 178 178 { 179 179 $oSettings = new BxDolAdminSettings($iId); 180 180 181 181 $mixedResult = ''; 182 182 if(isset($_POST['save']) && isset($_POST['cat'])) 183 183 $mixedResult = $oSettings->saveChanges($_POST); 184 184 185 185 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oSettings->getForm())); 186 186 187 187 if($mixedResult !== true && !empty($mixedResult)) 188 188 $sResult = $mixedResult . $sResult; 189 189 190 190 return $sResult; 191 191 } … … 199 199 $aTypes = array(); 200 200 $oCateg->getTagObjectConfig(); 201 201 202 202 foreach ($oCateg->aTagObjects as $sKey => $aValue) 203 203 $aTypes[$sKey] = _t($aValue[$oCateg->aObjFields['lang_key']]); 204 204 205 205 $aForm = array( 206 206 207 207 'form_attrs' => array( 208 208 'name' => 'category_form', … … 210 210 'method' => 'post', 211 211 'enctype' => 'multipart/form-data', 212 ), 212 ), 213 213 214 214 'params' => array ( … … 218 218 ), 219 219 ), 220 220 221 221 'inputs' => array( 222 222 223 223 'name' => array( 224 224 'type' => 'text', … … 251 251 'pass' => 'Xss' 252 252 ), 253 ), 253 ), 254 254 'submit' => array ( 255 255 'type' => 'submit', … … 257 257 'value' => _t('_Submit'), 258 258 'colspan' => false, 259 ), 260 ) 259 ), 260 ) 261 261 ); 262 262 263 263 return new BxTemplFormView($aForm); 264 264 } … … 269 269 $oForm->initChecker(); 270 270 $sResult = ''; 271 271 272 272 if ($oForm->isSubmittedAndValid()) 273 273 { 274 274 $oDb = new BxDolDb(); 275 if ($oDb->getOne("SELECT COUNT(*) FROM `sys_categories` WHERE `Category` = '" . 276 $oForm->getCleanValue('Category') . "' AND `ID` = 0 AND `Type` = '" . 275 if ($oDb->getOne("SELECT COUNT(*) FROM `sys_categories` WHERE `Category` = '" . 276 $oForm->getCleanValue('Category') . "' AND `ID` = 0 AND `Type` = '" . 277 277 $oForm->getCleanValue('Type') . "'") == 0) 278 278 { … … 282 282 'Status' => 'active', 283 283 ); 284 284 285 285 $oForm->insert($aValsAdd); 286 286 header('Location:' . BX_DOL_URL_ADMIN . 'categories.php?action=all&module=' . $oForm->getCleanValue('Type')); … … 289 289 $sResult = sprintf(_t('_categ_exist_err'), $oForm->getCleanValue('Category')); 290 290 } 291 291 292 292 return (strlen($sResult) > 0 ? MsgBox($sResult) : '') . 293 293 $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode())); … … 297 297 $aMenu = array( 298 298 'all' => array( 299 'title' => _t('_categ_all'), 300 'href' => $GLOBALS['site']['url_admin'] . 'categories.php?action=all', 299 'title' => _t('_categ_all'), 300 'href' => $GLOBALS['site']['url_admin'] . 'categories.php?action=all', 301 301 '_func' => array ('name' => 'actionAllCategories', 'params' => array()), 302 302 ), 303 303 'pending' => array( 304 'title' => _t('_categ_admin_pending'), 305 'href' => $GLOBALS['site']['url_admin'] . 'categories.php?action=pending', 304 'title' => _t('_categ_admin_pending'), 305 'href' => $GLOBALS['site']['url_admin'] . 'categories.php?action=pending', 306 306 '_func' => array ('name' => 'actionPending', 'params' => array()), 307 307 ), 308 308 'settings' => array( 309 'title' => _t('_categ_admin_settings'), 309 'title' => _t('_categ_admin_settings'), 310 310 'href' => $GLOBALS['site']['url_admin'] . 'categories.php?action=settings', 311 311 '_func' => array ('name' => 'actionSettings', 'params' => array()), … … 323 323 ); 324 324 325 $_page_cont[$iNameIndex]['page_main_code'] = DesignBoxAdmin(_t('_categ_form_add'), getAddCategoryForm()) . 325 $_page_cont[$iNameIndex]['page_main_code'] = DesignBoxAdmin(_t('_categ_form_add'), getAddCategoryForm()) . 326 326 DesignBoxAdmin($aMenu[$sAction]['title'], $sContent, $aMenu); 327 327 -
trunk/administration/css_file.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 44 44 $_page_cont[$iNameIndex]['page_main_code'] = PageCodeEdit(); 45 45 define('BX_PROMO_CODE', 'on' == getParam('feeds_enable') ? DesignBoxAdmin (_t('_adm_box_cpt_design_templates'), ' 46 <div class="RSSAggrCont" rssid="boonex_unity_market_templates" rssnum="5" member="0">47 <div class="loading_rss">48 <img src="' . getTemplateImage('loading.gif') . '" alt="' . _t('_loading ...') . '" />49 </div>50 </div>') : ''); 46 <div class="RSSAggrCont" rssid="boonex_unity_market_templates" rssnum="5" member="0"> 47 <div class="loading_rss"> 48 <img src="' . getTemplateImage('loading.gif') . '" alt="' . _t('_loading ...') . '" /> 49 </div> 50 </div>') : ''); 51 51 52 52 PageCodeAdmin(); … … 70 70 ), 71 71 ), 72 'inputs' => array ( 72 'inputs' => array ( 73 73 'css_file' => array( 74 74 'type' => 'select', … … 94 94 'name' => 'adm-css-save', 95 95 'value' => _t('_adm_btn_css_save'), 96 ), 96 ), 97 97 ) 98 98 ); 99 99 100 100 //--- Get CSS files ---// 101 101 $aItems = array(); … … 103 103 104 104 $rHandle = opendir($sBasePath); 105 while(($sFile = readdir($rHandle)) !== false)106 if(is_file($sBasePath . $sFile) && substr($sFile, -3) == 'css')107 $aItems[] = array('key' => $sFile, 'value' => $sFile);108 closedir($rHandle);105 while(($sFile = readdir($rHandle)) !== false) 106 if(is_file($sBasePath . $sFile) && substr($sFile, -3) == 'css') 107 $aItems[] = array('key' => $sFile, 'value' => $sFile); 108 closedir($rHandle); 109 109 110 $sCurrentFile = isset($_POST['css_file']) && preg_match("/^\w+\.css$/", $_POST['css_file']) ? $_POST['css_file'] : $aItems[0]['key'];111 $aForm['inputs']['css_file']['value'] = $sCurrentFile;110 $sCurrentFile = isset($_POST['css_file']) && preg_match("/^\w+\.css$/", $_POST['css_file']) ? $_POST['css_file'] : $aItems[0]['key']; 111 $aForm['inputs']['css_file']['value'] = $sCurrentFile; 112 112 $aForm['inputs']['css_file']['values'] = $aItems; 113 113 114 //--- Get CSS file's content ---//115 $sContent = '';116 $sAbsolutePath = $sBasePath . $sCurrentFile;117 if(strlen($sCurrentFile) > 0 && is_file($sAbsolutePath) ) {118 $rHandle = fopen($sAbsolutePath, 'r'); 119 while(!feof($rHandle))120 $sContent .= fgets($rHandle, 4096);121 fclose($rHandle);122 }123 //$aForm['inputs']['content']['value'] = isset($_POST['content']) ? $_POST['content'] : $sContent;124 $aForm['inputs']['content']['value'] = $sContent;125 114 //--- Get CSS file's content ---// 115 $sContent = ''; 116 $sAbsolutePath = $sBasePath . $sCurrentFile; 117 if(strlen($sCurrentFile) > 0 && is_file($sAbsolutePath) ) { 118 $rHandle = fopen($sAbsolutePath, 'r'); 119 while(!feof($rHandle)) 120 $sContent .= fgets($rHandle, 4096); 121 fclose($rHandle); 122 } 123 //$aForm['inputs']['content']['value'] = isset($_POST['content']) ? $_POST['content'] : $sContent; 124 $aForm['inputs']['content']['value'] = $sContent; 125 126 126 $oForm = new BxTemplFormView($aForm); 127 127 $oForm->initChecker(); … … 131 131 $rHandle = fopen($sAbsolutePath, 'w'); 132 132 if($rHandle) { 133 fwrite($rHandle, clear_xss($_POST['content']));134 fclose($rHandle);133 fwrite($rHandle, clear_xss($_POST['content'])); 134 fclose($rHandle); 135 135 136 $mixedResult = '_adm_txt_css_success_save';136 $mixedResult = '_adm_txt_css_success_save'; 137 137 } else 138 $mixedResult = '_adm_txt_css_failed_save';138 $mixedResult = '_adm_txt_css_failed_save'; 139 139 } else 140 140 $mixedResult = '_adm_txt_css_cannot_write'; -
trunk/administration/db.php
r15201 r15211 2 2 3 3 // TODO: remake according to new design and principles, site setup part leave in admin and remake other functionality move to user part 4 4 5 5 /*************************************************************************** 6 6 * Dolphin Smart Community Builder … … 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 42 42 $sBoxContent = <<<EOF 43 43 <style> 44 div.hidden {45 display:none;46 }44 div.hidden { 45 display:none; 46 } 47 47 </style> 48 48 <script type="text/javascript"> 49 <!--50 function switchAdmPage(iPageID) {51 //make all tabs - inactive52 //mace selected tab - active53 //hide all pages54 //show selected page55 56 $(".dbTopMenu").children().removeClass().toggleClass("notActive");57 $("#main_menu" + iPageID).removeClass().toggleClass("active");58 59 $("#adm_pages").children().removeClass().toggleClass("hidden");60 $("#adm_pages #page" + iPageID).removeClass().toggleClass("visible");61 62 return false;63 }64 -->49 <!-- 50 function switchAdmPage(iPageID) { 51 //make all tabs - inactive 52 //mace selected tab - active 53 //hide all pages 54 //show selected page 55 56 $(".dbTopMenu").children().removeClass().toggleClass("notActive"); 57 $("#main_menu" + iPageID).removeClass().toggleClass("active"); 58 59 $("#adm_pages").children().removeClass().toggleClass("hidden"); 60 $("#adm_pages #page" + iPageID).removeClass().toggleClass("visible"); 61 62 return false; 63 } 64 --> 65 65 </script> 66 66 67 67 <div class="boxContent" id="adm_pages"> 68 <div id="page1" class="visible">{$sTablesBackupToolsBlock}</div>69 <div id="page2" class="hidden">{$sDatabaseBackupToolsBlock}</div>68 <div id="page1" class="visible">{$sTablesBackupToolsBlock}</div> 69 <div id="page2" class="hidden">{$sDatabaseBackupToolsBlock}</div> 70 70 </div> 71 71 EOF; … … 73 73 $sActions = <<<EOF 74 74 <div class="dbTopMenu"> 75 <div class="active" id="main_menu1"><span><a href="#" class="top_members_menu" onclick="switchAdmPage(1); return false;">{$sTablesC}</a></span></div>76 <div class="notActive" id="main_menu2"><span><a href="#" class="top_members_menu" onclick="switchAdmPage(2); return false;">{$sDatabaseC}</a></span></div>75 <div class="active" id="main_menu1"><span><a href="#" class="top_members_menu" onclick="switchAdmPage(1); return false;">{$sTablesC}</a></span></div> 76 <div class="notActive" id="main_menu2"><span><a href="#" class="top_members_menu" onclick="switchAdmPage(2); return false;">{$sDatabaseC}</a></span></div> 77 77 </div> 78 78 EOF; … … 96 96 // Functions 97 97 function getActionResultBlock() { 98 $sSuccDumpedIntoFileC = _t('_adm_dbtools_succ_dumped_into_file');99 $sDumpFileSuccDeletedC = _t('_adm_dbtools_Dump_file_succefully_deleted');100 $sPleaseSelectDumpFileC = _t('_adm_dbtools_Please_select_dump_file');101 $sDateRestoredFromDumpC = _t('_adm_dbtools_Data_succefully_restored_from_dump');102 $sPleaseSelectCorrectDumpFileC = _t('_adm_dbtools_Please_select_correct_dump_file');103 $sDateRestoredFromPcC = _t('_adm_dbtools_Data_succefully_restored_from_PC');98 $sSuccDumpedIntoFileC = _t('_adm_dbtools_succ_dumped_into_file'); 99 $sDumpFileSuccDeletedC = _t('_adm_dbtools_Dump_file_succefully_deleted'); 100 $sPleaseSelectDumpFileC = _t('_adm_dbtools_Please_select_dump_file'); 101 $sDateRestoredFromDumpC = _t('_adm_dbtools_Data_succefully_restored_from_dump'); 102 $sPleaseSelectCorrectDumpFileC = _t('_adm_dbtools_Please_select_correct_dump_file'); 103 $sDateRestoredFromPcC = _t('_adm_dbtools_Data_succefully_restored_from_PC'); 104 104 105 105 $status_text = $status_text_restore = ''; 106 106 107 if (isset($_POST['TablesBackup'])) { ##Block of table backup create108 //echo "For: Tables Tools". $_POST['tbl_op'] . ' Table - ' . $_POST['tbl'] . ' Show param - ' . $_POST['savetype'] ; 109 110 $OutPutType = preg_replace("/[^0-9]/", '', $_POST['tbl_op']);111 $oNewBackup = new BxDolDatabaseBackup();112 $oNewBackup -> _getTableStruct($_POST['tbl'], $OutPutType); 113 114 if ($_POST['savetype'] == 'client') {115 $sqlfile = date("Y-m-d_H:i:s").'_'.$_POST['tbl'].'.sql';116 header("Content-Type: text/plain");117 header("Content-Disposition: attachment;filename=\"".$sqlfile."\"");118 echo $oNewBackup -> sInputs;119 exit();120 }121 if ($_POST['savetype'] == 'server') {122 $sqlfile = BX_DIRECTORY_PATH_ROOT . 'backup/'.date("Y-m-d_H-i-s").'_'.$_POST['tbl'].'.sql';123 $file = fopen($sqlfile, 'w');124 fputs($file, $oNewBackup -> sInputs);125 $status_text .= "<hr size=1 /><font color='green'><center>{$sSuccDumpedIntoFileC} <b>{$sqlfile}</b></center></font>\n";126 fclose($file);127 }128 if ($_POST['savetype'] == 'show') {129 $status_text = "<center><textarea cols='100' rows='30' name='content' style='font-family: Arial; font-size: 11px' readonly='readonly'>" . $oNewBackup -> sInputs ."</textarea></center>";130 }131 }132 133 if (isset($_POST['DatabasesBackup'])) {134 $OutPutType = preg_replace("/[^0-9]/", '', $_POST['db_op']); 135 $oNewBackup = new BxDolDatabaseBackup();136 $oNewBackup -> _getAllTables($OutPutType); 137 138 if ($_POST['savetype'] == 'show') {139 $status_text = "<center><textarea cols='100' rows='30' name='content' style='font-family: Arial; font-size: 11px' readonly='readonly'>" . $oNewBackup -> sInputs ."</textarea></center>";140 }141 if ($_POST['savetype'] == 'server') {142 $sqlfile = BX_DIRECTORY_PATH_ROOT . 'backup/'.date("Y-m-d_H-i-s").'_all.sql';143 $file = fopen($sqlfile, 'w');144 fputs($file, $oNewBackup -> sInputs);145 $status_text .= "<hr size=1 /><font color='green'><center>{$sSuccDumpedIntoFileC} <b>{$sqlfile}</b></center></font>\n";146 fclose($file);147 } 148 if ($_POST['savetype'] == 'client') {149 $sqlfile = date("Y-m-d_H:i:s").'_all.sql';150 header("Content-Type: text/plain");151 header("Content-Disposition: attachment;filename=\"".$sqlfile."\"");152 echo $oNewBackup -> sInputs;153 exit();154 }155 }156 157 if (isset($_POST['DatabasesRestore'])) {158 if ($_POST['savetype'] == 'delete') {159 if(is_file(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file'])) {160 @unlink(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file']);161 $status_text_restore .= "<hr size=1 /><font color='green'><center>{$sDumpFileSuccDeletedC} <b>{$sqlfile}</b></center></font>\n";162 } else163 $status_text_restore .= "<hr size=1 /><font color='red'><center>{$sPleaseSelectDumpFileC} <b>{$sqlfile}</b></center></font>\n"; 164 }165 if ($_POST['savetype'] == 'restore') {166 if(is_file(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file'])) {167 $oNewBackup = new BxDolDatabaseBackup();168 $oNewBackup -> _restoreFromDumpFile(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file']); 169 $status_text_restore .= "<hr size=1 /><font color='green'><center>{$sDateRestoredFromDumpC}</center></font>\n";170 } else171 $status_text_restore .= "<hr size=1 /><font color='red'><center>{$sPleaseSelectDumpFileC} <b>{$sqlfile}</b></center></font>\n";172 }173 }174 175 if (isset($_FILES['sqlfile'])) {176 if (preg_match("/.sql/", $_FILES['sqlfile']['name'])) { #it is correct177 $oNewBackup = new BxDolDatabaseBackup();178 $oNewBackup -> _restoreFromDumpFile($_FILES['sqlfile']['tmp_name'] ); 179 @unlink($_FILES['sqlfile']['tmp_name']);180 $status_text_restore .= "<hr size=1 /><font color='green'><center>{$sDateRestoredFromPcC} </center></font>\n";181 } else182 $status_text_restore .= "<hr size=1 /><font color='red'><center>{$sPleaseSelectCorrectDumpFileC}</center></font>\n";183 }184 185 return array($status_text, $status_text_restore);107 if (isset($_POST['TablesBackup'])) { ##Block of table backup create 108 //echo "For: Tables Tools". $_POST['tbl_op'] . ' Table - ' . $_POST['tbl'] . ' Show param - ' . $_POST['savetype'] ; 109 110 $OutPutType = preg_replace("/[^0-9]/", '', $_POST['tbl_op']); 111 $oNewBackup = new BxDolDatabaseBackup(); 112 $oNewBackup -> _getTableStruct($_POST['tbl'], $OutPutType); 113 114 if ($_POST['savetype'] == 'client') { 115 $sqlfile = date("Y-m-d_H:i:s").'_'.$_POST['tbl'].'.sql'; 116 header("Content-Type: text/plain"); 117 header("Content-Disposition: attachment;filename=\"".$sqlfile."\""); 118 echo $oNewBackup -> sInputs; 119 exit(); 120 } 121 if ($_POST['savetype'] == 'server') { 122 $sqlfile = BX_DIRECTORY_PATH_ROOT . 'backup/'.date("Y-m-d_H-i-s").'_'.$_POST['tbl'].'.sql'; 123 $file = fopen($sqlfile, 'w'); 124 fputs($file, $oNewBackup -> sInputs); 125 $status_text .= "<hr size=1 /><font color='green'><center>{$sSuccDumpedIntoFileC} <b>{$sqlfile}</b></center></font>\n"; 126 fclose($file); 127 } 128 if ($_POST['savetype'] == 'show') { 129 $status_text = "<center><textarea cols='100' rows='30' name='content' style='font-family: Arial; font-size: 11px' readonly='readonly'>" . $oNewBackup -> sInputs ."</textarea></center>"; 130 } 131 } 132 133 if (isset($_POST['DatabasesBackup'])) { 134 $OutPutType = preg_replace("/[^0-9]/", '', $_POST['db_op']); 135 $oNewBackup = new BxDolDatabaseBackup(); 136 $oNewBackup -> _getAllTables($OutPutType); 137 138 if ($_POST['savetype'] == 'show') { 139 $status_text = "<center><textarea cols='100' rows='30' name='content' style='font-family: Arial; font-size: 11px' readonly='readonly'>" . $oNewBackup -> sInputs ."</textarea></center>"; 140 } 141 if ($_POST['savetype'] == 'server') { 142 $sqlfile = BX_DIRECTORY_PATH_ROOT . 'backup/'.date("Y-m-d_H-i-s").'_all.sql'; 143 $file = fopen($sqlfile, 'w'); 144 fputs($file, $oNewBackup -> sInputs); 145 $status_text .= "<hr size=1 /><font color='green'><center>{$sSuccDumpedIntoFileC} <b>{$sqlfile}</b></center></font>\n"; 146 fclose($file); 147 } 148 if ($_POST['savetype'] == 'client') { 149 $sqlfile = date("Y-m-d_H:i:s").'_all.sql'; 150 header("Content-Type: text/plain"); 151 header("Content-Disposition: attachment;filename=\"".$sqlfile."\""); 152 echo $oNewBackup -> sInputs; 153 exit(); 154 } 155 } 156 157 if (isset($_POST['DatabasesRestore'])) { 158 if ($_POST['savetype'] == 'delete') { 159 if(is_file(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file'])) { 160 @unlink(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file']); 161 $status_text_restore .= "<hr size=1 /><font color='green'><center>{$sDumpFileSuccDeletedC} <b>{$sqlfile}</b></center></font>\n"; 162 } else 163 $status_text_restore .= "<hr size=1 /><font color='red'><center>{$sPleaseSelectDumpFileC} <b>{$sqlfile}</b></center></font>\n"; 164 } 165 if ($_POST['savetype'] == 'restore') { 166 if(is_file(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file'])) { 167 $oNewBackup = new BxDolDatabaseBackup(); 168 $oNewBackup -> _restoreFromDumpFile(BX_DIRECTORY_PATH_ROOT.'backup/'.$_POST['dump_file']); 169 $status_text_restore .= "<hr size=1 /><font color='green'><center>{$sDateRestoredFromDumpC}</center></font>\n"; 170 } else 171 $status_text_restore .= "<hr size=1 /><font color='red'><center>{$sPleaseSelectDumpFileC} <b>{$sqlfile}</b></center></font>\n"; 172 } 173 } 174 175 if (isset($_FILES['sqlfile'])) { 176 if (preg_match("/.sql/", $_FILES['sqlfile']['name'])) { #it is correct 177 $oNewBackup = new BxDolDatabaseBackup(); 178 $oNewBackup -> _restoreFromDumpFile($_FILES['sqlfile']['tmp_name'] ); 179 @unlink($_FILES['sqlfile']['tmp_name']); 180 $status_text_restore .= "<hr size=1 /><font color='green'><center>{$sDateRestoredFromPcC} </center></font>\n"; 181 } else 182 $status_text_restore .= "<hr size=1 /><font color='red'><center>{$sPleaseSelectCorrectDumpFileC}</center></font>\n"; 183 } 184 185 return array($status_text, $status_text_restore); 186 186 } 187 187 188 188 function getTablesBackupTools($status_text) { 189 $sChooseOperationC = _t('_adm_dbtools_Choose_operation_and_table');190 $sBackup1C = _t('_adm_dbtools_Backup_structure_content');191 $sBackup2C = _t('_adm_dbtools_Backup_structure');192 $sBackup3C = _t('_adm_dbtools_Backup_content');193 $sSaveOption1C = _t('_adm_dbtools_Save_to_server');194 $sSaveOption2C = _t('_adm_dbtools_Save_to_your_PC');195 $sSaveOption3C = _t('_adm_dbtools_Show_on_the_screen');196 $sBackupTableC = _t('_adm_dbtools_Backup_table');197 $sActionC = _t('_Action');198 199 // All tables of Database200 $aTablesOptions = array();201 $tbls = db_list_tables();202 while ($tbl = mysql_fetch_array($tbls)) {203 $aTablesOptions[$tbl['0']] = $tbl['0'];204 }205 206 $sStatusText = ($status_text and isset($_POST['TablesBackup'])) ? $status_text : '';207 208 $aForm = array(209 'form_attrs' => array(210 'name' => 'TablesBackupTools_form',211 'action' => $GLOBALS['site']['url_admin'] . 'db.php',212 'method' => 'post',213 ),214 'inputs' => array(215 'TablesBackup' => array(216 'type' => 'hidden',217 'name' => 'TablesBackup',218 'value' => 'YES',219 ),220 'tbl_op' => array(221 'type' => 'select',222 'name' => 'tbl_op',223 'caption' => $sChooseOperationC,224 'values' => array (225 2 => $sBackup1C,226 0 => $sBackup2C,227 1 => $sBackup3C,228 ),229 ),230 'tbl' => array(231 'type' => 'select',232 'name' => 'tbl',233 'caption' => '',234 'values' => $aTablesOptions,235 ),236 'savetype' => array(237 'type' => 'radio_set',238 'name' => 'savetype',239 'caption' => $sActionC,240 'values' => array (241 'server' => $sSaveOption1C,242 'client' => $sSaveOption2C,243 'show' => $sSaveOption3C,244 ),245 ),246 'tables_backup_tool' => array(247 'type' => 'submit',248 'name' => 'tables_backup_tool',249 'caption' => '',250 'value' => $sBackupTableC,251 ),252 ),253 );254 255 $oForm = new BxTemplFormView($aForm);256 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . $sStatusText));257 //return DesignBoxContent(_t('_adm_dbtools_Tables_backup_tools'), '<div style="margin:9px;">' . $oForm->getCode() . '</div>' . $sStatusText, 1);189 $sChooseOperationC = _t('_adm_dbtools_Choose_operation_and_table'); 190 $sBackup1C = _t('_adm_dbtools_Backup_structure_content'); 191 $sBackup2C = _t('_adm_dbtools_Backup_structure'); 192 $sBackup3C = _t('_adm_dbtools_Backup_content'); 193 $sSaveOption1C = _t('_adm_dbtools_Save_to_server'); 194 $sSaveOption2C = _t('_adm_dbtools_Save_to_your_PC'); 195 $sSaveOption3C = _t('_adm_dbtools_Show_on_the_screen'); 196 $sBackupTableC = _t('_adm_dbtools_Backup_table'); 197 $sActionC = _t('_Action'); 198 199 // All tables of Database 200 $aTablesOptions = array(); 201 $tbls = db_list_tables(); 202 while ($tbl = mysql_fetch_array($tbls)) { 203 $aTablesOptions[$tbl['0']] = $tbl['0']; 204 } 205 206 $sStatusText = ($status_text and isset($_POST['TablesBackup'])) ? $status_text : ''; 207 208 $aForm = array( 209 'form_attrs' => array( 210 'name' => 'TablesBackupTools_form', 211 'action' => $GLOBALS['site']['url_admin'] . 'db.php', 212 'method' => 'post', 213 ), 214 'inputs' => array( 215 'TablesBackup' => array( 216 'type' => 'hidden', 217 'name' => 'TablesBackup', 218 'value' => 'YES', 219 ), 220 'tbl_op' => array( 221 'type' => 'select', 222 'name' => 'tbl_op', 223 'caption' => $sChooseOperationC, 224 'values' => array ( 225 2 => $sBackup1C, 226 0 => $sBackup2C, 227 1 => $sBackup3C, 228 ), 229 ), 230 'tbl' => array( 231 'type' => 'select', 232 'name' => 'tbl', 233 'caption' => '', 234 'values' => $aTablesOptions, 235 ), 236 'savetype' => array( 237 'type' => 'radio_set', 238 'name' => 'savetype', 239 'caption' => $sActionC, 240 'values' => array ( 241 'server' => $sSaveOption1C, 242 'client' => $sSaveOption2C, 243 'show' => $sSaveOption3C, 244 ), 245 ), 246 'tables_backup_tool' => array( 247 'type' => 'submit', 248 'name' => 'tables_backup_tool', 249 'caption' => '', 250 'value' => $sBackupTableC, 251 ), 252 ), 253 ); 254 255 $oForm = new BxTemplFormView($aForm); 256 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . $sStatusText)); 257 //return DesignBoxContent(_t('_adm_dbtools_Tables_backup_tools'), '<div style="margin:9px;">' . $oForm->getCode() . '</div>' . $sStatusText, 1); 258 258 } 259 259 260 260 function DatabaseBackupTools($status_text) { 261 $sChooseOperationC = _t('_adm_dbtools_Choose_operation');262 $sBackup1C = _t('_adm_dbtools_Backup_structure_content');263 $sBackup2C = _t('_adm_dbtools_Backup_structure');264 $sSaveOption1C = _t('_adm_dbtools_Save_to_server');265 $sSaveOption2C = _t('_adm_dbtools_Save_to_your_PC');266 $sSaveOption3C = _t('_adm_dbtools_Show_on_the_screen');267 $sBackupDatabaseC = _t('_adm_dbtools_Backup_database');268 $sActionC = _t('_Action');269 270 $sStatusText = ($status_text and isset($_POST['DatabasesBackup'])) ? $status_text : '';271 272 $aForm = array(273 'form_attrs' => array(274 'name' => 'DatabaseBackupTools_form',275 'action' => $GLOBALS['site']['url_admin'] . 'db.php',276 'method' => 'post',277 ),278 'inputs' => array(279 'DatabasesBackup' => array(280 'type' => 'hidden',281 'name' => 'DatabasesBackup',282 'value' => 'YES',283 ),284 'db_op' => array(285 'type' => 'select',286 'name' => 'db_op',287 'caption' => $sChooseOperationC,288 'values' => array (289 2 => $sBackup1C,290 0 => $sBackup2C,291 ),292 ),293 'savetype' => array(294 'type' => 'radio_set',295 'name' => 'savetype',296 'caption' => $sActionC,297 'values' => array (298 'server' => $sSaveOption1C,299 'client' => $sSaveOption2C,300 'show' => $sSaveOption3C,301 ),302 ),303 'database_backup_tool' => array(304 'type' => 'submit',305 'name' => 'database_backup_tool',306 'caption' => '',307 'value' => $sBackupDatabaseC,308 ),309 ),310 );311 312 $oForm = new BxTemplFormView($aForm);313 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . $sStatusText));314 //return DesignBoxContent(_t('_adm_dbtools_Database_backup_tools'), '<div style="margin:9px;">' . $oForm->getCode() . '</div>' . $sStatusText, 1);261 $sChooseOperationC = _t('_adm_dbtools_Choose_operation'); 262 $sBackup1C = _t('_adm_dbtools_Backup_structure_content'); 263 $sBackup2C = _t('_adm_dbtools_Backup_structure'); 264 $sSaveOption1C = _t('_adm_dbtools_Save_to_server'); 265 $sSaveOption2C = _t('_adm_dbtools_Save_to_your_PC'); 266 $sSaveOption3C = _t('_adm_dbtools_Show_on_the_screen'); 267 $sBackupDatabaseC = _t('_adm_dbtools_Backup_database'); 268 $sActionC = _t('_Action'); 269 270 $sStatusText = ($status_text and isset($_POST['DatabasesBackup'])) ? $status_text : ''; 271 272 $aForm = array( 273 'form_attrs' => array( 274 'name' => 'DatabaseBackupTools_form', 275 'action' => $GLOBALS['site']['url_admin'] . 'db.php', 276 'method' => 'post', 277 ), 278 'inputs' => array( 279 'DatabasesBackup' => array( 280 'type' => 'hidden', 281 'name' => 'DatabasesBackup', 282 'value' => 'YES', 283 ), 284 'db_op' => array( 285 'type' => 'select', 286 'name' => 'db_op', 287 'caption' => $sChooseOperationC, 288 'values' => array ( 289 2 => $sBackup1C, 290 0 => $sBackup2C, 291 ), 292 ), 293 'savetype' => array( 294 'type' => 'radio_set', 295 'name' => 'savetype', 296 'caption' => $sActionC, 297 'values' => array ( 298 'server' => $sSaveOption1C, 299 'client' => $sSaveOption2C, 300 'show' => $sSaveOption3C, 301 ), 302 ), 303 'database_backup_tool' => array( 304 'type' => 'submit', 305 'name' => 'database_backup_tool', 306 'caption' => '', 307 'value' => $sBackupDatabaseC, 308 ), 309 ), 310 ); 311 312 $oForm = new BxTemplFormView($aForm); 313 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . $sStatusText)); 314 //return DesignBoxContent(_t('_adm_dbtools_Database_backup_tools'), '<div style="margin:9px;">' . $oForm->getCode() . '</div>' . $sStatusText, 1); 315 315 } 316 316 317 317 function getDatabaseRestoreBlock($status_text) { 318 $sPleaseSelectDumpFileC = _t('_adm_dbtools_Please_select_dump_file');319 $sRestoreDataFromDumpC = _t('_adm_dbtools_Restore_data_from_dump');320 $sDeleteDumpFromServerC = _t('_adm_dbtools_Delete_dump_from_server');321 $sDatabaseRestoreFromPCC = _t('_adm_dbtools_Database_restore_from_your_PC');322 $sSendC = _t('_Send');323 $sSubmitC = _t('_Submit');324 $sActionC = _t('_Action');325 326 $aExistedFilesOptions = array();327 if ( $handle = @opendir(BX_DIRECTORY_PATH_ROOT.'backup/') ) {328 while ( $file = readdir($handle) ) { 329 if ( preg_match("/.sql/", $file) )330 $aExistedFilesOptions[$file] = $file;331 }332 }333 334 $sStatusText = ($status_text and isset($_POST['DatabasesRestore']) or isset($_FILES['sqlfile']) ) ? $status_text : '';335 336 $aForm = array(337 'form_attrs' => array(338 'name' => 'DatabaseRestore1_form',339 'action' => $GLOBALS['site']['url_admin'] . 'db.php',340 'method' => 'post',341 ),342 'inputs' => array(343 'DatabasesRestore' => array(344 'type' => 'hidden',345 'name' => 'DatabasesRestore',346 'value' => 'YES',347 ),348 'dump_file' => array(349 'type' => 'select',350 'name' => 'dump_file',351 'caption' => $sPleaseSelectDumpFileC,352 'values' => $aExistedFilesOptions,353 ),354 'savetype' => array(355 'type' => 'radio_set',356 'name' => 'savetype',357 'caption' => $sActionC,358 'values' => array (359 'restore' => $sRestoreDataFromDumpC,360 'delete' => $sDeleteDumpFromServerC,361 ),362 'value' => 'restore',363 ),364 'DatabaseRestore1' => array(365 'type' => 'submit',366 'name' => 'DatabaseRestore1',367 'caption' => '',368 'value' => $sSubmitC,369 ),370 ),371 );372 $oForm = new BxTemplFormView($aForm);373 374 $aForm2 = array(375 'form_attrs' => array(376 'name' => 'DatabaseRestore1_form',377 'action' => $GLOBALS['site']['url_admin'] . 'db.php',378 'method' => 'post',379 'enctype' => 'multipart/form-data',380 ),381 'inputs' => array(382 'header1' => array(383 'type' => 'block_header',384 'caption' => $sDatabaseRestoreFromPCC,385 ),386 'sqlfile' => array(387 'type' => 'file',388 'name' => 'sqlfile',389 'caption' => $sPleaseSelectDumpFileC,390 'required' => true,391 ),392 'DatabaseRestore2' => array(393 'type' => 'submit',394 'name' => 'DatabaseRestore2',395 'caption' => '',396 'value' => $sSendC,397 ),398 ),399 );400 $oForm2 = new BxTemplFormView($aForm2);401 402 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . '<br />' . $oForm2->getCode() . $sStatusText)); 318 $sPleaseSelectDumpFileC = _t('_adm_dbtools_Please_select_dump_file'); 319 $sRestoreDataFromDumpC = _t('_adm_dbtools_Restore_data_from_dump'); 320 $sDeleteDumpFromServerC = _t('_adm_dbtools_Delete_dump_from_server'); 321 $sDatabaseRestoreFromPCC = _t('_adm_dbtools_Database_restore_from_your_PC'); 322 $sSendC = _t('_Send'); 323 $sSubmitC = _t('_Submit'); 324 $sActionC = _t('_Action'); 325 326 $aExistedFilesOptions = array(); 327 if ( $handle = @opendir(BX_DIRECTORY_PATH_ROOT.'backup/') ) { 328 while ( $file = readdir($handle) ) { 329 if ( preg_match("/.sql/", $file) ) 330 $aExistedFilesOptions[$file] = $file; 331 } 332 } 333 334 $sStatusText = ($status_text and isset($_POST['DatabasesRestore']) or isset($_FILES['sqlfile']) ) ? $status_text : ''; 335 336 $aForm = array( 337 'form_attrs' => array( 338 'name' => 'DatabaseRestore1_form', 339 'action' => $GLOBALS['site']['url_admin'] . 'db.php', 340 'method' => 'post', 341 ), 342 'inputs' => array( 343 'DatabasesRestore' => array( 344 'type' => 'hidden', 345 'name' => 'DatabasesRestore', 346 'value' => 'YES', 347 ), 348 'dump_file' => array( 349 'type' => 'select', 350 'name' => 'dump_file', 351 'caption' => $sPleaseSelectDumpFileC, 352 'values' => $aExistedFilesOptions, 353 ), 354 'savetype' => array( 355 'type' => 'radio_set', 356 'name' => 'savetype', 357 'caption' => $sActionC, 358 'values' => array ( 359 'restore' => $sRestoreDataFromDumpC, 360 'delete' => $sDeleteDumpFromServerC, 361 ), 362 'value' => 'restore', 363 ), 364 'DatabaseRestore1' => array( 365 'type' => 'submit', 366 'name' => 'DatabaseRestore1', 367 'caption' => '', 368 'value' => $sSubmitC, 369 ), 370 ), 371 ); 372 $oForm = new BxTemplFormView($aForm); 373 374 $aForm2 = array( 375 'form_attrs' => array( 376 'name' => 'DatabaseRestore1_form', 377 'action' => $GLOBALS['site']['url_admin'] . 'db.php', 378 'method' => 'post', 379 'enctype' => 'multipart/form-data', 380 ), 381 'inputs' => array( 382 'header1' => array( 383 'type' => 'block_header', 384 'caption' => $sDatabaseRestoreFromPCC, 385 ), 386 'sqlfile' => array( 387 'type' => 'file', 388 'name' => 'sqlfile', 389 'caption' => $sPleaseSelectDumpFileC, 390 'required' => true, 391 ), 392 'DatabaseRestore2' => array( 393 'type' => 'submit', 394 'name' => 'DatabaseRestore2', 395 'caption' => '', 396 'value' => $sSendC, 397 ), 398 ), 399 ); 400 $oForm2 = new BxTemplFormView($aForm2); 401 402 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . '<br />' . $oForm2->getCode() . $sStatusText)); 403 403 } 404 404 -
trunk/administration/email_templates.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 36 36 $logged['admin'] = member_auth( 1, true, true ); 37 37 38 $oSettings = new BxDolAdminSettings(4); 38 $oSettings = new BxDolAdminSettings(4); 39 39 40 40 //--- Process submit ---// … … 47 47 if(empty($aTranslation)) 48 48 $aTranslation = $GLOBALS['MySQL']->getRow("SELECT `Subject` AS `subject`, `Body` AS `body` FROM `sys_email_templates` WHERE `Name`='" . process_db_input($_POST['templ_name']) . "' AND `LangID`='0' LIMIT 1"); 49 50 $oJson = new Services_JSON(); 49 50 $oJson = new Services_JSON(); 51 51 echo $oJson->encode(array('subject' => $aTranslation['subject'], 'body' => $aTranslation['body'])); 52 52 exit; … … 58 58 'css_name' => array('forms_adv.css', 'settings.css'), 59 59 'js_name' => array('email_templates.js'), 60 'header' => _t('_adm_page_cpt_email_templates'), 60 'header' => _t('_adm_page_cpt_email_templates'), 61 61 ); 62 62 $_page_cont[$iNameIndex] = array( … … 69 69 function PageCodeSettings($mixedResult) { 70 70 71 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $GLOBALS['oSettings']->getForm())); 71 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $GLOBALS['oSettings']->getForm())); 72 72 if($mixedResult !== true && !empty($mixedResult)) 73 73 $sResult = $mixedResult . $sResult; 74 74 75 75 return DesignBoxAdmin(_t('_adm_box_cpt_email_settings'), $sResult); 76 76 } … … 97 97 98 98 $aLanguages = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Title` AS `title` FROM `sys_localization_languages`"); 99 99 100 100 $aLanguageChooser = array(array('key' => 0, 'value' => 'default')); 101 101 foreach($aLanguages as $aLanguage) 102 102 $aLanguageChooser[] = array('key' => $aLanguage['id'], 'value' => $aLanguage['title']); 103 103 104 104 $sLanguageCpt = _t('_adm_txt_email_language'); 105 105 $sSubjectCpt = _t('_adm_txt_email_subject'); … … 151 151 )); 152 152 } 153 153 154 154 $aForm['inputs']['adm-emial-templates-save'] = array( 155 155 'type' => 'submit', … … 171 171 $iResult += (int)$GLOBALS['MySQL']->query("INSERT INTO `sys_email_templates` SET `Name`='" . process_db_input($aEmail['name']) . "', `Subject`='" . process_db_input($_POST[$aEmail['name'] . '_Subject']) . "', `Body`='" . process_db_input($_POST[$aEmail['name'] . '_Body']) . "', `LangID`='" . (int)$_POST[$aEmail['name'] . '_Language'] . "'"); 172 172 } 173 173 174 174 $sResult .= MsgBox(_t($iResult > 0 ? "_adm_txt_email_success_save" : "_adm_txt_email_nothing_changed"), 3); 175 175 } -
trunk/administration/fields.parse.php
r15201 r15211 22 22 23 23 switch(bx_get('action')) { 24 case 'getArea':25 genAreaJSON((int)bx_get('id'));26 break;27 case 'createNewBlock':28 createNewBlock();29 break;30 case 'createNewItem':31 createNewItem();32 break;33 case 'savePositions':34 savePositions((int)bx_get('id'));35 break;36 case 'loadEditForm':37 showEditForm((int)bx_get('id'), (int)bx_get('area'));38 break;39 case 'dummy':40 echo 'Dummy!';41 break;42 case 'Save'://save item43 saveItem((int)bx_get('area'), $_POST);44 break;45 case 'Delete'://delete item46 deleteItem((int)bx_get('id'), (int)bx_get('area'));47 break;24 case 'getArea': 25 genAreaJSON((int)bx_get('id')); 26 break; 27 case 'createNewBlock': 28 createNewBlock(); 29 break; 30 case 'createNewItem': 31 createNewItem(); 32 break; 33 case 'savePositions': 34 savePositions((int)bx_get('id')); 35 break; 36 case 'loadEditForm': 37 showEditForm((int)bx_get('id'), (int)bx_get('area')); 38 break; 39 case 'dummy': 40 echo 'Dummy!'; 41 break; 42 case 'Save'://save item 43 saveItem((int)bx_get('area'), $_POST); 44 break; 45 case 'Delete'://delete item 46 deleteItem((int)bx_get('id'), (int)bx_get('area')); 47 break; 48 48 } 49 49 50 50 function createNewBlock() { 51 $oFields = new BxDolPFM( 1 );52 $iNewID = $oFields -> createNewBlock();53 header('Content-Type:text/javascript');54 echo '{id:' . $iNewID . '}';51 $oFields = new BxDolPFM( 1 ); 52 $iNewID = $oFields -> createNewBlock(); 53 header('Content-Type:text/javascript'); 54 echo '{id:' . $iNewID . '}'; 55 55 } 56 56 57 57 function createNewItem() { 58 $oFields = new BxDolPFM( 1 );59 $iNewID = $oFields -> createNewField();58 $oFields = new BxDolPFM( 1 ); 59 $iNewID = $oFields -> createNewField(); 60 60 61 bx_import('BxDolInstallerUtils');62 $oInstallerUtils = new BxDolInstallerUtils();63 $oInstallerUtils->updateProfileFieldsHtml();64 65 header('Content-Type:text/javascript');66 echo '{id:' . $iNewID . '}';61 bx_import('BxDolInstallerUtils'); 62 $oInstallerUtils = new BxDolInstallerUtils(); 63 $oInstallerUtils->updateProfileFieldsHtml(); 64 65 header('Content-Type:text/javascript'); 66 echo '{id:' . $iNewID . '}'; 67 67 } 68 68 69 69 function genAreaJSON( $iAreaID ) { 70 $oFields = new BxDolPFM( $iAreaID );71 72 header( 'Content-Type:text/javascript' );73 echo $oFields -> genJSON();70 $oFields = new BxDolPFM( $iAreaID ); 71 72 header( 'Content-Type:text/javascript' ); 73 echo $oFields -> genJSON(); 74 74 } 75 75 76 76 function savePositions( $iAreaID ) { 77 $oFields = new BxDolPFM( $iAreaID ); 78 79 header( 'Content-Type:text/javascript' ); 80 $oFields -> savePositions( $_POST ); 77 $oFields = new BxDolPFM( $iAreaID ); 81 78 82 $oCacher = new BxDolPFMCacher(); 83 $oCacher -> createCache(); 79 header( 'Content-Type:text/javascript' ); 80 $oFields -> savePositions( $_POST ); 81 82 $oCacher = new BxDolPFMCacher(); 83 $oCacher -> createCache(); 84 84 } 85 85 86 86 function saveItem( $iAreaID, $aData ) { 87 $oFields = new BxDolPFM( $iAreaID );88 $oFields -> saveItem( $_POST );87 $oFields = new BxDolPFM( $iAreaID ); 88 $oFields -> saveItem( $_POST ); 89 89 90 bx_import('BxDolInstallerUtils');91 $oInstallerUtils = new BxDolInstallerUtils();92 $oInstallerUtils->updateProfileFieldsHtml();90 bx_import('BxDolInstallerUtils'); 91 $oInstallerUtils = new BxDolInstallerUtils(); 92 $oInstallerUtils->updateProfileFieldsHtml(); 93 93 94 $oCacher = new BxDolPFMCacher();95 $oCacher -> createCache();94 $oCacher = new BxDolPFMCacher(); 95 $oCacher -> createCache(); 96 96 } 97 97 98 98 function deleteItem( $iItemID, $iAreaID ) { 99 $oFields = new BxDolPFM( $iAreaID );100 $oFields -> deleteItem( $iItemID );99 $oFields = new BxDolPFM( $iAreaID ); 100 $oFields -> deleteItem( $iItemID ); 101 101 102 bx_import('BxDolInstallerUtils');103 $oInstallerUtils = new BxDolInstallerUtils();104 $oInstallerUtils->updateProfileFieldsHtml();102 bx_import('BxDolInstallerUtils'); 103 $oInstallerUtils = new BxDolInstallerUtils(); 104 $oInstallerUtils->updateProfileFieldsHtml(); 105 105 106 $oCacher = new BxDolPFMCacher();107 $oCacher -> createCache();106 $oCacher = new BxDolPFMCacher(); 107 $oCacher -> createCache(); 108 108 } 109 109 110 110 function showEditForm( $iItemID, $iAreaID ) { 111 $oFields = new BxDolPFM( $iAreaID );112 113 ob_start();114 ?>115 <form name="fieldEditForm" method="post" action="<?=$GLOBALS['site']['url_admin'] . 'fields.parse.php'; ?>" target="fieldFormSubmit" onsubmit="clearFormErrors( this )">111 $oFields = new BxDolPFM( $iAreaID ); 112 113 ob_start(); 114 ?> 115 <form name="fieldEditForm" method="post" action="<?=$GLOBALS['site']['url_admin'] . 'fields.parse.php'; ?>" target="fieldFormSubmit" onsubmit="clearFormErrors( this )"> 116 116 <div class="edit_item_table_cont"> 117 117 <?=$oFields -> genFieldEditForm( $iItemID ); ?> 118 118 </div> 119 </form>119 </form> 120 120 121 <iframe name="fieldFormSubmit" style="display:none;"></iframe>122 <?123 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => ob_get_clean()));121 <iframe name="fieldFormSubmit" style="display:none;"></iframe> 122 <? 123 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => ob_get_clean())); 124 124 125 echo PopupBox('pf_edit_popup', _t('_adm_fields_box_cpt_field'), $sResult);125 echo PopupBox('pf_edit_popup', _t('_adm_fields_box_cpt_field'), $sResult); 126 126 } 127 127 -
trunk/administration/fields.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 42 42 'css_name' => array('fields.css'), 43 43 'js_name' => array('ui.core.js', 'ui.tabs.js', 'ui.sortable.js', 'fields.js'), 44 'header' => _t('_adm_fields_title') 44 'header' => _t('_adm_fields_title') 45 45 ); 46 46 $_page_cont[$iNameIndex]['page_main_code'] = DesignBoxAdmin( … … 49 49 array( 50 50 'adm-fb-ctl-m1' => array( 51 'title' => _t('_adm_fields_join_form'), 51 'title' => _t('_adm_fields_join_form'), 52 52 'href' => 'javascript:void(0)', 53 53 'onclick' => 'javascript:changeType(this)', … … 76 76 77 77 $GLOBALS['oAdmTemplate']->addJsTranslation(array( 78 '_adm_mbuilder_active_items',79 '_adm_txt_pb_inactive_blocks',80 '_adm_mbuilder_inactive_items'78 '_adm_mbuilder_active_items', 79 '_adm_txt_pb_inactive_blocks', 80 '_adm_mbuilder_inactive_items' 81 81 )); 82 82 -
trunk/administration/flash.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ -
trunk/administration/help.html
r15201 r15211 6 6 7 7 .spec 8 {9 float:left;10 width:80px;11 height:20px;12 position:relative;13 border: 1px solid silver;14 text-align : center;15 }8 { 9 float:left; 10 width:80px; 11 height:20px; 12 position:relative; 13 border: 1px solid silver; 14 text-align : center; 15 } 16 16 17 17 .desc 18 {19 float:left;20 width:360px;21 height:20px;22 position:relative;23 border: 1px solid silver;24 }18 { 19 float:left; 20 width:360px; 21 height:20px; 22 position:relative; 23 border: 1px solid silver; 24 } 25 25 26 26 </style> … … 45 45 <table border=1> 46 46 <tr > 47 <td ><b>Separator</b></td>48 <td><b>Format</b></td>49 <td><b>Result</b></td>47 <td ><b>Separator</b></td> 48 <td><b>Format</b></td> 49 <td><b>Result</b></td> 50 50 </tr> 51 51 <tr align=center> 52 <td>.</td>53 <td>Day.Month.YYYY</td>54 <td>%d.%m.%Y</td>52 <td>.</td> 53 <td>Day.Month.YYYY</td> 54 <td>%d.%m.%Y</td> 55 55 56 56 </tr> 57 57 58 58 <tr align=center> 59 <td>/</td>60 <td>Month/Day/Year</td>61 <td>%m/%d/%Y</td>59 <td>/</td> 60 <td>Month/Day/Year</td> 61 <td>%m/%d/%Y</td> 62 62 63 63 </tr> 64 64 <tr align=center> 65 <td>*</td>66 <td>Month*Day*Year</td>67 <td>%m*%d*%Y</td>65 <td>*</td> 66 <td>Month*Day*Year</td> 67 <td>%m*%d*%Y</td> 68 68 69 69 </tr> 70 70 71 71 <tr align=center> 72 <td colspan=3 >some other separators: - : ; -- </b></td>72 <td colspan=3 >some other separators: - : ; -- </b></td> 73 73 74 74 </tr> -
trunk/administration/host_tools.php
r15201 r15211 20 20 21 21 switch(bx_get('action')) { 22 case 'cache_engines':23 $sResult .= $oAdmTools->GenCacheEnginesTable();24 break;25 case 'perm_table':26 $sResult .= $oAdmTools->GenPermTable();27 break;28 case 'main_params':29 $sResult .= $oAdmTools->GenMainParamsTable();30 break;31 case 'main_page':32 $sResult .= $oAdmTools->GenTabbedPage();33 break;34 default:35 $sResult .= $oAdmTools->GenTabbedPage();36 break;22 case 'cache_engines': 23 $sResult .= $oAdmTools->GenCacheEnginesTable(); 24 break; 25 case 'perm_table': 26 $sResult .= $oAdmTools->GenPermTable(); 27 break; 28 case 'main_params': 29 $sResult .= $oAdmTools->GenMainParamsTable(); 30 break; 31 case 'main_page': 32 $sResult .= $oAdmTools->GenTabbedPage(); 33 break; 34 default: 35 $sResult .= $oAdmTools->GenTabbedPage(); 36 break; 37 37 } 38 38 -
trunk/administration/index.php
r15201 r15211 22 22 $iId = getID($_POST['ID']); 23 23 $sPassword = bx_process_input($_POST['Password']); 24 24 25 25 $oZ = new BxDolAlerts('profile', 'before_login', 0, 0, array('login' => $iId, 'password' => $sPassword, 'ip' => getVisitorIP())); 26 26 $oZ->alert(); … … 39 39 db_res("insert into `sys_options` (`Name`, `VALUE`, `desc`, `Type`) values ('enable_dolphin_footer', 'on', 'enable boonex footers', 'checkbox')"); 40 40 41 if ((isset($_REQUEST['license_code']) && $_REQUEST['license_code']) || (getParam("license_expiration") && time() > getParam("license_expiration"))) { 41 if ((isset($_REQUEST['license_code']) && $_REQUEST['license_code']) || (getParam("license_expiration") && time() > getParam("license_expiration"))) { 42 42 $bDol = checkDolphinLicense(); 43 43 setParam('enable_dolphin_footer', ($bDol ? '' : 'on')); 44 44 } elseif (getParam("license_code")) { 45 $sDomain = BX_DOL_URL_ROOT;46 if (preg_match('/https?:\/\/([a-zA-Z0-9\.-]+)[:\/]/', $sDomain, $m)) $sDomain = str_replace('www.','',$m[1]);45 $sDomain = BX_DOL_URL_ROOT; 46 if (preg_match('/https?:\/\/([a-zA-Z0-9\.-]+)[:\/]/', $sDomain, $m)) $sDomain = str_replace('www.','',$m[1]); 47 47 $s = md5(base64_encode(serialize(array(getParam("enable_dolphin_footer"), getParam("license_code"), getParam("license_expiration"), $sDomain)))); for ($i=0 ; $i<32 ; ++$i) $s[$i] = ord($s[$i]) + $i; $s = md5($s); 48 48 if ($s != getParam("license_checksum")) { … … 89 89 90 90 if(!isAdmin()) { 91 send_headers_page_changed();92 login_form("", 1);93 exit();91 send_headers_page_changed(); 92 login_form("", 1); 93 exit(); 94 94 } 95 95 96 96 if(bx_get('boonex_news') !== false) 97 setParam("news_enable", (int)bx_get('boonex_news')); 97 setParam("news_enable", (int)bx_get('boonex_news')); 98 98 99 99 $logged['admin'] = member_auth( 1, true, true ); 100 100 101 101 if(bx_get('cat') !== false) 102 PageCategoryCode(bx_get('cat'));103 else 102 PageCategoryCode(bx_get('cat')); 103 else 104 104 PageMainCode(); 105 105 … … 109 109 110 110 bx_import('BxDolAdminDashboard'); 111 111 112 112 $sHtml = DesignBoxAdmin(_t('_adm_box_cpt_overview'), BxDolAdminDashboard::getCode()); 113 113 … … 123 123 $sHtml .= DesignBoxAdmin (_t('_adm_box_cpt_featured_modules'), BxTemplFunctions::getInstance()->getRssHolder ('boonex_unity_market_featured', 5, 0, $oTemplate)); 124 124 } 125 125 126 126 $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT); 127 127 $oTemplate->setPageHeader (_t('_adm_page_cpt_dashboard')); … … 131 131 function PageCategoryCode($sCategoryName) { 132 132 133 $oDb = BxDolDb::getInstance();134 133 $oDb = BxDolDb::getInstance(); 134 135 135 $oTemplate = BxDolTemplateAdmin::getInstance(); 136 136 137 $aItems = $oDb->getAll("SELECT `tma1`.`title` AS `title`, `tma1`.`url` AS `url`, `tma1`.`description` AS `description`, `tma1`.`icon` AS `icon`, `tma1`.`check` AS `check` FROM `sys_menu_admin` AS `tma1` LEFT JOIN `sys_menu_admin` AS `tma2` ON `tma1`.`parent_id`=`tma2`.`id` WHERE `tma2`.`name`='" . $sCategoryName . "' ORDER BY `tma1`.`Order`");137 $aItems = $oDb->getAll("SELECT `tma1`.`title` AS `title`, `tma1`.`url` AS `url`, `tma1`.`description` AS `description`, `tma1`.`icon` AS `icon`, `tma1`.`check` AS `check` FROM `sys_menu_admin` AS `tma1` LEFT JOIN `sys_menu_admin` AS `tma2` ON `tma1`.`parent_id`=`tma2`.`id` WHERE `tma2`.`name`='" . $sCategoryName . "' ORDER BY `tma1`.`Order`"); 138 138 139 foreach($aItems as $aItem) {140 if(strlen($aItem['check']) > 0) {141 $oFunction = create_function('', $aItem['check']);142 if(!$oFunction())139 foreach($aItems as $aItem) { 140 if(strlen($aItem['check']) > 0) { 141 $oFunction = create_function('', $aItem['check']); 142 if(!$oFunction()) 143 143 continue; 144 }144 } 145 145 146 $aItem['url'] = str_replace(array('{siteUrl}', '{siteAdminUrl}'), array(BX_DOL_URL_ROOT, BX_DOL_URL_ADMIN), $aItem['url']);147 list($sLink, $sOnClick) = BxDolAdminMenu::getMainMenuLink($aItem['url']);148 149 $aVariables[] = array(146 $aItem['url'] = str_replace(array('{siteUrl}', '{siteAdminUrl}'), array(BX_DOL_URL_ROOT, BX_DOL_URL_ADMIN), $aItem['url']); 147 list($sLink, $sOnClick) = BxDolAdminMenu::getMainMenuLink($aItem['url']); 148 149 $aVariables[] = array( 150 150 'icon' => $oTemplate->getIconUrl($aItem['icon']), 151 151 'link' => $sLink, … … 153 153 'title' => _t($aItem['title']), 154 154 'description' => $aItem['description'] 155 ); 156 } 155 ); 156 } 157 157 158 $sPageTitle = _t($oDb->getOne("SELECT `title` FROM `sys_menu_admin` WHERE `name`='" . $sCategoryName . "' LIMIT 1"));159 $sPageContent = $oTemplate->parseHtmlByName('categories.html', array('bx_repeat:items' => $aVariables));158 $sPageTitle = _t($oDb->getOne("SELECT `title` FROM `sys_menu_admin` WHERE `name`='" . $sCategoryName . "' LIMIT 1")); 159 $sPageContent = $oTemplate->parseHtmlByName('categories.html', array('bx_repeat:items' => $aVariables)); 160 160 $sPageContent = DesignBoxAdmin($sPageTitle, $sPageContent); 161 161 -
trunk/administration/ip_blacklist.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 34 34 $sResult = ''; 35 35 switch(bx_get('action')) { 36 case 'apply_delete':37 $oBxDolAdminIpBlockList->ActionApplyDelete();38 $sResult .= $oBxDolAdminIpBlockList->GenIPBlackListTable();39 break;36 case 'apply_delete': 37 $oBxDolAdminIpBlockList->ActionApplyDelete(); 38 $sResult .= $oBxDolAdminIpBlockList->GenIPBlackListTable(); 39 break; 40 40 } 41 41 -
trunk/administration/js/email_templates.js
r15201 r15211 25 25 var iLangId = $(oSelect).val(); 26 26 var sTemplName = $(oSelect).attr('name').replace('_Language', ''); 27 27 28 28 $('#adm-email-loading').bx_loading(); 29 29 30 30 $.post( 31 31 sAdminUrl + 'email_templates.php', … … 37 37 function(oResult) { 38 38 $('#adm-email-loading').bx_loading(); 39 39 40 40 $("[name='" + sTemplName + "_Subject']").val(oResult.subject); 41 41 $("[name='" + sTemplName + "_Body']").val(oResult.body); -
trunk/administration/js/fields.js
r15201 r15211 4 4 5 5 function BxDolPFM( aAreas ) { 6 this.config = {7 areas: 0,8 parserUrl: '',9 inactiveColumns: 4,10 getAreaElem : function(id) { //function to get the area element. made to customizability11 var $area = $( '#m' + id + ' > div.build_container' );6 this.config = { 7 areas: 0, 8 parserUrl: '', 9 inactiveColumns: 4, 10 getAreaElem : function(id) { //function to get the area element. made to customizability 11 var $area = $( '#m' + id + ' > div.build_container' ); 12 12 return $area.length ? $area.get(0) : false; 13 }14 };15 16 this.areas = new Array();13 } 14 }; 15 16 this.areas = new Array(); 17 17 } 18 18 … … 20 20 21 21 BxDolPFM.prototype.init = function() { 22 //generate areas22 //generate areas 23 23 for (var iInd = 1; iInd <= this.config.areas; iInd ++) { //we will begin ID's from 1 ! 24 24 var area = new BxDolPFMArea(this, iInd); 25 25 if (!area.element) 26 26 continue; 27 27 28 28 this.areas[this.areas.length] = area; 29 29 } … … 31 31 32 32 BxDolPFM.prototype.getAreaByID = function( iAreaID ) { 33 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ )34 if( this.areas[iAreaInd].id == iAreaID )35 return this.areas[iAreaInd];36 37 return false;33 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ ) 34 if( this.areas[iAreaInd].id == iAreaID ) 35 return this.areas[iAreaInd]; 36 37 return false; 38 38 } 39 39 40 40 BxDolPFM.prototype.updateAreas = function( sText, iItemID, sNewName, iAreaID ) { 41 switch( sText ) {42 case 'deleteItem':43 location.reload();44 break;45 46 case 'updateItem':47 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ )48 this.areas[iAreaInd].getItemOrBlockByID( iItemID ).updateName( sNewName );49 break;50 51 case 'newBlock':52 if( !iItemID ) {53 alert( 'Sorry couldn\'t insert new block. Please check if NEW BLOCK already exists.' );54 this.getAreaByID( iAreaID ).moveFakeBlockBack();55 } else {56 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ ) {57 var oArea = this.areas[iAreaInd];58 59 oArea.insertNewBlock( iItemID );60 oArea.moveFakeBlockBack();61 62 if( oArea.id == iAreaID )63 oArea.resortAndSubmit();64 else65 oArea.resortArrays(); // do not submit positions for other areas66 }67 }68 break;69 70 case 'newItem':71 if( !iItemID ) {72 alert( 'Sorry couldn\'t insert new item. Please check if NEW_ITEM already exists.' );73 this.getAreaByID( iAreaID ).moveFakeItemBack();74 } else {75 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ ) {76 var oArea = this.areas[iAreaInd];77 78 oArea.insertNewItem( iItemID );79 oArea.moveFakeItemBack();80 81 if( oArea.id == iAreaID )82 oArea.resortAndSubmit();83 else84 oArea.resortArrays(); // do not submit positions for other areas85 }86 }87 break;88 }41 switch( sText ) { 42 case 'deleteItem': 43 location.reload(); 44 break; 45 46 case 'updateItem': 47 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ ) 48 this.areas[iAreaInd].getItemOrBlockByID( iItemID ).updateName( sNewName ); 49 break; 50 51 case 'newBlock': 52 if( !iItemID ) { 53 alert( 'Sorry couldn\'t insert new block. Please check if NEW BLOCK already exists.' ); 54 this.getAreaByID( iAreaID ).moveFakeBlockBack(); 55 } else { 56 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ ) { 57 var oArea = this.areas[iAreaInd]; 58 59 oArea.insertNewBlock( iItemID ); 60 oArea.moveFakeBlockBack(); 61 62 if( oArea.id == iAreaID ) 63 oArea.resortAndSubmit(); 64 else 65 oArea.resortArrays(); // do not submit positions for other areas 66 } 67 } 68 break; 69 70 case 'newItem': 71 if( !iItemID ) { 72 alert( 'Sorry couldn\'t insert new item. Please check if NEW_ITEM already exists.' ); 73 this.getAreaByID( iAreaID ).moveFakeItemBack(); 74 } else { 75 for( var iAreaInd = 0; iAreaInd < this.areas.length; iAreaInd ++ ) { 76 var oArea = this.areas[iAreaInd]; 77 78 oArea.insertNewItem( iItemID ); 79 oArea.moveFakeItemBack(); 80 81 if( oArea.id == iAreaID ) 82 oArea.resortAndSubmit(); 83 else 84 oArea.resortArrays(); // do not submit positions for other areas 85 } 86 } 87 break; 88 } 89 89 } 90 90 … … 95 95 96 96 function BxDolPFMArea(parent, id) { 97 this.id = id;98 this.parent = parent;99 97 this.id = id; 98 this.parent = parent; 99 100 100 this.getElement(); 101 101 102 102 if (!this.element) 103 103 return false; 104 105 106 this.active_blocks = new Array();107 this.inactive_blocks = new Array();108 this.active_items = new Array();109 this.inactive_items = new Array();110 111 this.activeZoneElemID = 'area_' + this.id + '_active'112 this.inactiveItemsZoneElemID = 'area_' + this.id + '_items_inactive'113 this.inactiveBlocksZoneElemID = 'area_' + this.id + '_blocks_inactive'114 115 this.requestData();104 105 106 this.active_blocks = new Array(); 107 this.inactive_blocks = new Array(); 108 this.active_items = new Array(); 109 this.inactive_items = new Array(); 110 111 this.activeZoneElemID = 'area_' + this.id + '_active' 112 this.inactiveItemsZoneElemID = 'area_' + this.id + '_items_inactive' 113 this.inactiveBlocksZoneElemID = 'area_' + this.id + '_blocks_inactive' 114 115 this.requestData(); 116 116 } 117 117 118 118 BxDolPFMArea.prototype.getElement = function() { 119 this.element = this.parent.config.getAreaElem(this.id);119 this.element = this.parent.config.getAreaElem(this.id); 120 120 } 121 121 122 122 BxDolPFMArea.prototype.requestData = function() { 123 var oThisArea = this;124 $.getJSON(125 this.parent.config.parserUrl,126 {action: 'getArea', id: this.id},127 function(oAreaData){128 oThisArea.getData(oAreaData);129 }130 );123 var oThisArea = this; 124 $.getJSON( 125 this.parent.config.parserUrl, 126 {action: 'getArea', id: this.id}, 127 function(oAreaData){ 128 oThisArea.getData(oAreaData); 129 } 130 ); 131 131 } 132 132 133 133 BxDolPFMArea.prototype.getData = function(oAreaData) { 134 if( this.id != oAreaData.id )135 return false;136 137 for( var iBlockInd = 0; iBlockInd < oAreaData.active_blocks.length; iBlockInd++ ) this.active_blocks[ this.active_blocks.length ] = new BxDolPFMBlock( this, oAreaData.active_blocks[ iBlockInd ] );138 for( var iBlockInd = 0; iBlockInd < oAreaData.inactive_blocks.length; iBlockInd++ ) this.inactive_blocks[ this.inactive_blocks.length ] = new BxDolPFMBlock( this, oAreaData.inactive_blocks[ iBlockInd ] );139 for( var iItemInd = 0; iItemInd < oAreaData.active_items.length; iItemInd ++ ) this.active_items[ this.active_items.length ] = new BxDolPFMItem( this, oAreaData.active_items[ iItemInd ] );140 for( var iItemInd = 0; iItemInd < oAreaData.inactive_items.length; iItemInd ++ ) this.inactive_items[ this.inactive_items.length ] = new BxDolPFMItem( this, oAreaData.inactive_items[ iItemInd ] );141 142 this.draw();134 if( this.id != oAreaData.id ) 135 return false; 136 137 for( var iBlockInd = 0; iBlockInd < oAreaData.active_blocks.length; iBlockInd++ ) this.active_blocks[ this.active_blocks.length ] = new BxDolPFMBlock( this, oAreaData.active_blocks[ iBlockInd ] ); 138 for( var iBlockInd = 0; iBlockInd < oAreaData.inactive_blocks.length; iBlockInd++ ) this.inactive_blocks[ this.inactive_blocks.length ] = new BxDolPFMBlock( this, oAreaData.inactive_blocks[ iBlockInd ] ); 139 for( var iItemInd = 0; iItemInd < oAreaData.active_items.length; iItemInd ++ ) this.active_items[ this.active_items.length ] = new BxDolPFMItem( this, oAreaData.active_items[ iItemInd ] ); 140 for( var iItemInd = 0; iItemInd < oAreaData.inactive_items.length; iItemInd ++ ) this.inactive_items[ this.inactive_items.length ] = new BxDolPFMItem( this, oAreaData.inactive_items[ iItemInd ] ); 141 142 this.draw(); 143 143 } 144 144 145 145 BxDolPFMArea.prototype.draw = function() { 146 $( this.element ).html( '' ); //clear element146 $( this.element ).html( '' ); //clear element 147 147 var sActiveItemsC = _t('_adm_mbuilder_active_items'); 148 148 var sInactiveItemsC = _t('_adm_mbuilder_inactive_items'); 149 149 var sInactiveBlocksC = _t('_adm_txt_pb_inactive_blocks'); 150 150 151 $( this.element ).append(152 '<div class="build_zone_header">'+sActiveItemsC+'</div>' +153 '<div class="blocks_cont_bord">' +154 '<div class="blocks_container" id="' + this.activeZoneElemID + '">' +155 '<div class="build_block_fake"></div>' +156 '</div>' +157 '</div>' +158 '<br style="height:20px;clear:both;" />' +159 '<div class="build_zone_header">'+sInactiveBlocksC+'</div>' +160 '<div class="blocks_cont_bord">' +161 '<div class="blocks_container" id="' + this.inactiveBlocksZoneElemID + '">' +162 '<div class="build_block_fake"></div>' +163 '</div>' +164 '</div>' +165 '<br style="height:20px;clear:both;" />' +166 '<div class="build_zone_header">'+sInactiveItemsC+'</div>' +167 '<div class="blocks_cont_bord build_block_inactive_items">' +168 '<div class="blocks_container" id="' + this.inactiveItemsZoneElemID + '">' +169 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_1">' +170 '<div class="build_item_fake"></div>' +171 '</div>' +172 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_2">' +173 '<div class="build_item_fake"></div>' +174 '</div>' +175 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_3">' +176 '<div class="build_item_fake"></div>' +177 '</div>' +178 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_4">' +179 '<div class="build_item_fake"></div>' +180 '</div>' +181 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_5">' +182 '<div class="build_item_fake"></div>' +183 '</div>' +184 '</div>' +185 '</div>'186 );187 188 this.activeZoneElement = $( '#' + this.activeZoneElemID ).get(0);189 this.inactiveBlocksZoneElement = $( '#' + this.inactiveBlocksZoneElemID ).get(0);190 this.inactiveItemsZoneElement = $( '#' + this.inactiveItemsZoneElemID ).get(0);191 192 //draw all active blocks193 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ ) {194 this.active_blocks[iBlockInd].draw( this.activeZoneElement );195 196 //draw subitems of block197 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ )198 if( this.active_items[iItemInd].block == this.active_blocks[iBlockInd].id )199 this.active_items[iItemInd].draw( this.active_blocks[iBlockInd].element );200 }201 202 //append NEW BLOCK element203 $( this.inactiveBlocksZoneElement ).append(204 '<div class="build_block" id="build_block_new_' + this.id + '">' +205 '<div class="build_block_header">NEW BLOCK</div>' +206 '</div>'207 );208 209 //append all inactive blocks210 for( var iBlockInd = 0; iBlockInd < this.inactive_blocks.length; iBlockInd ++ )211 this.inactive_blocks[iBlockInd].draw( this.inactiveBlocksZoneElement );212 213 //append NEW_ITEM element214 $( '#build_inac_items_area_' + this.id + '_col_1' ).append(215 '<div class="build_item_active" id="build_item_new_' + this.id + '">NEW_ITEM</div>'216 );217 218 //append all inactive items to 5 columns219 var iColCount = 2;220 for( var iItemInd = 0; iItemInd < this.inactive_items.length; iItemInd ++ ) {221 this.inactive_items[iItemInd].draw(222 $( '#build_inac_items_area_' + this.id + '_col_' + iColCount++ ).get(0)223 );224 225 if( iColCount > 5 ) iColCount = 1;226 }227 228 $( this.activeZoneElement ).append( '<div class="clear_both"></div>' );229 $( this.inactiveBlocksZoneElement ).append( '<div class="clear_both"></div>' );230 $( this.inactiveItemsZoneElement ).append( '<div class="clear_both"></div>' );231 232 this.fixZonesWidths();233 this.activateSortable();151 $( this.element ).append( 152 '<div class="build_zone_header">'+sActiveItemsC+'</div>' + 153 '<div class="blocks_cont_bord">' + 154 '<div class="blocks_container" id="' + this.activeZoneElemID + '">' + 155 '<div class="build_block_fake"></div>' + 156 '</div>' + 157 '</div>' + 158 '<br style="height:20px;clear:both;" />' + 159 '<div class="build_zone_header">'+sInactiveBlocksC+'</div>' + 160 '<div class="blocks_cont_bord">' + 161 '<div class="blocks_container" id="' + this.inactiveBlocksZoneElemID + '">' + 162 '<div class="build_block_fake"></div>' + 163 '</div>' + 164 '</div>' + 165 '<br style="height:20px;clear:both;" />' + 166 '<div class="build_zone_header">'+sInactiveItemsC+'</div>' + 167 '<div class="blocks_cont_bord build_block_inactive_items">' + 168 '<div class="blocks_container" id="' + this.inactiveItemsZoneElemID + '">' + 169 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_1">' + 170 '<div class="build_item_fake"></div>' + 171 '</div>' + 172 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_2">' + 173 '<div class="build_item_fake"></div>' + 174 '</div>' + 175 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_3">' + 176 '<div class="build_item_fake"></div>' + 177 '</div>' + 178 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_4">' + 179 '<div class="build_item_fake"></div>' + 180 '</div>' + 181 '<div class="build_inac_items_col" id="build_inac_items_area_' + this.id + '_col_5">' + 182 '<div class="build_item_fake"></div>' + 183 '</div>' + 184 '</div>' + 185 '</div>' 186 ); 187 188 this.activeZoneElement = $( '#' + this.activeZoneElemID ).get(0); 189 this.inactiveBlocksZoneElement = $( '#' + this.inactiveBlocksZoneElemID ).get(0); 190 this.inactiveItemsZoneElement = $( '#' + this.inactiveItemsZoneElemID ).get(0); 191 192 //draw all active blocks 193 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ ) { 194 this.active_blocks[iBlockInd].draw( this.activeZoneElement ); 195 196 //draw subitems of block 197 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ ) 198 if( this.active_items[iItemInd].block == this.active_blocks[iBlockInd].id ) 199 this.active_items[iItemInd].draw( this.active_blocks[iBlockInd].element ); 200 } 201 202 //append NEW BLOCK element 203 $( this.inactiveBlocksZoneElement ).append( 204 '<div class="build_block" id="build_block_new_' + this.id + '">' + 205 '<div class="build_block_header">NEW BLOCK</div>' + 206 '</div>' 207 ); 208 209 //append all inactive blocks 210 for( var iBlockInd = 0; iBlockInd < this.inactive_blocks.length; iBlockInd ++ ) 211 this.inactive_blocks[iBlockInd].draw( this.inactiveBlocksZoneElement ); 212 213 //append NEW_ITEM element 214 $( '#build_inac_items_area_' + this.id + '_col_1' ).append( 215 '<div class="build_item_active" id="build_item_new_' + this.id + '">NEW_ITEM</div>' 216 ); 217 218 //append all inactive items to 5 columns 219 var iColCount = 2; 220 for( var iItemInd = 0; iItemInd < this.inactive_items.length; iItemInd ++ ) { 221 this.inactive_items[iItemInd].draw( 222 $( '#build_inac_items_area_' + this.id + '_col_' + iColCount++ ).get(0) 223 ); 224 225 if( iColCount > 5 ) iColCount = 1; 226 } 227 228 $( this.activeZoneElement ).append( '<div class="clear_both"></div>' ); 229 $( this.inactiveBlocksZoneElement ).append( '<div class="clear_both"></div>' ); 230 $( this.inactiveItemsZoneElement ).append( '<div class="clear_both"></div>' ); 231 232 this.fixZonesWidths(); 233 this.activateSortable(); 234 234 } 235 235 236 236 BxDolPFMArea.prototype.fixZonesWidths = function() { 237 if( this.active_blocks.length ) {238 //fix active area239 var el = $( this.active_blocks[0].element );240 241 var w1 = parseInt( el.css( 'width' ) ) | 0;242 var w2 = parseInt( el.css( 'margin-left' ) ) | 0;243 var w3 = parseInt( el.css( 'margin-right' ) ) | 0;244 var w = ( w1 + w2 + w3 ) * ( this.active_blocks.length + 1 ) + 20;245 $( this.activeZoneElement ).parent().width( w );246 }247 248 if( this.inactive_blocks.length ) {249 //fix inactive area250 var el = $( this.inactive_blocks[0].element );251 252 var w1 = parseInt( el.css( 'width' ) ) | 0;253 var w2 = parseInt( el.css( 'margin-left' ) ) | 0;254 var w3 = parseInt( el.css( 'margin-right' ) ) | 0;255 var w = ( w1 + w2 + w3 ) * ( this.inactive_blocks.length + 2 ) + 20;256 $( this.inactiveBlocksZoneElement ).parent().width( w );257 }237 if( this.active_blocks.length ) { 238 //fix active area 239 var el = $( this.active_blocks[0].element ); 240 241 var w1 = parseInt( el.css( 'width' ) ) | 0; 242 var w2 = parseInt( el.css( 'margin-left' ) ) | 0; 243 var w3 = parseInt( el.css( 'margin-right' ) ) | 0; 244 var w = ( w1 + w2 + w3 ) * ( this.active_blocks.length + 1 ) + 20; 245 $( this.activeZoneElement ).parent().width( w ); 246 } 247 248 if( this.inactive_blocks.length ) { 249 //fix inactive area 250 var el = $( this.inactive_blocks[0].element ); 251 252 var w1 = parseInt( el.css( 'width' ) ) | 0; 253 var w2 = parseInt( el.css( 'margin-left' ) ) | 0; 254 var w3 = parseInt( el.css( 'margin-right' ) ) | 0; 255 var w = ( w1 + w2 + w3 ) * ( this.inactive_blocks.length + 2 ) + 20; 256 $( this.inactiveBlocksZoneElement ).parent().width( w ); 257 } 258 258 } 259 259 260 260 261 261 BxDolPFMArea.prototype.activateSortable = function() { 262 var oThisArea = this;263 262 var oThisArea = this; 263 264 264 $('.blocks_container', this.element).sortable('destroy').sortable({ 265 265 items: $('.build_block,.build_block_fake', this.element), … … 269 269 placeholder: 'build_block ui-sortable-placeholder', 270 270 forcePlaceholderSize: true, 271 stop: function(e,ui){272 oThisArea.stopItemsSort( ui.item );273 }271 stop: function(e,ui){ 272 oThisArea.stopItemsSort( ui.item ); 273 } 274 274 }); 275 275 276 276 $('.build_block,.build_inac_items_col', this.element).sortable({ 277 277 items: $('.build_item_active,.build_item_inactive,.build_item_fake', this.element), … … 279 279 placeholder: 'build_item_active ui-sortable-placeholder', 280 280 forcePlaceholderSize: true, 281 stop: function(e,ui){282 oThisArea.stopItemsSort( ui.item );283 }281 stop: function(e,ui){ 282 oThisArea.stopItemsSort( ui.item ); 283 } 284 284 }); 285 285 } … … 287 287 BxDolPFMArea.prototype.stopItemsSort = function( item ) { 288 288 var draggedElementID = $(item).attr('id'); 289 if( draggedElementID == 'build_block_new_' + this.id ) {290 if( $( '#build_block_new_' + this.id ).parent().is( '#' + this.activeZoneElemID ) )291 this.createNewBlock();292 }293 else if( draggedElementID == 'build_item_new_' + this.id ){294 if( $( '#build_item_new_' + this.id ).parents('#' + this.activeZoneElemID).length )295 this.createNewItem();296 }297 else298 this.resortAndSubmit();289 if( draggedElementID == 'build_block_new_' + this.id ) { 290 if( $( '#build_block_new_' + this.id ).parent().is( '#' + this.activeZoneElemID ) ) 291 this.createNewBlock(); 292 } 293 else if( draggedElementID == 'build_item_new_' + this.id ){ 294 if( $( '#build_item_new_' + this.id ).parents('#' + this.activeZoneElemID).length ) 295 this.createNewItem(); 296 } 297 else 298 this.resortAndSubmit(); 299 299 } 300 300 301 301 BxDolPFMArea.prototype.resortAndSubmit = function(){ 302 var oThisArea = this;303 304 setTimeout( function() {305 oThisArea.resortArrays();306 oThisArea.submitPositions();307 }, 550 );302 var oThisArea = this; 303 304 setTimeout( function() { 305 oThisArea.resortArrays(); 306 oThisArea.submitPositions(); 307 }, 550 ); 308 308 } 309 309 310 310 BxDolPFMArea.prototype.createNewBlock = function() { 311 var oThisArea = this;312 313 $.getJSON(314 this.parent.config.parserUrl,315 {action: 'createNewBlock'},316 function(oAreaData){317 oThisArea.parent.updateAreas( 'newBlock', oAreaData.id, '', oThisArea.id );318 }319 );311 var oThisArea = this; 312 313 $.getJSON( 314 this.parent.config.parserUrl, 315 {action: 'createNewBlock'}, 316 function(oAreaData){ 317 oThisArea.parent.updateAreas( 'newBlock', oAreaData.id, '', oThisArea.id ); 318 } 319 ); 320 320 } 321 321 322 322 BxDolPFMArea.prototype.createNewItem = function() { 323 var oThisArea = this;324 325 $.getJSON(326 this.parent.config.parserUrl,327 {action: 'createNewItem'},328 function(oAreaData){329 oThisArea.parent.updateAreas( 'newItem', oAreaData.id, '', oThisArea.id );330 }331 );323 var oThisArea = this; 324 325 $.getJSON( 326 this.parent.config.parserUrl, 327 {action: 'createNewItem'}, 328 function(oAreaData){ 329 oThisArea.parent.updateAreas( 'newItem', oAreaData.id, '', oThisArea.id ); 330 } 331 ); 332 332 } 333 333 334 334 BxDolPFMArea.prototype.insertNewBlock = function( newBlockID ) { 335 336 var iNewInd = this.active_blocks.length;337 var oNewBlockData = {id:newBlockID,name:'NEW BLOCK'};338 var oThisArea = this;339 340 //create object341 this.active_blocks[iNewInd] = new BxDolPFMBlock( this, oNewBlockData );342 var oNewBlock = this.active_blocks[iNewInd];343 344 //insert before fake NEW BLOCK element345 $( oNewBlock.getCode() ).insertBefore( '#build_block_new_' + this.id );346 347 //attach onclick event for link348 $( '#' + oNewBlock.elementID + ' > div.build_block_header' ).children( 'a' ).click( function(){349 oThisArea.openFieldDialog( oNewBlock.id, oThisArea.id );350 } );351 352 //get element353 oNewBlock.getElement();354 355 this.activateSortable();335 336 var iNewInd = this.active_blocks.length; 337 var oNewBlockData = {id:newBlockID,name:'NEW BLOCK'}; 338 var oThisArea = this; 339 340 //create object 341 this.active_blocks[iNewInd] = new BxDolPFMBlock( this, oNewBlockData ); 342 var oNewBlock = this.active_blocks[iNewInd]; 343 344 //insert before fake NEW BLOCK element 345 $( oNewBlock.getCode() ).insertBefore( '#build_block_new_' + this.id ); 346 347 //attach onclick event for link 348 $( '#' + oNewBlock.elementID + ' > div.build_block_header' ).children( 'a' ).click( function(){ 349 oThisArea.openFieldDialog( oNewBlock.id, oThisArea.id ); 350 } ); 351 352 //get element 353 oNewBlock.getElement(); 354 355 this.activateSortable(); 356 356 } 357 357 358 358 BxDolPFMArea.prototype.insertNewItem = function( newItemID ) { 359 var iNewInd = this.active_items.length;360 var oNewItemData = {id:newItemID,name:'NEW_ITEM'};361 var oThisArea = this;362 363 //create object364 this.active_items[iNewInd] = new BxDolPFMItem( this, oNewItemData );365 var oNewItem = this.active_items[iNewInd];366 367 //insert before fake NEW_ITEM element368 $( oNewItem.getCode() ).insertBefore( '#build_item_new_' + this.id );369 370 //attach onclick event for link371 $( '#' + oNewItem.elementID ).children( 'a' ).click( function(){372 oThisArea.openFieldDialog( oNewItem.id, oThisArea.id );373 } );374 375 //get element376 this.active_items[iNewInd].getElement();377 378 this.activateSortable();359 var iNewInd = this.active_items.length; 360 var oNewItemData = {id:newItemID,name:'NEW_ITEM'}; 361 var oThisArea = this; 362 363 //create object 364 this.active_items[iNewInd] = new BxDolPFMItem( this, oNewItemData ); 365 var oNewItem = this.active_items[iNewInd]; 366 367 //insert before fake NEW_ITEM element 368 $( oNewItem.getCode() ).insertBefore( '#build_item_new_' + this.id ); 369 370 //attach onclick event for link 371 $( '#' + oNewItem.elementID ).children( 'a' ).click( function(){ 372 oThisArea.openFieldDialog( oNewItem.id, oThisArea.id ); 373 } ); 374 375 //get element 376 this.active_items[iNewInd].getElement(); 377 378 this.activateSortable(); 379 379 } 380 380 381 381 BxDolPFMArea.prototype.moveFakeBlockBack = function() { 382 $( '#build_block_new_' + this.id ).prependTo( this.inactiveBlocksZoneElement );382 $( '#build_block_new_' + this.id ).prependTo( this.inactiveBlocksZoneElement ); 383 383 } 384 384 385 385 BxDolPFMArea.prototype.moveFakeItemBack = function() { 386 $( '#build_item_new_' + this.id ).prependTo( '#build_inac_items_area_' + this.id + '_col_1' );386 $( '#build_item_new_' + this.id ).prependTo( '#build_inac_items_area_' + this.id + '_col_1' ); 387 387 } 388 388 389 389 BxDolPFMArea.prototype.resortArrays = function() { 390 var oThisArea = this;391 392 var aNewBlocks = new Array();393 var aNewBlocksInac = new Array();394 var aNewItems = new Array();395 var aNewItemsInac = new Array();396 397 //get active blocks398 $( '#' + this.activeZoneElemID + ' .build_block' ).each( function( ind, eBlock ){399 var oBlock = oThisArea.getBlockByElementID( eBlock.id );400 if( !oBlock || $( eBlock ).css('visibility') == 'hidden' ) return; //just in case401 aNewBlocks.push( oBlock );402 403 //get active items of this block404 $( '#' + oBlock.elementID + ' .build_item_active' ).each( function( ind, eItem ){405 var oItem = oThisArea.getItemByElementID( eItem.id );406 if( !oItem || $( eItem ).css('visibility') == 'hidden' ) return; //it can be fake NEW_ITEM407 oItem.block = oBlock.id; //set parent block408 aNewItems.push( oItem );409 });410 });411 412 //get inactive blocks413 $( '#' + this.inactiveBlocksZoneElemID + ' .build_block' ).each( function( ind, eBlock ){414 var oBlock = oThisArea.getBlockByElementID( eBlock.id );415 if( !oBlock || $( eBlock ).css('visibility') == 'hidden' ) return;416 aNewBlocksInac.push( oBlock );417 });418 419 //get inactive items from blocks zone420 $( '#' + this.inactiveBlocksZoneElemID + ' .build_item_active' ).each( function( ind, eItem ){421 var oItem = oThisArea.getItemByElementID( eItem.id );422 if( !oItem || $( eItem ).css('visibility') == 'hidden' ) return;423 oItem.block = 0;424 aNewItemsInac.push( oItem );425 });426 427 //get inactive items from items zone428 $( '#' + this.inactiveItemsZoneElemID + ' .build_item_active' ).each( function( ind, eItem ){429 var oItem = oThisArea.getItemByElementID( eItem.id );430 if( !oItem || $( eItem ).css('visibility') == 'hidden' ) return;431 oItem.block = 0;432 aNewItemsInac.push( oItem );433 });434 435 this.active_blocks = aNewBlocks;436 this.inactive_blocks = aNewBlocksInac;437 this.active_items = aNewItems;438 this.inactive_items = aNewItemsInac;439 440 this.fixZonesWidths();390 var oThisArea = this; 391 392 var aNewBlocks = new Array(); 393 var aNewBlocksInac = new Array(); 394 var aNewItems = new Array(); 395 var aNewItemsInac = new Array(); 396 397 //get active blocks 398 $( '#' + this.activeZoneElemID + ' .build_block' ).each( function( ind, eBlock ){ 399 var oBlock = oThisArea.getBlockByElementID( eBlock.id ); 400 if( !oBlock || $( eBlock ).css('visibility') == 'hidden' ) return; //just in case 401 aNewBlocks.push( oBlock ); 402 403 //get active items of this block 404 $( '#' + oBlock.elementID + ' .build_item_active' ).each( function( ind, eItem ){ 405 var oItem = oThisArea.getItemByElementID( eItem.id ); 406 if( !oItem || $( eItem ).css('visibility') == 'hidden' ) return; //it can be fake NEW_ITEM 407 oItem.block = oBlock.id; //set parent block 408 aNewItems.push( oItem ); 409 }); 410 }); 411 412 //get inactive blocks 413 $( '#' + this.inactiveBlocksZoneElemID + ' .build_block' ).each( function( ind, eBlock ){ 414 var oBlock = oThisArea.getBlockByElementID( eBlock.id ); 415 if( !oBlock || $( eBlock ).css('visibility') == 'hidden' ) return; 416 aNewBlocksInac.push( oBlock ); 417 }); 418 419 //get inactive items from blocks zone 420 $( '#' + this.inactiveBlocksZoneElemID + ' .build_item_active' ).each( function( ind, eItem ){ 421 var oItem = oThisArea.getItemByElementID( eItem.id ); 422 if( !oItem || $( eItem ).css('visibility') == 'hidden' ) return; 423 oItem.block = 0; 424 aNewItemsInac.push( oItem ); 425 }); 426 427 //get inactive items from items zone 428 $( '#' + this.inactiveItemsZoneElemID + ' .build_item_active' ).each( function( ind, eItem ){ 429 var oItem = oThisArea.getItemByElementID( eItem.id ); 430 if( !oItem || $( eItem ).css('visibility') == 'hidden' ) return; 431 oItem.block = 0; 432 aNewItemsInac.push( oItem ); 433 }); 434 435 this.active_blocks = aNewBlocks; 436 this.inactive_blocks = aNewBlocksInac; 437 this.active_items = aNewItems; 438 this.inactive_items = aNewItemsInac; 439 440 this.fixZonesWidths(); 441 441 } 442 442 443 443 BxDolPFMArea.prototype.submitPositions = function(){ 444 var oRequest = {};445 446 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ ) {447 oRequest['blocks[' + iBlockInd + ']'] = this.active_blocks[iBlockInd].id;448 }449 450 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ ) {451 oRequest['items[' + iItemInd + ']'] = this.active_items[iItemInd].id;452 oRequest['items_blocks[' + this.active_items[iItemInd].id + ']'] = this.active_items[iItemInd].block;453 }454 455 oRequest.action = 'savePositions';456 oRequest.id = this.id;457 458 var oThisArea = this;459 $.post( this.parent.config.parserUrl, oRequest, function(sResult){oThisArea.processSaveResult(sResult);} );444 var oRequest = {}; 445 446 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ ) { 447 oRequest['blocks[' + iBlockInd + ']'] = this.active_blocks[iBlockInd].id; 448 } 449 450 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ ) { 451 oRequest['items[' + iItemInd + ']'] = this.active_items[iItemInd].id; 452 oRequest['items_blocks[' + this.active_items[iItemInd].id + ']'] = this.active_items[iItemInd].block; 453 } 454 455 oRequest.action = 'savePositions'; 456 oRequest.id = this.id; 457 458 var oThisArea = this; 459 $.post( this.parent.config.parserUrl, oRequest, function(sResult){oThisArea.processSaveResult(sResult);} ); 460 460 } 461 461 462 462 BxDolPFMArea.prototype.processSaveResult = function( sResult ) { 463 if( $.trim( sResult ) != 'OK' )464 alert( sResult );463 if( $.trim( sResult ) != 'OK' ) 464 alert( sResult ); 465 465 } 466 466 467 467 BxDolPFMArea.prototype.getBlockByElementID = function( getID ) { 468 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ )469 if( this.active_blocks[iBlockInd].elementID == getID )470 return this.active_blocks[iBlockInd];471 472 for( var iBlockInd = 0; iBlockInd < this.inactive_blocks.length; iBlockInd ++ )473 if( this.inactive_blocks[iBlockInd].elementID == getID )474 return this.inactive_blocks[iBlockInd];475 476 return false;468 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ ) 469 if( this.active_blocks[iBlockInd].elementID == getID ) 470 return this.active_blocks[iBlockInd]; 471 472 for( var iBlockInd = 0; iBlockInd < this.inactive_blocks.length; iBlockInd ++ ) 473 if( this.inactive_blocks[iBlockInd].elementID == getID ) 474 return this.inactive_blocks[iBlockInd]; 475 476 return false; 477 477 } 478 478 479 479 BxDolPFMArea.prototype.getItemByElementID = function( getID ) { 480 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ )481 if( this.active_items[iItemInd].elementID == getID )482 return this.active_items[iItemInd];483 484 for( var iItemInd = 0; iItemInd < this.inactive_items.length; iItemInd ++ )485 if( this.inactive_items[iItemInd].elementID == getID )486 return this.inactive_items[iItemInd];487 488 return false;480 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ ) 481 if( this.active_items[iItemInd].elementID == getID ) 482 return this.active_items[iItemInd]; 483 484 for( var iItemInd = 0; iItemInd < this.inactive_items.length; iItemInd ++ ) 485 if( this.inactive_items[iItemInd].elementID == getID ) 486 return this.inactive_items[iItemInd]; 487 488 return false; 489 489 } 490 490 491 491 BxDolPFMArea.prototype.getItemOrBlockByID = function( getID ) { 492 //search in active items493 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ )494 if( this.active_items[iItemInd].id == getID )495 return this.active_items[iItemInd];496 497 //search in inactive items498 for( var iItemInd = 0; iItemInd < this.inactive_items.length; iItemInd ++ )499 if( this.inactive_items[iItemInd].id == getID )500 return this.inactive_items[iItemInd];501 502 //search in active blocks503 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ )504 if( this.active_blocks[iBlockInd].id == getID )505 return this.active_blocks[iBlockInd];506 507 //search in inactive blocks508 for( var iBlockInd = 0; iBlockInd < this.inactive_blocks.length; iBlockInd ++ )509 if( this.inactive_blocks[iBlockInd].id == getID )510 return this.inactive_blocks[iBlockInd];511 512 return false;492 //search in active items 493 for( var iItemInd = 0; iItemInd < this.active_items.length; iItemInd ++ ) 494 if( this.active_items[iItemInd].id == getID ) 495 return this.active_items[iItemInd]; 496 497 //search in inactive items 498 for( var iItemInd = 0; iItemInd < this.inactive_items.length; iItemInd ++ ) 499 if( this.inactive_items[iItemInd].id == getID ) 500 return this.inactive_items[iItemInd]; 501 502 //search in active blocks 503 for( var iBlockInd = 0; iBlockInd < this.active_blocks.length; iBlockInd ++ ) 504 if( this.active_blocks[iBlockInd].id == getID ) 505 return this.active_blocks[iBlockInd]; 506 507 //search in inactive blocks 508 for( var iBlockInd = 0; iBlockInd < this.inactive_blocks.length; iBlockInd ++ ) 509 if( this.inactive_blocks[iBlockInd].id == getID ) 510 return this.inactive_blocks[iBlockInd]; 511 512 return false; 513 513 } 514 514 515 515 BxDolPFMArea.prototype.openFieldDialog = function( iItemID, iAreaID ) { 516 $( '#fieldFormWrap' ).css({517 width: ( document.body.clientWidth + 30 ),518 height: ( ( window.innerHeight ? window.innerHeight : screen.height) + 30 ),519 left: ( this.getHorizScroll() - 30 ),520 top: ( this.getVertScroll() - 30 ),521 display: 'block'522 }); 523 524 getHtmlData( 'edit_form_cont', this.parent.config.parserUrl + '?action=loadEditForm&id=' + iItemID + '&area=' + iAreaID, function (){516 $( '#fieldFormWrap' ).css({ 517 width: ( document.body.clientWidth + 30 ), 518 height: ( ( window.innerHeight ? window.innerHeight : screen.height) + 30 ), 519 left: ( this.getHorizScroll() - 30 ), 520 top: ( this.getVertScroll() - 30 ), 521 display: 'block' 522 }); 523 524 getHtmlData( 'edit_form_cont', this.parent.config.parserUrl + '?action=loadEditForm&id=' + iItemID + '&area=' + iAreaID, function (){ 525 525 $('#edit_form_cont > div').dolPopup({ 526 526 fog: { 527 color: '#fff', 527 color: '#fff', 528 528 opacity: .7 529 529 }, 530 530 closeOnOuterClick: false 531 531 }); 532 });532 }); 533 533 } 534 534 535 535 536 536 BxDolPFMArea.prototype.getHorizScroll = function() { 537 return (navigator.appName == "Microsoft Internet Explorer") ? document.documentElement.scrollLeft : window.pageXOffset;537 return (navigator.appName == "Microsoft Internet Explorer") ? document.documentElement.scrollLeft : window.pageXOffset; 538 538 } 539 539 540 540 BxDolPFMArea.prototype.getVertScroll = function() { 541 return (navigator.appName == "Microsoft Internet Explorer") ? document.documentElement.scrollTop : window.pageYOffset;541 return (navigator.appName == "Microsoft Internet Explorer") ? document.documentElement.scrollTop : window.pageYOffset; 542 542 } 543 543 … … 546 546 547 547 function BxDolPFMBlock( parent, oBlockData ) { 548 this.id = oBlockData.id;549 this.parent = parent;550 this.name = oBlockData.name;551 this.elementID = 'build_block_' + this.parent.id + '_' + this.id;548 this.id = oBlockData.id; 549 this.parent = parent; 550 this.name = oBlockData.name; 551 this.elementID = 'build_block_' + this.parent.id + '_' + this.id; 552 552 } 553 553 554 554 BxDolPFMBlock.prototype.draw = function( oParentElement ) { 555 var oThisBlock = this;556 557 $( oParentElement ).append( this.getCode() );558 $( '#' + this.elementID + ' > div.build_block_header' ).children( 'a' ).click( function(){559 oThisBlock.parent.openFieldDialog( oThisBlock.id, oThisBlock.parent.id );560 } );561 562 this.getElement();555 var oThisBlock = this; 556 557 $( oParentElement ).append( this.getCode() ); 558 $( '#' + this.elementID + ' > div.build_block_header' ).children( 'a' ).click( function(){ 559 oThisBlock.parent.openFieldDialog( oThisBlock.id, oThisBlock.parent.id ); 560 } ); 561 562 this.getElement(); 563 563 } 564 564 565 565 BxDolPFMBlock.prototype.getCode = function() { 566 return '<div class="build_block" id="' + this.elementID + '">' +567 '<div class="build_block_header">' +568 '<a href="javascript:void(0)">' +569 this.name +570 '</a>' +571 '</div>' +572 '<div class="build_item_fake"></div>' +573 '</div>';566 return '<div class="build_block" id="' + this.elementID + '">' + 567 '<div class="build_block_header">' + 568 '<a href="javascript:void(0)">' + 569 this.name + 570 '</a>' + 571 '</div>' + 572 '<div class="build_item_fake"></div>' + 573 '</div>'; 574 574 } 575 575 576 576 BxDolPFMBlock.prototype.getElement = function() { 577 this.element = $( '#' + this.elementID ).get(0);577 this.element = $( '#' + this.elementID ).get(0); 578 578 } 579 579 580 580 BxDolPFMBlock.prototype.updateName = function( sNewName ) { 581 $( this.element ).children( 'div.build_block_header' ).children( 'a' ).html( sNewName );581 $( this.element ).children( 'div.build_block_header' ).children( 'a' ).html( sNewName ); 582 582 } 583 583 … … 585 585 586 586 function BxDolPFMItem( parent, oItemData ) { 587 this.id = oItemData.id;588 this.parent = parent;589 this.name = oItemData.name;590 this.block = oItemData.block;591 592 this.elementID = 'build_item_' + this.parent.id + '_' + this.id;587 this.id = oItemData.id; 588 this.parent = parent; 589 this.name = oItemData.name; 590 this.block = oItemData.block; 591 592 this.elementID = 'build_item_' + this.parent.id + '_' + this.id; 593 593 } 594 594 595 595 BxDolPFMItem.prototype.draw = function( oParentElement ) { 596 var oThisItem = this;597 598 $( oParentElement ).append( this.getCode() );599 $( '#' + this.elementID ).children( 'a' ).click( function(){600 oThisItem.parent.openFieldDialog( oThisItem.id, oThisItem.parent.id );601 } );602 603 this.getElement();596 var oThisItem = this; 597 598 $( oParentElement ).append( this.getCode() ); 599 $( '#' + this.elementID ).children( 'a' ).click( function(){ 600 oThisItem.parent.openFieldDialog( oThisItem.id, oThisItem.parent.id ); 601 } ); 602 603 this.getElement(); 604 604 } 605 605 606 606 BxDolPFMItem.prototype.getCode = function( oParentElement ) { 607 return '<div class="build_item_active" id="' + this.elementID + '">' +608 '<a href="javascript:void(0)">' +609 this.name +610 '</a>' +611 '</div>';607 return '<div class="build_item_active" id="' + this.elementID + '">' + 608 '<a href="javascript:void(0)">' + 609 this.name + 610 '</a>' + 611 '</div>'; 612 612 } 613 613 BxDolPFMItem.prototype.getElement = function() { 614 this.element = $( '#' + this.elementID ).get(0);614 this.element = $( '#' + this.elementID ).get(0); 615 615 } 616 616 617 617 BxDolPFMItem.prototype.updateName = function( sNewName ) { 618 $( this.element ).children( 'a' ).html( sNewName );618 $( this.element ).children( 'a' ).html( sNewName ); 619 619 } 620 620 … … 624 624 625 625 function hideEditForm() { 626 $('#edit_form_cont > div').dolPopupHide();626 $('#edit_form_cont > div').dolPopupHide(); 627 627 } 628 628 629 629 630 630 function changeFieldType( _type ) { 631 var aShow = new Array();632 var aHide = new Array(); 633 switch( _type ) {634 case 'text':635 aShow = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg', 'field_default' );636 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_values', 'field_lkey' );637 break;638 case 'area':639 aShow = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg' );640 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_values', 'field_default', 'field_lkey' );641 break;642 case 'pass':643 aShow = new Array( 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_check_msg' );644 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_unique_msg', 'field_values', 'field_default', 'field_lkey' );645 break;646 case 'date':647 aShow = new Array( 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_check_msg', 'field_default' );648 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_unique_msg', 'field_values', 'field_lkey' );649 break;650 case 'select_one':651 aShow = new Array( 'field_control_select_one', 'field_values', 'field_default', 'field_lkey' );652 aHide = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_control_select_set', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg' );653 break;654 case 'select_set':655 aShow = new Array( 'field_control_select_set', 'field_values', 'field_lkey' );656 aHide = new Array( 'field_minimum', 'field_maximum', 'field_control_select_one', 'field_default', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg' );657 break;658 case 'num':659 aShow = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg', 'field_default' );660 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_values', 'field_lkey' );661 break;662 case 'range':663 aShow = new Array( 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_check_msg', 'field_default' );664 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_unique_msg', 'field_values', 'field_lkey' );665 break;666 case 'bool':667 aShow = new Array( 'field_default');668 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg', 'field_values', 'field_lkey' );669 break;670 }671 672 for( var iInd = 0; iInd < aHide.length; iInd ++ )673 $( '#' + aHide[iInd] ).css( {display: 'none'} );674 675 for( var iInd = 0; iInd < aShow.length; iInd ++ )676 $( '#' + aShow[iInd] ).css( {display: ''} );631 var aShow = new Array(); 632 var aHide = new Array(); 633 switch( _type ) { 634 case 'text': 635 aShow = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg', 'field_default' ); 636 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_values', 'field_lkey' ); 637 break; 638 case 'area': 639 aShow = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg' ); 640 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_values', 'field_default', 'field_lkey' ); 641 break; 642 case 'pass': 643 aShow = new Array( 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_check_msg' ); 644 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_unique_msg', 'field_values', 'field_default', 'field_lkey' ); 645 break; 646 case 'date': 647 aShow = new Array( 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_check_msg', 'field_default' ); 648 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_unique_msg', 'field_values', 'field_lkey' ); 649 break; 650 case 'select_one': 651 aShow = new Array( 'field_control_select_one', 'field_values', 'field_default', 'field_lkey' ); 652 aHide = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_control_select_set', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg' ); 653 break; 654 case 'select_set': 655 aShow = new Array( 'field_control_select_set', 'field_values', 'field_lkey' ); 656 aHide = new Array( 'field_minimum', 'field_maximum', 'field_control_select_one', 'field_default', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg' ); 657 break; 658 case 'num': 659 aShow = new Array( 'field_minimum', 'field_maximum', 'field_unique', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg', 'field_default' ); 660 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_values', 'field_lkey' ); 661 break; 662 case 'range': 663 aShow = new Array( 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_check_msg', 'field_default' ); 664 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_unique_msg', 'field_values', 'field_lkey' ); 665 break; 666 case 'bool': 667 aShow = new Array( 'field_default'); 668 aHide = new Array( 'field_control_select_one', 'field_control_select_set', 'field_unique', 'field_minimum', 'field_maximum', 'field_check', 'field_minimum_msg', 'field_maximum_msg', 'field_unique_msg', 'field_check_msg', 'field_values', 'field_lkey' ); 669 break; 670 } 671 672 for( var iInd = 0; iInd < aHide.length; iInd ++ ) 673 $( '#' + aHide[iInd] ).css( {display: 'none'} ); 674 675 for( var iInd = 0; iInd < aShow.length; iInd ++ ) 676 $( '#' + aShow[iInd] ).css( {display: ''} ); 677 677 678 678 } 679 679 680 680 function activateValuesEdit( eLink ) { 681 $( eLink ).parent().html( '<textarea class="input_text" name="' +682 $( eLink ).siblings( 'input' ).attr( 'name' ) +683 '">' +684 $( eLink ).siblings( 'input' ).val() +685 '</textarea>'686 );681 $( eLink ).parent().html( '<textarea class="input_text" name="' + 682 $( eLink ).siblings( 'input' ).attr( 'name' ) + 683 '">' + 684 $( eLink ).siblings( 'input' ).val() + 685 '</textarea>' 686 ); 687 687 } 688 688 689 689 function clearFormErrors( eForm ) { 690 $( 'td.warned', eForm ).removeClass( 'warned' ).next( 'td' ).children( 'img.depr_icon' ).remove();690 $( 'td.warned', eForm ).removeClass( 'warned' ).next( 'td' ).children( 'img.depr_icon' ).remove(); 691 691 } 692 692 693 693 function genEditFormError( sField, sText ) { 694 if( document.forms.fieldEditForm[sField] ) {695 $( document.forms.fieldEditForm[sField] ).parent( 'td' ).next( 'td' ).prepend(696 '<img src="../templates/base/images/icons/depr.gif" class="depr_icon" ' + 697 'onmouseover="showFloatDesc(\'' + processFloatDescInput( sText ) + '\')" ' +698 'onmousemove="moveFloatDesc( event )" ' +699 'onmouseout="hideFloatDesc()" ' +700 ' />'701 );702 }694 if( document.forms.fieldEditForm[sField] ) { 695 $( document.forms.fieldEditForm[sField] ).parent( 'td' ).next( 'td' ).prepend( 696 '<img src="../templates/base/images/icons/depr.gif" class="depr_icon" ' + 697 'onmouseover="showFloatDesc(\'' + processFloatDescInput( sText ) + '\')" ' + 698 'onmousemove="moveFloatDesc( event )" ' + 699 'onmouseout="hideFloatDesc()" ' + 700 ' />' 701 ); 702 } 703 703 } 704 704 705 705 function updateBuilder( sText, iItemID, sNewName ) { 706 oPFM.updateAreas( sText, iItemID, sNewName );706 oPFM.updateAreas( sText, iItemID, sNewName ); 707 707 } 708 708 709 709 function processFloatDescInput( sText ) { 710 sText = sText.replace( /&/g, '&' );711 sText = sText.replace( /</g, '<' );712 sText = sText.replace( />/g, '>' );713 sText = sText.replace( /"/g, '"' );714 sText = sText.replace( /\\/g, '\\\\' );715 sText = sText.replace( /'/g, '\\\'' );716 717 return sText;718 } 719 710 sText = sText.replace( /&/g, '&' ); 711 sText = sText.replace( /</g, '<' ); 712 sText = sText.replace( />/g, '>' ); 713 sText = sText.replace( /"/g, '"' ); 714 sText = sText.replace( /\\/g, '\\\\' ); 715 sText = sText.replace( /'/g, '\\\'' ); 716 717 return sText; 718 } 719 -
trunk/administration/js/functions.admin.js
r15201 r15211 1 1 2 function adminMenuCollapse(oImage) { 2 function adminMenuCollapse(oImage) { 3 3 if($(oImage).parents('.adm-menu-header').hasClass('adm-mmh-opened')) 4 4 $(oImage).removeClass('adm-mma-opened').parents('.adm-menu-header').removeClass('adm-mmh-opened').siblings('.adm-menu-items-wrapper').removeClass('adm-mmi-opened'); -
trunk/administration/js/lang_file.js
r15201 r15211 25 25 var sFilter = 'filter'; 26 26 var sUrl = ('' + document.location).replace(/[&]{0,1}filter=.*/, ''); 27 var bChecked = oCheckbox.checked == undefined ? oCheckbox.attr('checked') : oCheckbox.checked;27 var bChecked = oCheckbox.checked == undefined ? oCheckbox.attr('checked') : oCheckbox.checked; 28 28 if(bChecked && $('#adm-langs-look-for').val().length > 2) 29 29 sUrl += (sUrl.indexOf('?') == -1 ? '?' : '&') + 'filter=' + $('#adm-langs-look-for').val(); … … 33 33 $('#adm-langs-add-key').dolPopup({ 34 34 fog: { 35 color: '#fff', 35 color: '#fff', 36 36 opacity: .7 37 37 } 38 }); 38 }); 39 39 } 40 40 function onResult(sType, oResult) { 41 41 var sContentKey = '#adm-langs-' + sType + '-key-content'; 42 42 43 43 if(parseInt(oResult.code) == 0) { 44 44 parent.document.forms['adm-langs-' + sType + '-key-form'].reset(); … … 64 64 $('#adm-langs-holder > #adm-langs-edit-key').dolPopup({ 65 65 fog: { 66 color: '#fff', 66 color: '#fff', 67 67 opacity: .7 68 68 } … … 76 76 var sType = $(oLink).attr('id').replace('adm-langs-btn-', ''); 77 77 var sName = '#adm-langs-cnt-' + sType; 78 78 79 79 $(oLink).parent('.notActive').hide().siblings('.notActive:hidden').show().siblings('.active').hide().siblings('#' + $(oLink).attr('id') + '-act').show(); 80 80 $(sName).siblings('div:visible').bx_anim('hide', 'fade', 'slow', function(){ … … 90 90 $('#adm-langs-holder > #adm-langs-wnd-edit').dolPopup({ 91 91 fog: { 92 color: '#fff', 92 color: '#fff', 93 93 opacity: .7 94 94 } -
trunk/administration/js/memb_levels.js
r15201 r15211 30 30 $('#adm-mlevels-holder > #adm-mlevels-action').dolPopup({ 31 31 fog: { 32 color: '#fff', 32 color: '#fff', 33 33 opacity: .7 34 34 }, … … 38 38 $(document).addWebForms(); 39 39 $("input[type='datetime']", document).each(function() { 40 $(this).dynDateTime({41 ifFormat: '%Y-%m-%d %H:%M:%S',40 $(this).dynDateTime({ 41 ifFormat: '%Y-%m-%d %H:%M:%S', 42 42 showsTime: true, 43 43 position_css: 'fixed' -
trunk/administration/js/menu_compose.js
r15201 r15211 5 5 function initMenu( e ) 6 6 { 7 if( typeof( sNewItemTitle ) == 'undefined' )8 sNewItemTitle = 'NEW ITEM';9 10 oMenu = new BxDolMenu( topParentID, parserUrl, aTopItems, aCustomItems, aSystemItems, aAllItems, aCoords, e )7 if( typeof( sNewItemTitle ) == 'undefined' ) 8 sNewItemTitle = 'NEW ITEM'; 9 10 oMenu = new BxDolMenu( topParentID, parserUrl, aTopItems, aCustomItems, aSystemItems, aAllItems, aCoords, e ) 11 11 } 12 12 13 13 function createNewItem( type, source ) { 14 var aParams = {15 action: 'create_item',16 type: type,17 source: source ? source : 018 };19 20 var iNewID = 0;21 $.ajax({22 type: 'POST',23 url: parserUrl + '?r=' + Math.random(),24 data: aParams,25 success: function(sData) {26 iNewID = parseInt(sData);27 },28 dataType: 'text',29 async: false30 });31 32 return iNewID;14 var aParams = { 15 action: 'create_item', 16 type: type, 17 source: source ? source : 0 18 }; 19 20 var iNewID = 0; 21 $.ajax({ 22 type: 'POST', 23 url: parserUrl + '?r=' + Math.random(), 24 data: aParams, 25 success: function(sData) { 26 iNewID = parseInt(sData); 27 }, 28 dataType: 'text', 29 async: false 30 }); 31 32 return iNewID; 33 33 } 34 34 … … 36 36 function deactivateItem( id ) 37 37 { 38 var objXmlHttp = createXmlHttpObj();39 if( !objXmlHttp )40 return false;41 42 var url = parserUrl + '&action=deactivate_item&id=' + id;43 url += '&r=' + Math.random();44 45 objXmlHttp.open( "GET", url );46 objXmlHttp.onreadystatechange = function()47 {48 if ( objXmlHttp.readyState == 4 && objXmlHttp.status == 200 )49 {50 //alert( objXmlHttp.responseText );51 }52 }53 objXmlHttp.send( null );38 var objXmlHttp = createXmlHttpObj(); 39 if( !objXmlHttp ) 40 return false; 41 42 var url = parserUrl + '&action=deactivate_item&id=' + id; 43 url += '&r=' + Math.random(); 44 45 objXmlHttp.open( "GET", url ); 46 objXmlHttp.onreadystatechange = function() 47 { 48 if ( objXmlHttp.readyState == 4 && objXmlHttp.status == 200 ) 49 { 50 //alert( objXmlHttp.responseText ); 51 } 52 } 53 objXmlHttp.send( null ); 54 54 } 55 55 56 56 function showItemEditForm( id ) { 57 getHtmlData( 'edit_form_cont', parserUrl + '&action=edit_form&id=' + id, function (){57 getHtmlData( 'edit_form_cont', parserUrl + '&action=edit_form&id=' + id, function (){ 58 58 $('#edit_form_cont > div').dolPopup({ 59 59 fog: { color: '#fff', opacity: .7 } 60 60 }); 61 });61 }); 62 62 } 63 63 function getHorizScroll() 64 64 { 65 if (navigator.appName == "Microsoft Internet Explorer")66 return document.documentElement.scrollLeft;67 else68 return window.pageXOffset;65 if (navigator.appName == "Microsoft Internet Explorer") 66 return document.documentElement.scrollLeft; 67 else 68 return window.pageXOffset; 69 69 } 70 70 71 71 function getVertScroll() 72 72 { 73 if (navigator.appName == "Microsoft Internet Explorer")74 return document.documentElement.scrollTop;75 else76 return window.pageYOffset;73 if (navigator.appName == "Microsoft Internet Explorer") 74 return document.documentElement.scrollTop; 75 else 76 return window.pageYOffset; 77 77 } 78 78 function saveItem( id ) … … 80 80 $('#formItemEditLoading').bx_loading(); 81 81 82 _form = document.forms.formItemEdit;83 if( !_form )84 return false;85 86 /*if( _form.Caption )87 {88 if( !_form.Caption.value.length )89 {90 alert( 'Please enter Language Key' );91 _form.Caption.focus();92 return false;93 }94 }95 96 if( _form.LangCaption )97 {98 if( !_form.LangCaption.value.length )99 {100 alert( 'Please enter Default Name' );101 _form.LangCaption.focus();102 return false;103 }104 }*/105 106 var oRequest = {};107 for( ind = 0; ind < _form.elements.length; ind ++ )108 {109 var _el = _form.elements[ind];110 switch( _el.type )111 {112 case 'text':113 case 'textarea':114 case 'select-one':115 oRequest[_el.name] = _el.value;116 }117 }118 119 if( _form.Target )120 {121 for( i = 0; i < _form.Target.length; i++ )122 if( _form.Target[i].checked )123 sTarget = _form.Target[i].value;124 }125 else126 sTarget = '';127 128 var sVisible_non = ($(_form).find("[name='Visible[]'][value='non']").attr('checked') ? '1' : '0' );129 var sVisible_memb = ($(_form).find("[name='Visible[]'][value='memb']").attr('checked') ? '1' : '0' );130 var sBInQuickLink = ( ( _form.BInQuickLink && _form.BInQuickLink.checked ) ? '1' : '0' );82 _form = document.forms.formItemEdit; 83 if( !_form ) 84 return false; 85 86 /*if( _form.Caption ) 87 { 88 if( !_form.Caption.value.length ) 89 { 90 alert( 'Please enter Language Key' ); 91 _form.Caption.focus(); 92 return false; 93 } 94 } 95 96 if( _form.LangCaption ) 97 { 98 if( !_form.LangCaption.value.length ) 99 { 100 alert( 'Please enter Default Name' ); 101 _form.LangCaption.focus(); 102 return false; 103 } 104 }*/ 105 106 var oRequest = {}; 107 for( ind = 0; ind < _form.elements.length; ind ++ ) 108 { 109 var _el = _form.elements[ind]; 110 switch( _el.type ) 111 { 112 case 'text': 113 case 'textarea': 114 case 'select-one': 115 oRequest[_el.name] = _el.value; 116 } 117 } 118 119 if( _form.Target ) 120 { 121 for( i = 0; i < _form.Target.length; i++ ) 122 if( _form.Target[i].checked ) 123 sTarget = _form.Target[i].value; 124 } 125 else 126 sTarget = ''; 127 128 var sVisible_non = ($(_form).find("[name='Visible[]'][value='non']").attr('checked') ? '1' : '0' ); 129 var sVisible_memb = ($(_form).find("[name='Visible[]'][value='memb']").attr('checked') ? '1' : '0' ); 130 var sBInQuickLink = ( ( _form.BInQuickLink && _form.BInQuickLink.checked ) ? '1' : '0' ); 131 131 132 132 oRequest['action'] = 'save_item'; … … 137 137 oRequest['BInQuickLink'] = sBInQuickLink; 138 138 oRequest['_r'] = Math.random(); 139 139 140 140 $.post(parserUrl, oRequest, function(oData){ 141 141 $('#formItemEditLoading').bx_loading(); … … 151 151 function saveItemByPost( id ) 152 152 { 153 _form = document.forms.formItemEdit;154 var oXMLHttpReq = createXmlHttpObj();155 var elemCont = document.getElementById( 'edit_form_cont' );156 157 if( !_form )158 return false;159 160 if( !oXMLHttpReq )161 return false;162 163 if( !elemCont )164 return false;165 166 if( _form.Caption )167 {168 if( !_form.Caption.value.length )169 {170 alert( 'Please enter Language Key' );171 _form.Caption.focus();172 return false;173 }174 }175 176 if( _form.LangCaption )177 {178 if( !_form.LangCaption.value.length )179 {180 alert( 'Please enter Default Name' );181 _form.LangCaption.focus();182 return false;183 }184 }185 186 var sRequest = '';187 188 for( ind = 0; ind < _form.elements.length; ind ++ )189 {190 var _el = _form.elements[ind];191 switch( _el.type )192 {193 case 'text':194 case 'textarea':195 case 'select-one':196 sRequest += '&' + _el.name + '=' + encodeURIComponent( _el.value );197 }198 }199 200 if( _form.Target )201 {202 for( i = 0; i < _form.Target.length; i++ )203 if( _form.Target[i].checked )204 sTarget = _form.Target[i].value;205 }206 else207 sTarget = '';208 209 var sVisible_non = ( ( _form.Visible_non && _form.Visible_non.checked ) ? '1' : '0' );210 var sVisible_memb = ( ( _form.Visible_memb && _form.Visible_memb.checked ) ? '1' : '0' );211 212 var sBInQuickLink = ( ( _form.BInQuickLink && _form.BInQuickLink.checked ) ? '1' : '0' );213 214 var sRequestUrl = 'action=save_item&id=' + id + sRequest +215 '&Target=' + sTarget +216 '&Visible_non=' + sVisible_non +217 '&Visible_memb=' + sVisible_memb +218 '&BInQuickLink=' + sBInQuickLink;219 220 221 elemCont.innerHTML = '<div class="loading"><img src="'+urlIconLoading+'"></div>';222 223 oXMLHttpReq.open("POST", parserUrl + '&r=' + Math.random() );224 oXMLHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');225 226 oXMLHttpReq.onreadystatechange = function() 227 {228 if (oXMLHttpReq.readyState == 4 && oXMLHttpReq.status == 200) {229 sNewText = oXMLHttpReq.responseText;230 elemCont.innerHTML = sNewText;231 232 // parse javascripts and run them233 aScrMatches = sNewText.match(/<script[^>]*javascript[^>]*>([^<]*)<\/script>/ig);234 if( aScrMatches )235 {236 for( ind = 0; ind < aScrMatches.length; ind ++ )237 {238 sScr = aScrMatches[ind];239 iOffset = sScr.match(/<script[^>]*javascript[^>]*>/i)[0].length;240 sScript = sScr.substring( iOffset, sScr.length - 9 );241 242 eval( sScript );243 }244 }245 }246 }247 248 oXMLHttpReq.send( sRequestUrl );153 _form = document.forms.formItemEdit; 154 var oXMLHttpReq = createXmlHttpObj(); 155 var elemCont = document.getElementById( 'edit_form_cont' ); 156 157 if( !_form ) 158 return false; 159 160 if( !oXMLHttpReq ) 161 return false; 162 163 if( !elemCont ) 164 return false; 165 166 if( _form.Caption ) 167 { 168 if( !_form.Caption.value.length ) 169 { 170 alert( 'Please enter Language Key' ); 171 _form.Caption.focus(); 172 return false; 173 } 174 } 175 176 if( _form.LangCaption ) 177 { 178 if( !_form.LangCaption.value.length ) 179 { 180 alert( 'Please enter Default Name' ); 181 _form.LangCaption.focus(); 182 return false; 183 } 184 } 185 186 var sRequest = ''; 187 188 for( ind = 0; ind < _form.elements.length; ind ++ ) 189 { 190 var _el = _form.elements[ind]; 191 switch( _el.type ) 192 { 193 case 'text': 194 case 'textarea': 195 case 'select-one': 196 sRequest += '&' + _el.name + '=' + encodeURIComponent( _el.value ); 197 } 198 } 199 200 if( _form.Target ) 201 { 202 for( i = 0; i < _form.Target.length; i++ ) 203 if( _form.Target[i].checked ) 204 sTarget = _form.Target[i].value; 205 } 206 else 207 sTarget = ''; 208 209 var sVisible_non = ( ( _form.Visible_non && _form.Visible_non.checked ) ? '1' : '0' ); 210 var sVisible_memb = ( ( _form.Visible_memb && _form.Visible_memb.checked ) ? '1' : '0' ); 211 212 var sBInQuickLink = ( ( _form.BInQuickLink && _form.BInQuickLink.checked ) ? '1' : '0' ); 213 214 var sRequestUrl = 'action=save_item&id=' + id + sRequest + 215 '&Target=' + sTarget + 216 '&Visible_non=' + sVisible_non + 217 '&Visible_memb=' + sVisible_memb + 218 '&BInQuickLink=' + sBInQuickLink; 219 220 221 elemCont.innerHTML = '<div class="loading"><img src="'+urlIconLoading+'"></div>'; 222 223 oXMLHttpReq.open("POST", parserUrl + '&r=' + Math.random() ); 224 oXMLHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 225 226 oXMLHttpReq.onreadystatechange = function() 227 { 228 if (oXMLHttpReq.readyState == 4 && oXMLHttpReq.status == 200) { 229 sNewText = oXMLHttpReq.responseText; 230 elemCont.innerHTML = sNewText; 231 232 // parse javascripts and run them 233 aScrMatches = sNewText.match(/<script[^>]*javascript[^>]*>([^<]*)<\/script>/ig); 234 if( aScrMatches ) 235 { 236 for( ind = 0; ind < aScrMatches.length; ind ++ ) 237 { 238 sScr = aScrMatches[ind]; 239 iOffset = sScr.match(/<script[^>]*javascript[^>]*>/i)[0].length; 240 sScript = sScr.substring( iOffset, sScr.length - 9 ); 241 242 eval( sScript ); 243 } 244 } 245 } 246 } 247 248 oXMLHttpReq.send( sRequestUrl ); 249 249 } 250 250 251 251 function updateItem( id, title ) 252 252 { 253 oMenu.updateItem( id, title );253 oMenu.updateItem( id, title ); 254 254 } 255 255 256 256 function deleteItem( id ) { 257 if(confirm('Are you sure want delete this item?')){258 var aParams = {259 action: 'delete_item',260 id: id261 };262 263 $.post(264 parserUrl + '?r=' + Math.random(),265 aParams,266 function(sData) {267 if(sData == 'OK')268 location.reload();269 else270 alert(sData);271 },272 'text'273 );274 return true;275 }276 else277 return false;257 if(confirm('Are you sure want delete this item?')){ 258 var aParams = { 259 action: 'delete_item', 260 id: id 261 }; 262 263 $.post( 264 parserUrl + '?r=' + Math.random(), 265 aParams, 266 function(sData) { 267 if(sData == 'OK') 268 location.reload(); 269 else 270 alert(sData); 271 }, 272 'text' 273 ); 274 return true; 275 } 276 else 277 return false; 278 278 } 279 279 280 280 function saveItemsOrders( sTopItems, aCustomItems ) 281 281 { 282 var objXmlHttp = createXmlHttpObj();283 if( !objXmlHttp )284 return false;285 286 var url = parserUrl + '&action=save_orders&top=' + sTopItems;287 288 for( id in aCustomItems )289 {290 var sCustomStr = aCustomItems[id];291 if( sCustomStr.length == 0)292 continue;293 294 url += '&custom[' + id + ']=' + sCustomStr;295 }296 297 url += '&r=' + Math.random();298 299 objXmlHttp.open( "GET", url );300 objXmlHttp.onreadystatechange = function()301 {302 if ( objXmlHttp.readyState == 4 && objXmlHttp.status == 200 )303 {304 /*if( objXmlHttp.responseText != 'OK' )305 alert( objXmlHttp.responseText );*/306 }307 }308 objXmlHttp.send( null );282 var objXmlHttp = createXmlHttpObj(); 283 if( !objXmlHttp ) 284 return false; 285 286 var url = parserUrl + '&action=save_orders&top=' + sTopItems; 287 288 for( id in aCustomItems ) 289 { 290 var sCustomStr = aCustomItems[id]; 291 if( sCustomStr.length == 0) 292 continue; 293 294 url += '&custom[' + id + ']=' + sCustomStr; 295 } 296 297 url += '&r=' + Math.random(); 298 299 objXmlHttp.open( "GET", url ); 300 objXmlHttp.onreadystatechange = function() 301 { 302 if ( objXmlHttp.readyState == 4 && objXmlHttp.status == 200 ) 303 { 304 /*if( objXmlHttp.responseText != 'OK' ) 305 alert( objXmlHttp.responseText );*/ 306 } 307 } 308 objXmlHttp.send( null ); 309 309 } 310 310 311 311 function resetItems() 312 312 { 313 if( confirm( 'Reset Will Restore The Builder To Factory Settings :). Are You Sure?' ) )314 location = parserUrl + '&action=reset';315 } 313 if( confirm( 'Reset Will Restore The Builder To Factory Settings :). Are You Sure?' ) ) 314 location = parserUrl + '&action=reset'; 315 } -
trunk/administration/js/page_builder_tiny.js
r15201 r15211 2 2 3 3 tinyMCE_GZ.init({ 4 plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras",5 themes : "simple,advanced",6 languages : "en",7 disk_cache : true,8 debug : false4 plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras", 5 themes : "simple,advanced", 6 languages : "en", 7 disk_cache : true, 8 debug : false 9 9 }); 10 10 11 11 tinyMCE.init({ 12 mode : "textareas",13 theme : "advanced",14 15 editor_selector : "form_input_html",16 content_css : "plugins/tiny_mce/dolphin.css",17 18 plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras",19 relative_urls : false,20 21 theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",22 theme_advanced_buttons2 : "forecolor,backcolor,|,bullist,numlist,|,outdent,indent,|,link,unlink,image,hr,|,sub,sup,|,insertdate,inserttime,|,styleprops",23 theme_advanced_buttons3 : "charmap,emotions,|,cite,abbr,acronym,attribs,|,preview,removeformat,|,code,help",24 theme_advanced_buttons4 : "table,row_props,cell_props,delete_col,delete_row,delete_table,col_after,col_before,row_after,row_before,row_after,row_before,split_cells,merge_cells",25 theme_advanced_toolbar_location : "top",26 theme_advanced_toolbar_align : "center",12 mode : "textareas", 13 theme : "advanced", 14 15 editor_selector : "form_input_html", 16 content_css : "plugins/tiny_mce/dolphin.css", 17 18 plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras", 19 relative_urls : false, 20 21 theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect", 22 theme_advanced_buttons2 : "forecolor,backcolor,|,bullist,numlist,|,outdent,indent,|,link,unlink,image,hr,|,sub,sup,|,insertdate,inserttime,|,styleprops", 23 theme_advanced_buttons3 : "charmap,emotions,|,cite,abbr,acronym,attribs,|,preview,removeformat,|,code,help", 24 theme_advanced_buttons4 : "table,row_props,cell_props,delete_col,delete_row,delete_table,col_after,col_before,row_after,row_before,row_after,row_before,split_cells,merge_cells", 25 theme_advanced_toolbar_location : "top", 26 theme_advanced_toolbar_align : "center", 27 27 28 28 entity_encoding : "raw", … … 31 31 paste_convert_headers_to_strong : false, 32 32 paste_remove_spans : false, 33 paste_remove_styles : false33 paste_remove_styles : false 34 34 35 35 }); -
trunk/administration/js/profiles.js
r15201 r15211 1 1 // TODO: remake according to new design and principles 2 2 3 function BxManageProfiles(oOptions) { 3 function BxManageProfiles(oOptions) { 4 4 this._sActionsUrl = oOptions.sActionUrl; 5 5 this._sObjName = oOptions.sObjName == undefined ? 'oMP' : oOptions.sObjName; … … 18 18 this._oCtlValue['by'] = sBy; 19 19 this._oCtlValue['value'] = sValue; 20 20 21 21 this.getMembers(function() { 22 22 $('#adm-mp-members-form > .adm-mp-members-wrapper:hidden').html(''); … … 25 25 BxManageProfiles.prototype.changeFilterTags = function(sTag) { 26 26 this._oCtlValue['value'] = sTag; 27 27 28 28 this.getMembers(function() { 29 29 $('#adm-mp-members-form > .adm-mp-members-wrapper:hidden').html(''); … … 31 31 }; 32 32 BxManageProfiles.prototype.changeFilterSearch = function () { 33 var sValue = $("[name='adm-mp-filter']").val(); 33 var sValue = $("[name='adm-mp-filter']").val(); 34 34 if(sValue.length <= 0) 35 35 return; 36 36 37 37 this._oCtlValue['value'] = sValue; 38 38 39 39 this.getMembers(function() { 40 40 $('#adm-mp-members-form > .adm-mp-members-wrapper:hidden').html(''); … … 46 46 this._sCtlType = sType; 47 47 $("[name = 'adm-mp-members-ctl-type']").val(sType); 48 48 49 49 $(oLink).parent('.notActive').hide().siblings('.notActive:hidden').show().siblings('.active').hide().siblings('#' + $(oLink).attr('id') + '-act').show(); 50 50 … … 57 57 }; 58 58 BxManageProfiles.prototype.reloadTypeControl = function() { 59 var $this = this;59 var $this = this; 60 60 61 var oOptions = {62 action: 'get_controls',63 ctl_type: this._sCtlType64 };61 var oOptions = { 62 action: 'get_controls', 63 ctl_type: this._sCtlType 64 }; 65 65 66 $('#adm-mp-controls-loading').bx_loading();66 $('#adm-mp-controls-loading').bx_loading(); 67 67 68 68 $.post( … … 73 73 74 74 $('#adm-mp-ctl-' + $this._sCtlType).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() { 75 $(this).replaceWith(oResult.content);75 $(this).replaceWith(oResult.content); 76 76 }); 77 77 }, … … 86 86 this._sViewType = sType; 87 87 $("[name = 'adm-mp-members-view-type']").val(sType); 88 88 89 89 $(oLink).parent('.notActive').hide().siblings('.notActive:hidden').show().siblings('.active').hide().siblings('#' + $(oLink).attr('id') + '-act').show(); 90 90 91 if($('#adm-mp-members-' + sType).children().length) 91 if($('#adm-mp-members-' + sType).children().length) 92 92 $('#adm-mp-members-form > .adm-mp-members-wrapper:visible').bx_anim('hide', this._sAnimationEffect, this._iAnimationSpeed, function() { 93 93 $('#adm-mp-members-' + sType).bx_anim('show', $this._sAnimationEffect, $this._iAnimationSpeed); … … 117 117 BxManageProfiles.prototype.getMembers = function(onSuccess) { 118 118 var $this = this; 119 119 120 120 if(onSuccess == undefined) 121 121 onSuccess = function(){}; 122 122 123 123 $('#adm-mp-members-loading').bx_loading(); 124 124 125 125 var oOptions = { 126 action: 'get_members', 127 view_type: this._sViewType, 128 view_start: this._iStart, 129 view_per_page: this._iPerPage, 130 view_order: this._sOrderBy, 126 action: 'get_members', 127 view_type: this._sViewType, 128 view_start: this._iStart, 129 view_per_page: this._iPerPage, 130 view_order: this._sOrderBy, 131 131 ctl_type: this._sCtlType 132 132 }; … … 136 136 oOptions['ctl_value[]'].push(sKey + '=' + sValue); 137 137 }); 138 138 139 139 $.post( 140 140 this._sActionsUrl, … … 142 142 function(oResult) { 143 143 $('#adm-mp-members-loading').bx_loading(); 144 144 145 145 $('#adm-mp-members-form > .adm-mp-members-wrapper:visible').bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() { 146 146 $('#adm-mp-members-' + $this._sViewType).html(oResult.content).bx_anim('show', $this._sAnimationEffect, $this._iAnimationSpeed); 147 147 }); 148 148 149 149 onSuccess(); 150 150 }, -
trunk/administration/lang_file.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 52 52 if(isset($_POST['create_language'])) { 53 53 $mixedResultCreate = createLanguage($_POST); 54 } 54 } 55 55 else if(isset($_POST['import_language'])) { 56 56 $mixedResultCreate = importLanguage($_POST, $_FILES); … … 64 64 if(empty($mixedResultAvailable)) 65 65 $mixedResultAvailable = '_adm_txt_langs_success_compile'; 66 } 66 } 67 67 else if(isset($_POST['adm-lang-delete']) && !empty($_POST['langs'])) { 68 68 $sNameDefault = getParam('lang_default'); 69 foreach($_POST['langs'] as $iLangId) { 69 foreach($_POST['langs'] as $iLangId) { 70 70 $sName = getLanguageName($iLangId); 71 71 if($sName == $sNameDefault) { 72 72 $mixedResultAvailable = '_adm_txt_langs_cannot_delete_default'; 73 break;73 break; 74 74 } 75 75 76 if(!deleteLanguage((int)$iLangId)){76 if(!deleteLanguage((int)$iLangId)){ 77 77 $mixedResultAvailable = '_adm_txt_langs_cannot_delete'; 78 78 break; 79 }79 } 80 80 } 81 81 … … 85 85 else if(isset($_GET['action']) && $_GET['action'] == 'export' && isset($_GET['id'])) { 86 86 $aLanguage = $GLOBALS['MySQL']->getRow("SELECT `Name`, `Flag`, `Title` FROM `sys_localization_languages` WHERE `ID`='" . (int)$_GET['id'] . "' LIMIT 1"); 87 87 88 88 $aContent = array(); 89 $aItems = $GLOBALS['MySQL']->getAll("SELECT `tlk`.`Key` AS `key`, `tls`.`String` AS `string` FROM `sys_localization_keys` AS `tlk` LEFT JOIN `sys_localization_strings` AS `tls` ON `tlk`.`ID`=`tls`.`IDKey` WHERE `tls`.`IDLanguage`='" . (int)$_GET['id'] . "'"); 89 $aItems = $GLOBALS['MySQL']->getAll("SELECT `tlk`.`Key` AS `key`, `tls`.`String` AS `string` FROM `sys_localization_keys` AS `tlk` LEFT JOIN `sys_localization_strings` AS `tls` ON `tlk`.`ID`=`tls`.`IDKey` WHERE `tls`.`IDLanguage`='" . (int)$_GET['id'] . "'"); 90 90 foreach($aItems as $aItem) 91 91 $aContent[$aItem['key']] = $aItem['string']; … … 93 93 $sName = 'lang_' . $aLanguage['Name'] . '.php'; 94 94 $sContent = "<?php\n\$aLangInfo=" . var_export($aLanguage, true) . ";\n\$aLangContent=" . var_export($aContent, true) . ";\n?>"; 95 95 96 96 header ("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 97 97 header ("Content-type: application/octet-stream"); … … 109 109 //--- Create/Delete/Edit Language Key ---// 110 110 if(isset($_POST['action']) && $_POST['action'] == 'get_edit_form_key') { 111 $oJson = new Services_JSON(); 111 $oJson = new Services_JSON(); 112 112 echo $oJson->encode(array('code' => PageCodeKeyEdit((int)$_POST['id']))); 113 113 exit; … … 125 125 if(isset($_POST['string_for_' . $aLanguage['id']])) { 126 126 $GLOBALS['MySQL']->query("INSERT INTO `sys_localization_strings`(`IDKey`, `IDLanguage`, `String`) VALUES('" . $iKeyId . "', '" . $aLanguage['id'] . "', '" . process_db_input($_POST['string_for_' . $aLanguage['id']]) . "')"); 127 127 128 128 $bCompiled = $bCompiled && compileLanguage((int)$aLanguage['id']); 129 129 } 130 130 131 131 $aResult = $bCompiled ? array('code' => 0, 'message' => '_adm_txt_langs_success_key_save') : array('code' => 1, 'message' => '_adm_txt_langs_cannot_compile'); 132 132 } else … … 134 134 135 135 $aResult['message'] = MsgBox(_t($aResult['message'])); 136 137 $oJson = new Services_JSON(); 136 137 $oJson = new Services_JSON(); 138 138 echo "<script>parent.onResult('add', " . $oJson->encode($aResult) . ");</script>"; 139 139 exit; … … 152 152 $aResult['message'] = MsgBox(_t($aResult['message'])); 153 153 154 $oJson = new Services_JSON(); 154 $oJson = new Services_JSON(); 155 155 echo "<script>parent.onResult('edit', " . $oJson->encode($aResult) . ");</script>"; 156 156 exit; … … 158 158 159 159 if(isset($_POST['adm-lang-key-delete']) && is_array($_POST['keys'])) { 160 foreach($_POST['keys'] as $iKeyId)160 foreach($_POST['keys'] as $iKeyId) 161 161 $GLOBALS['MySQL']->query("DELETE FROM `sys_localization_keys`, `sys_localization_strings` USING `sys_localization_keys`, `sys_localization_strings` WHERE `sys_localization_keys`.`ID`=`sys_localization_strings`.`IDKey` AND `sys_localization_keys`.`ID`='" . $iKeyId . "'"); 162 162 } … … 166 166 'css_name' => array('forms_adv.css', 'lang_file.css'), 167 167 'js_name' => array('lang_file.js'), 168 'header' => _t('_adm_page_cpt_lang_file'), 168 'header' => _t('_adm_page_cpt_lang_file'), 169 169 ); 170 170 171 $sLangRssFeed = 'on' == getParam('feeds_enable') 171 $sLangRssFeed = 'on' == getParam('feeds_enable') 172 172 ? DesignBoxAdmin (_t('_adm_box_cpt_lang_files'), ' 173 <div class="RSSAggrCont" rssid="boonex_unity_lang_files" rssnum="5" member="0">174 <div class="loading_rss">175 <img src="' . getTemplateImage('loading.gif') . '" alt="' . _t('_loading ...') . '" />176 </div>177 </div>')173 <div class="RSSAggrCont" rssid="boonex_unity_lang_files" rssnum="5" member="0"> 174 <div class="loading_rss"> 175 <img src="' . getTemplateImage('loading.gif') . '" alt="' . _t('_loading ...') . '" /> 176 </div> 177 </div>') 178 178 : ''; 179 179 180 180 $_page_cont[$iNameIndex] = array( 181 'page_result_code' => $sResult, 181 'page_result_code' => $sResult, 182 182 'page_code_settings' => PageCodeSettings($mixedResultSettings), 183 183 'page_code_create' => PageCodeCreate($mixedResultCreate), … … 201 201 'lang_default' => array( 202 202 'type' => 'select', 203 'name' => 'lang_default', 203 'name' => 'lang_default', 204 204 'caption' => _t('_adm_txt_langs_def_lang'), 205 205 'values' => array(), … … 214 214 ); 215 215 $aLangs = getLangsArr(); 216 foreach($aLangs as $sName => $sTitle )217 $aForm['inputs']['lang_default']['values'][] = array('key' => $sName, 'value' => htmlspecialchars_adv( $sTitle ));216 foreach($aLangs as $sName => $sTitle ) 217 $aForm['inputs']['lang_default']['values'][] = array('key' => $sName, 'value' => htmlspecialchars_adv( $sTitle )); 218 218 219 219 $oForm = new BxTemplFormView($aForm); 220 220 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode())); 221 221 222 222 if($mixedResult !== true && !empty($mixedResult)) 223 223 $sResult = MsgBox(_t($mixedResult), 3) . $sResult; … … 227 227 function PageCodeCreate($mixedResult) { 228 228 $aTopItems = array( 229 'adm-langs-btn-files' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_langs_files'), 'active' => 1),229 'adm-langs-btn-files' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_langs_files'), 'active' => 1), 230 230 'adm-langs-btn-create' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_langs_create'), 'active' => 0), 231 231 'adm-langs-btn-import' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_langs_import')) … … 233 233 234 234 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('langs.html', array( 235 'content_files' => _getLanguagesList(),235 'content_files' => _getLanguagesList(), 236 236 'content_create' => _getLanguageCreateForm(), 237 237 'content_import' => _getLanguageImportForm() … … 240 240 if($mixedResult !== true && !empty($mixedResult)) 241 241 $sResult = MsgBox(_t($mixedResult), 3) . $sResult; 242 242 243 243 return DesignBoxAdmin(_t('_adm_box_cpt_lang_available'), $sResult, $aTopItems); 244 244 } … … 247 247 $aItems = array(); 248 248 $sNameDefault = getParam('lang_default'); 249 250 $aLangs = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `name`, `Title` AS `title`, `Flag` AS `flag` FROM `sys_localization_languages` ORDER BY `Name`"); 249 250 $aLangs = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `name`, `Title` AS `title`, `Flag` AS `flag` FROM `sys_localization_languages` ORDER BY `Name`"); 251 251 foreach($aLangs as $aLang) 252 252 $aItems[] = array( … … 259 259 'export_link' => $GLOBALS['site']['url_admin'] . 'lang_file.php?action=export&id=' . $aLang['id'] 260 260 ); 261 261 262 262 //--- Get Controls ---// 263 263 $aButtons = array( 264 264 'adm-lang-compile' => _t('_adm_txt_langs_compile'), 265 265 'adm-lang-delete' => _t('_adm_txt_langs_delete') 266 ); 266 ); 267 267 $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-langs-form', $aButtons, 'langs'); 268 268 … … 271 271 } 272 272 function _getLanguageCreateForm(){ 273 if(isset($_POST['action']) && $_POST['action'] == 'get_edit_form_language' && isset($_POST['id']))273 if(isset($_POST['action']) && $_POST['action'] == 'get_edit_form_language' && isset($_POST['id'])) 274 274 $aLanguage = $GLOBALS['MySQL']->getRow("SELECT `ID` AS `id`, `Name` AS `name`, `Flag` AS `flag`, `Title` AS `title` FROM `sys_localization_languages` WHERE `ID`='" . (int)$_POST['id'] . "' LIMIT 1"); 275 275 … … 305 305 'CopyLanguage_SourceLangID' => array( 306 306 'type' => 'select', 307 'name' => 'CopyLanguage_SourceLangID', 307 'name' => 'CopyLanguage_SourceLangID', 308 308 'caption' => _t('_adm_txt_langs_copy_from'), 309 309 'values' => array() … … 318 318 //--- Copy from ---// 319 319 $aLangs = getLangsArr(false, true); 320 foreach($aLangs as $iId => $sName)321 $aFormCreate['inputs']['CopyLanguage_SourceLangID']['values'][] = array('key' => $iId, 'value' => htmlspecialchars_adv( $sName ));322 320 foreach($aLangs as $iId => $sName) 321 $aFormCreate['inputs']['CopyLanguage_SourceLangID']['values'][] = array('key' => $iId, 'value' => htmlspecialchars_adv( $sName )); 322 323 323 //--- Flags ---// 324 $aCountries = $GLOBALS['MySQL']->getAll("SELECT `ISO2` AS `code`, `Country` AS `title` FROM `sys_countries` ORDER BY `Country`"); 325 foreach($aCountries AS $aCountry) {324 $aCountries = $GLOBALS['MySQL']->getAll("SELECT `ISO2` AS `code`, `Country` AS `title` FROM `sys_countries` ORDER BY `Country`"); 325 foreach($aCountries AS $aCountry) { 326 326 $sCode = strtolower($aCountry['code']); 327 327 $aFormCreate['inputs']['Flag']['values'][] = array('key' => $sCode, 'value' => $aCountry['title']); 328 }329 330 if(!empty($aLanguage)) {328 } 329 330 if(!empty($aLanguage)) { 331 331 unset($aFormCreate['inputs']['CopyLanguage_SourceLangID']); 332 332 $aFormCreate['inputs']['id'] = array( … … 335 335 'value' => $aLanguage['id'] 336 336 ); 337 }338 $oForm = new BxTemplFormView($aFormCreate);337 } 338 $oForm = new BxTemplFormView($aFormCreate); 339 339 340 340 return $GLOBALS['oAdmTemplate']->parseHtmlByName('langs_form_create.html', array( 341 'display' => !empty($aLanguage) ? 'block' : 'none',342 'form' => $oForm->getCode()341 'display' => !empty($aLanguage) ? 'block' : 'none', 342 'form' => $oForm->getCode() 343 343 )); 344 344 } … … 351 351 'method' => 'post', 352 352 'enctype' => 'multipart/form-data' 353 ), 353 ), 354 354 'inputs' => array( 355 355 'ImportLanguage_File' => array( 356 356 'type' => 'file', 357 'name' => 'ImportLanguage_File', 357 'name' => 'ImportLanguage_File', 358 358 'caption' => _t('_adm_txt_langs_file'), 359 359 ), … … 364 364 ) 365 365 ) 366 ); 367 $oForm = new BxTemplFormView($aFormImport);368 369 return $GLOBALS['oAdmTemplate']->parseHtmlByName('langs_form_import.html', array(370 'display' => !empty($aLanguage) ? 'block' : 'none',371 'form' => $oForm->getCode()366 ); 367 $oForm = new BxTemplFormView($aFormImport); 368 369 return $GLOBALS['oAdmTemplate']->parseHtmlByName('langs_form_import.html', array( 370 'display' => !empty($aLanguage) ? 'block' : 'none', 371 'form' => $oForm->getCode() 372 372 )); 373 373 } … … 387 387 ); 388 388 } 389 389 390 390 //--- Get Controls ---// 391 $aButtons = array( 391 $aButtons = array( 392 392 'adm-lang-key-delete' => _t('_adm_txt_langs_delete') 393 ); 393 ); 394 394 $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-keys-form', $aButtons, 'keys'); 395 395 396 396 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('langs_keys.html', array( 397 397 'filter_value' => $sFilter, … … 401 401 'url_admin' => $GLOBALS['site']['url_admin'] 402 402 )); 403 403 404 404 if($mixedResult !== true && !empty($mixedResult)) 405 405 $sResult = MsgBox(_t($mixedResult), 3) . $sResult; 406 406 407 407 return DesignBoxAdmin(_t('_adm_box_cpt_lang_keys'), $sResult); 408 408 } … … 418 418 ), 419 419 'params' => array(), 420 'inputs' => array( 420 'inputs' => array( 421 421 'name' => array( 422 422 'type' => 'text', … … 431 431 'value' => '', 432 432 'values' => array() 433 ), 433 ), 434 434 ) 435 435 ); 436 436 437 437 $aCategories = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `title` FROM `sys_localization_categories`"); 438 foreach($aCategories as $aCategory) 438 foreach($aCategories as $aCategory) 439 439 $aForm['inputs']['category']['values'][] = array('key' => $aCategory['id'], 'value' => $aCategory['title']); 440 440 … … 468 468 ), 469 469 'params' => array(), 470 'inputs' => array( 470 'inputs' => array( 471 471 'id' => array( 472 472 'type' => 'hidden', … … 484 484 ), 485 485 ) 486 ); 486 ); 487 487 488 488 $aStrings = $GLOBALS['MySQL']->getAllWithKey("SELECT CONCAT('string_for_', `IDLanguage`) AS `key`, `String` AS `value` FROM `sys_localization_strings` WHERE `IDKey`='" . $iId . "'", "key"); … … 509 509 function createLanguage(&$aData) { 510 510 global $MySQL; 511 512 $sTitle = process_db_input($aData['CopyLanguage_Title']);513 $sName = mb_strtolower( process_db_input($aData['CopyLanguage_Name']) );514 $sFlag = htmlspecialchars_adv($aData['Flag']);515 $iSourceId = isset($aData['CopyLanguage_SourceLangID']) ? (int)$aData['CopyLanguage_SourceLangID'] : 0;516 517 if(strlen($sTitle) <= 0) 511 512 $sTitle = process_db_input($aData['CopyLanguage_Title']); 513 $sName = mb_strtolower( process_db_input($aData['CopyLanguage_Name']) ); 514 $sFlag = htmlspecialchars_adv($aData['Flag']); 515 $iSourceId = isset($aData['CopyLanguage_SourceLangID']) ? (int)$aData['CopyLanguage_SourceLangID'] : 0; 516 517 if(strlen($sTitle) <= 0) 518 518 return '_adm_txt_langs_empty_title'; 519 if(strlen($sName) <= 0)519 if(strlen($sName) <= 0) 520 520 return '_adm_txt_langs_empty_name'; 521 521 … … 525 525 return '_adm_txt_langs_success_updated'; 526 526 } 527 528 529 $mixedResult = $MySQL->query("INSERT INTO `sys_localization_languages` (`Name`, `Flag`, `Title`) VALUES ('{$sName}', '{$sFlag}', '{$sTitle}')");530 if($mixedResult === false) 527 528 529 $mixedResult = $MySQL->query("INSERT INTO `sys_localization_languages` (`Name`, `Flag`, `Title`) VALUES ('{$sName}', '{$sFlag}', '{$sTitle}')"); 530 if($mixedResult === false) 531 531 return '_adm_txt_langs_cannot_create'; 532 532 533 $iId = db_last_id();534 $aStrings = $MySQL->getAll("SELECT `IDKey`, `String` FROM `sys_localization_strings` WHERE`IDLanguage` = $iSourceId");535 536 foreach($aStrings as $aString){537 $aString['String'] = addslashes($aString['String']);538 $MySQL->query("INSERT INTO `sys_localization_strings`(`IDKey`, `IDLanguage`, `String`) VALUES ('{$aString['IDKey']}', $iId, '{$aString['String']}')");539 540 if( !db_affected_rows() )541 return '_adm_txt_langs_cannot_add_string';542 }543 544 return '_adm_txt_langs_success_create';545 } 546 function importLanguage(&$aData, &$aFiles) { 533 $iId = db_last_id(); 534 $aStrings = $MySQL->getAll("SELECT `IDKey`, `String` FROM `sys_localization_strings` WHERE `IDLanguage` = $iSourceId"); 535 536 foreach($aStrings as $aString){ 537 $aString['String'] = addslashes($aString['String']); 538 $MySQL->query("INSERT INTO `sys_localization_strings`(`IDKey`, `IDLanguage`, `String`) VALUES ('{$aString['IDKey']}', $iId, '{$aString['String']}')"); 539 540 if( !db_affected_rows() ) 541 return '_adm_txt_langs_cannot_add_string'; 542 } 543 544 return '_adm_txt_langs_success_create'; 545 } 546 function importLanguage(&$aData, &$aFiles) { 547 547 global $MySQL; 548 548 549 $sTmpPath = $GLOBALS['dir']['tmp'] . mktime() . ".php";550 if(!file_exists($aFiles['ImportLanguage_File']['tmp_name']) || !move_uploaded_file($aFiles['ImportLanguage_File']['tmp_name'], $sTmpPath)) 549 $sTmpPath = $GLOBALS['dir']['tmp'] . mktime() . ".php"; 550 if(!file_exists($aFiles['ImportLanguage_File']['tmp_name']) || !move_uploaded_file($aFiles['ImportLanguage_File']['tmp_name'], $sTmpPath)) 551 551 return '_adm_txt_langs_cannot_upload_file'; 552 552 553 553 require_once($sTmpPath); 554 555 $aLangInfo = isset($aLangInfo) ? $aLangInfo : $LANG_INFO;556 $aLangContent = isset($aLangContent) ? $aLangContent : $LANG;557 if (empty($aLangInfo) || empty($aLangContent)) {558 return '_adm_txt_langs_cannot_create';559 }554 555 $aLangInfo = isset($aLangInfo) ? $aLangInfo : $LANG_INFO; 556 $aLangContent = isset($aLangContent) ? $aLangContent : $LANG; 557 if (empty($aLangInfo) || empty($aLangContent)) { 558 return '_adm_txt_langs_cannot_create'; 559 } 560 560 561 561 $mixedResult = $MySQL->query("INSERT INTO `sys_localization_languages` (`Name`, `Flag`, `Title`) VALUES ('" . $aLangInfo['Name'] . "', '" . $aLangInfo['Flag'] . "', '" . $aLangInfo['Title'] . "')"); 562 if($mixedResult === false) {563 @unlink($sTmpPath); 562 if($mixedResult === false) { 563 @unlink($sTmpPath); 564 564 return '_adm_txt_langs_cannot_create'; 565 }565 } 566 566 567 567 $iId = (int)$MySQL->lastId(); … … 571 571 continue; 572 572 573 $MySQL->query("INSERT INTO `sys_localization_strings`(`IDKey`, `IDLanguage`, `String`) VALUES ('" . $aKeys[$sKey]['id'] . "', " . $iId . ", '" . addslashes($sString) . "')");574 }575 576 compileLanguage($iId);577 578 @unlink($sTmpPath);579 return '_adm_txt_langs_success_import';573 $MySQL->query("INSERT INTO `sys_localization_strings`(`IDKey`, `IDLanguage`, `String`) VALUES ('" . $aKeys[$sKey]['id'] . "', " . $iId . ", '" . addslashes($sString) . "')"); 574 } 575 576 compileLanguage($iId); 577 578 @unlink($sTmpPath); 579 return '_adm_txt_langs_success_import'; 580 580 } 581 581 function getLanguageName($iId) { 582 return $GLOBALS['MySQL']->getOne("SELECT `Name` FROM `sys_localization_languages` WHERE `ID`='" . (int)$iId . "' LIMIT 1");582 return $GLOBALS['MySQL']->getOne("SELECT `Name` FROM `sys_localization_languages` WHERE `ID`='" . (int)$iId . "' LIMIT 1"); 583 583 } 584 584 -
trunk/administration/login_form.html
r15201 r15211 2 2 3 3 <div class="login"> 4 <div class="login_header">__header_text__</div>5 <div class="login_form"> 6 <form action="__action_url__" method="POST">7 <input type="hidden" name="relocate" value="__relocate_url__" />8 <div class="login_form_row">9 <div class="clear_both"></div>10 <div class="login_form_label">__name_label__:</div>11 <div class="login_form_val">12 <input type="text" name="ID" class="login_form_input" />13 </div>14 <div class="clear_both"></div>15 </div>16 <div class="login_form_row">17 <div class="clear_both"></div>18 <div class="login_form_label">__password_label__:</div>19 <div class="login_form_val">20 <input type="password" name="Password" class="login_form_input" />21 </div>22 <div class="clear_both"></div>23 </div>24 <div class="login_form_row">25 <div class="clear_both"></div>26 <div class="login_form_label"></div>27 <div class="login_form_val">28 <input type="submit" value="Enter" class="login_form_submit" />29 </div>30 <div class="clear_both"></div>31 </div>32 </form>33 </div>4 <div class="login_header">__header_text__</div> 5 <div class="login_form"> 6 <form action="__action_url__" method="POST"> 7 <input type="hidden" name="relocate" value="__relocate_url__" /> 8 <div class="login_form_row"> 9 <div class="clear_both"></div> 10 <div class="login_form_label">__name_label__:</div> 11 <div class="login_form_val"> 12 <input type="text" name="ID" class="login_form_input" /> 13 </div> 14 <div class="clear_both"></div> 15 </div> 16 <div class="login_form_row"> 17 <div class="clear_both"></div> 18 <div class="login_form_label">__password_label__:</div> 19 <div class="login_form_val"> 20 <input type="password" name="Password" class="login_form_input" /> 21 </div> 22 <div class="clear_both"></div> 23 </div> 24 <div class="login_form_row"> 25 <div class="clear_both"></div> 26 <div class="login_form_label"></div> 27 <div class="login_form_val"> 28 <input type="submit" value="Enter" class="login_form_submit" /> 29 </div> 30 <div class="clear_both"></div> 31 </div> 32 </form> 33 </div> 34 34 </div> -
trunk/administration/manage_subscribers.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 29 29 bx_import('BxDolSubscription'); 30 30 bx_import('BxTemplSearchResult'); 31 31 32 32 $logged['admin'] = member_auth( 1, true, true ); 33 33 … … 64 64 'count' => $oSubscription->getSubscribersCount(), 65 65 'page_url' => $GLOBALS['site']['url_admin'] . 'manage_subscribers.php?start={start}' 66 66 67 67 )); 68 68 69 69 $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-ms-form', array( 70 70 'adm-ms-delete' => _t('_adm_btn_ms_delete') 71 71 ), 'members'); 72 72 73 73 $aSubscribers = $oSubscription->getSubscribers(BX_DOL_SBS_TYPE_VISITOR, $iStart, $iPerPage); 74 74 -
trunk/administration/memb_levels.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 32 32 $logged['admin'] = member_auth( 1, true, true ); 33 33 34 $oSettings = new BxDolAdminSettings(5); 34 $oSettings = new BxDolAdminSettings(5); 35 35 36 36 //--- Process submit ---// … … 47 47 else if(isset($_POST['adm-mlevels-disable'])) 48 48 $sValue = 'no'; 49 49 50 50 $GLOBALS['MySQL']->query("UPDATE `sys_acl_levels` SET `Active`='" . $sValue . "' WHERE `ID` IN ('" . implode("','", $_POST['levels']) . "')"); 51 51 } else if(isset($_POST['adm-mlevels-delete']) && !empty($_POST['levels'])) { … … 59 59 if(isset($_POST['adm-mlevels-actions-enable'])) 60 60 $sQuery = "REPLACE INTO `sys_acl_matrix` SET `IDLevel`='" . $iLevelId . "', `IDAction`='" . $iId . "'"; 61 else 61 else 62 62 $sQuery = "DELETE FROM `sys_acl_matrix` WHERE `IDLevel`='" . $iLevelId . "' AND `IDAction`='" . $iId . "'"; 63 63 … … 68 68 $iDays = (int)$_POST['days']; 69 69 $iPrice = (float)trim($_POST['price'], " $"); 70 70 71 71 $GLOBALS['MySQL']->query("INSERT INTO `sys_acl_level_prices`(`IDLevel`, `Days`, `Price`) VALUES('" . $iLevelId . "', '" . $iDays . "', '" . $iPrice . "')"); 72 72 } else if(isset($_POST['adm-mlevels-prices-delete'])) { … … 75 75 $sQuery = "REPLACE INTO `sys_acl_matrix` SET `IDLevel`='" . $_POST['levelId'] . "', `IDAction`='" . $_POST['actionId'] . "'"; 76 76 $sQuery .= !empty($_POST['allowedCnt']) ? ", `AllowedCount`='" . $_POST['allowedCnt'] . "'" : ""; 77 $sQuery .= !empty($_POST['period']) ? ", `AllowedPeriodLen`='" . $_POST['period'] . "'" : ""; 77 $sQuery .= !empty($_POST['period']) ? ", `AllowedPeriodLen`='" . $_POST['period'] . "'" : ""; 78 78 $sQuery .= !empty($_POST['dateStart']) ? ", `AllowedPeriodStart`=FROM_UNIXTIME(" . strtotime($_POST['dateStart']) . ")" : ""; 79 79 $sQuery .= !empty($_POST['dateEnd']) ? ", `AllowedPeriodEnd`=FROM_UNIXTIME(" . strtotime($_POST['dateEnd']) . ")" : ""; 80 80 $aResult = $GLOBALS['MySQL']->query($sQuery) > 0 ? array('code' => 0, 'message' => MsgBox(_t('_adm_txt_mlevels_action_saved'))) : array('code' => 1, 'message' => MsgBox(_t('_adm_txt_mlevels_action_cannot_save'))); 81 81 82 $oJson = new Services_JSON(); 82 $oJson = new Services_JSON(); 83 83 echo "<script>parent.onResult(" . $oJson->encode($aResult) . ");</script>"; 84 84 exit; 85 85 } else if(isset($_POST['action']) && $_POST['action'] == 'get_edit_form_action') { 86 $oJson = new Services_JSON(); 86 $oJson = new Services_JSON(); 87 87 echo $oJson->encode(array('code' => PageCodeAction((int)$_POST['level_id'], (int)$_POST['action_id'], $mixedResultAction))); 88 88 exit; 89 89 } 90 90 91 91 $iLevelId = bx_get('level') !== false ? (int)bx_get('level') : 0; 92 92 … … 96 96 'css_name' => array('forms_adv.css', 'settings.css', 'memb_levels.css', 'plugins/jquery/themes/|ui.datepicker.css'), 97 97 'js_name' => array('ui.datepicker.js', 'memb_levels.js'), 98 'header' => _t('_adm_page_cpt_memb_levels'), 98 'header' => _t('_adm_page_cpt_memb_levels'), 99 99 ); 100 100 $_page_cont[$iNameIndex] = array( … … 109 109 110 110 function PageCodeSettings($mixedResult) { 111 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $GLOBALS['oSettings']->getForm())); 111 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $GLOBALS['oSettings']->getForm())); 112 112 if($mixedResult !== true && !empty($mixedResult)) 113 113 $sResult = $mixedResult . $sResult; 114 114 115 115 return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_settings'), $sResult); 116 116 } … … 132 132 ), 133 133 ), 134 'inputs' => array ( 134 'inputs' => array ( 135 135 'Active' => array( 136 136 'type' => 'hidden', … … 166 166 ), 167 167 'checker' => array ( 168 'func' => 'length',169 'params' => array(3,100),170 'error' => _t('_adm_txt_mlevels_name_err'),171 ),168 'func' => 'length', 169 'params' => array(3,100), 170 'error' => _t('_adm_txt_mlevels_name_err'), 171 ), 172 172 ), 173 173 'Icon' => array( … … 175 175 'name' => 'Icon', 176 176 'caption' => _t('_adm_txt_mlevels_icon'), 177 'value' => '',177 'value' => '', 178 178 'checker' => array ( 179 'func' => '',180 'params' => '',181 'error' => _t('_adm_txt_mlevels_icon_err'),182 ),179 'func' => '', 180 'params' => '', 181 'error' => _t('_adm_txt_mlevels_icon_err'), 182 ), 183 183 ), 184 184 'Description' => array( … … 195 195 'name' => 'submit', 196 196 'value' => _t('_adm_btn_mlevels_add'), 197 ), 197 ), 198 198 ) 199 199 ); … … 204 204 $sFilePath = BX_DIRECTORY_PATH_ROOT . 'media/images/membership/'; 205 205 $sFileName = time(); 206 $sFileExt = ''; 206 $sFileExt = ''; 207 207 if($oForm->isSubmittedAndValid() && $bFile = (isImage($_FILES['Icon']['type'], $sFileExt) && !empty($_FILES['Icon']['tmp_name']) && move_uploaded_file($_FILES['Icon']['tmp_name'], $sFilePath . $sFileName . '.' . $sFileExt))) { 208 $sPath = $sFilePath . $sFileName . '.' . $sFileExt;209 imageResize($sPath, $sPath, 110, 110);210 211 $iId = (int)$oForm->insert(array('Icon' => $sFileName . '.' . $sFileExt));212 if($iId != 0)213 addStringToLanguage("_adm_txt_mp_" . strtolower(bx_get('name')), bx_get('name'));214 215 header('Location: ' . $oForm->aFormAttrs['action']); 208 $sPath = $sFilePath . $sFileName . '.' . $sFileExt; 209 imageResize($sPath, $sPath, 110, 110); 210 211 $iId = (int)$oForm->insert(array('Icon' => $sFileName . '.' . $sFileExt)); 212 if($iId != 0) 213 addStringToLanguage("_adm_txt_mp_" . strtolower(bx_get('name')), bx_get('name')); 214 215 header('Location: ' . $oForm->aFormAttrs['action']); 216 216 } else { 217 if(!$bFile)218 $oForm->aInputs['Icon']['error'] = $oForm->aInputs['Icon']['checker']['error'];219 217 if(!$bFile) 218 $oForm->aInputs['Icon']['error'] = $oForm->aInputs['Icon']['checker']['error']; 219 220 220 return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_create'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode()))); 221 221 } … … 254 254 'title' => $aLevel['title'] 255 255 ) 256 ), 256 ), 257 257 ); 258 258 259 259 //--- Get Controls ---// 260 260 $aButtons = array( … … 262 262 'adm-mlevels-disable' => _t('_adm_btn_mlevels_disable'), 263 263 'adm-mlevels-delete' => _t('_adm_btn_mlevels_delete') 264 ); 264 ); 265 265 $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mlevels-list-form', $aButtons, 'levels'); 266 266 267 267 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels_list.html', array('bx_repeat:items' => $aItems, 'controls' => $sControls)); 268 268 269 269 if($mixedResult !== true && !empty($mixedResult)) 270 270 $sResult = MsgBox(_t($mixedResult), 3) . $sResult; … … 307 307 $aButtons = array( 308 308 'adm-mlevels-actions-enable' => _t('_adm_btn_mlevels_enable'), 309 'adm-mlevels-actions-disable' => _t('_adm_btn_mlevels_disable') 310 ); 309 'adm-mlevels-actions-disable' => _t('_adm_btn_mlevels_disable') 310 ); 311 311 $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mlevels-actions-form', $aButtons, 'actions'); 312 312 313 313 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels_actions.html', array( 314 314 'id' => $iId, … … 317 317 'url_admin' => $GLOBALS['site']['url_admin'] 318 318 )); 319 319 320 320 if($mixedResult !== true && !empty($mixedResult)) 321 321 $sResult = MsgBox(_t($mixedResult), 3) . $sResult; … … 325 325 function PageCodeAction($iLevelId, $iActionId, $mixedResult) { 326 326 $aAction = $GLOBALS['MySQL']->getRow("SELECT * FROM `sys_acl_matrix` WHERE `IDLevel`='" . $iLevelId . "' AND `IDAction`='" . $iActionId . "'"); 327 327 328 328 $aForm = array( 329 329 'form_attrs' => array( … … 332 332 'action' => $GLOBALS['site']['url_admin'] . 'memb_levels.php', 333 333 'method' => 'post', 334 'enctype' => 'multipart/form-data' 334 'enctype' => 'multipart/form-data' 335 335 ), 336 336 'params' => array (), 337 'inputs' => array ( 337 'inputs' => array ( 338 338 'levelId' => array( 339 339 'type' => 'hidden', … … 375 375 'value' => isset($aAction['AllowedPeriodEnd']) ? $aAction['AllowedPeriodEnd'] : "", 376 376 'display' => 'filterDate', 377 ), 377 ), 378 378 'adm-mlevels-action-save' => array( 379 379 'type' => 'submit', 380 380 'name' => 'adm-mlevels-action-save', 381 381 'value' => _t('_adm_btn_mlevels_save'), 382 ), 382 ), 383 383 ) 384 384 ); … … 386 386 387 387 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels_action.html', array( 388 'content' => $oForm->getCode() 388 'content' => $oForm->getCode() 389 389 )); 390 390 391 391 if($mixedResult !== true && !empty($mixedResult)) 392 392 $sResult = MsgBox(_t($mixedResult), 3) . $sResult; … … 402 402 $oModuleDb = new BxDolModuleDb(); 403 403 if($oModuleDb->isModule('payment')) { 404 $aInfo = BxDolService::call('payment', 'get_currency_info');405 $sCurrencySign = $aInfo['sign'];406 } 407 else 408 $sCurrencySign = getParam('currency_sign');404 $aInfo = BxDolService::call('payment', 'get_currency_info'); 405 $sCurrencySign = $aInfo['sign']; 406 } 407 else 408 $sCurrencySign = getParam('currency_sign'); 409 409 410 410 $aPrices = $GLOBALS['MySQL']->getAll("SELECT `id` AS `id`, `Days` AS `days`, `Price` AS `price` FROM `sys_acl_level_prices` WHERE `IDLevel`='" . $iId . "' ORDER BY `id`"); … … 418 418 $aButtons = array( 419 419 'adm-mlevels-prices-delete' => _t('_adm_btn_mlevels_delete') 420 ); 420 ); 421 421 $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mlevels-prices-form', $aButtons, 'prices'); 422 422 423 423 $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels_prices.html', array( 424 424 'id' => $iId, … … 433 433 } 434 434 function isImage($sMimeType, &$sFileExtension) { 435 $bResult = true;436 switch($sMimeType) {437 case 'image/jpeg':438 case 'image/pjpeg':439 $sFileExtension = 'jpg';440 break;441 case 'image/png':442 case 'image/x-png':443 $sFileExtension = 'png';444 break;445 case 'image/gif':446 $sFileExtension = 'gif';447 break;448 default:449 $bResult = false;450 }451 return $bResult;435 $bResult = true; 436 switch($sMimeType) { 437 case 'image/jpeg': 438 case 'image/pjpeg': 439 $sFileExtension = 'jpg'; 440 break; 441 case 'image/png': 442 case 'image/x-png': 443 $sFileExtension = 'png'; 444 break; 445 case 'image/gif': 446 $sFileExtension = 'gif'; 447 break; 448 default: 449 $bResult = false; 450 } 451 return $bResult; 452 452 } 453 453 function deleteMembership($iId) { 454 $iId = (int)$iId;455 456 $aLevel = $GLOBALS['MySQL']->getRow("SELECT `Icon` AS `icon`, `Removable` AS `removable` FROM `sys_acl_levels` WHERE `ID`='" . $iId . "'");457 if(empty($aLevel))458 return "_adm_txt_mlevels_not_found";459 460 //Check if membership can be removed461 if($aLevel['removable'] != 'yes')462 return '_adm_txt_mlevels_cannot_remove';463 464 //Check if there are still members using this membership465 $iDateExpires = $GLOBALS['MySQL']->getOne("SELECT UNIX_TIMESTAMP(MAX(`DateExpires`)) as `MaxDateExpires` FROM `sys_acl_levels_members` WHERE `IDLevel`='" . $iId . "'");466 if($iDateExpires > time())467 return "_adm_txt_mlevels_is_used";468 469 @unlink(BX_DIRECTORY_PATH_ROOT . 'media/images/membership/' . $aLevel['icon']);470 db_res("DELETE FROM `sys_acl_level_prices` WHERE `IDLevel`='" . $iId . "'");471 db_res("DELETE FROM `sys_acl_matrix` WHERE `IDLevel`='" . $iId . "'");472 db_res("DELETE FROM `sys_acl_levels` WHERE `ID`='" . $iId . "'");473 474 return true;454 $iId = (int)$iId; 455 456 $aLevel = $GLOBALS['MySQL']->getRow("SELECT `Icon` AS `icon`, `Removable` AS `removable` FROM `sys_acl_levels` WHERE `ID`='" . $iId . "'"); 457 if(empty($aLevel)) 458 return "_adm_txt_mlevels_not_found"; 459 460 //Check if membership can be removed 461 if($aLevel['removable'] != 'yes') 462 return '_adm_txt_mlevels_cannot_remove'; 463 464 //Check if there are still members using this membership 465 $iDateExpires = $GLOBALS['MySQL']->getOne("SELECT UNIX_TIMESTAMP(MAX(`DateExpires`)) as `MaxDateExpires` FROM `sys_acl_levels_members` WHERE `IDLevel`='" . $iId . "'"); 466 if($iDateExpires > time()) 467 return "_adm_txt_mlevels_is_used"; 468 469 @unlink(BX_DIRECTORY_PATH_ROOT . 'media/images/membership/' . $aLevel['icon']); 470 db_res("DELETE FROM `sys_acl_level_prices` WHERE `IDLevel`='" . $iId . "'"); 471 db_res("DELETE FROM `sys_acl_matrix` WHERE `IDLevel`='" . $iId . "'"); 472 db_res("DELETE FROM `sys_acl_levels` WHERE `ID`='" . $iId . "'"); 473 474 return true; 475 475 } 476 476 ?> -
trunk/administration/member_menu_compose.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 41 41 42 42 $GLOBALS['oAdmTemplate']->addJsTranslation(array( 43 '_adm_mbuilder_Sorry_could_not_insert_object',44 '_adm_mbuilder_This_items_are_non_editable'43 '_adm_mbuilder_Sorry_could_not_insert_object', 44 '_adm_mbuilder_This_items_are_non_editable' 45 45 )); 46 46 … … 48 48 49 49 $aMenuSection = array ( 50 'top', 'top_extra'50 'top', 'top_extra' 51 51 ); 52 52 … … 58 58 59 59 if ( isset($_GET['menu_position']) ) { 60 foreach( $aMenuSection AS $sValue ) {61 if ( $sValue == $_GET['menu_position'] ) { 62 $sMenuSection = $sValue;63 break;64 } 65 }60 foreach( $aMenuSection AS $sValue ) { 61 if ( $sValue == $_GET['menu_position'] ) { 62 $sMenuSection = $sValue; 63 break; 64 } 65 } 66 66 } 67 67 68 68 // ** FOR 'AJAX' REQUESTS ; 69 69 if(bx_get('action') !== false) { 70 switch(bx_get('action')) {71 case 'edit_form':72 $id = (int)bx_get('id');73 74 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_member` WHERE `ID` = $id", 0 );75 $sResponce = ($aItem) ? showEditForm($aItem, $sMenuSection) : echoMenuEditMsg('Error', 'red');76 break;77 case 'create_item':78 $newID = createNewElement($_POST['type'], (int)$_POST['source'], $sMenuSection);79 $sResponce = $newID;80 break;81 case 'deactivate_item':82 $res = db_res( "UPDATE `sys_menu_member` SET `Active`='0' WHERE `ID`=" . (int)bx_get('id') );70 switch(bx_get('action')) { 71 case 'edit_form': 72 $id = (int)bx_get('id'); 73 74 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_member` WHERE `ID` = $id", 0 ); 75 $sResponce = ($aItem) ? showEditForm($aItem, $sMenuSection) : echoMenuEditMsg('Error', 'red'); 76 break; 77 case 'create_item': 78 $newID = createNewElement($_POST['type'], (int)$_POST['source'], $sMenuSection); 79 $sResponce = $newID; 80 break; 81 case 'deactivate_item': 82 $res = db_res( "UPDATE `sys_menu_member` SET `Active`='0' WHERE `ID`=" . (int)bx_get('id') ); 83 83 $sResponce = db_affected_rows(); 84 break;85 case 'save_item':86 $id = (int)$_POST['id'];87 if( !$id ) {88 $sResponce = echoMenuEditMsg( 'Error', 'red' );89 } else {84 break; 85 case 'save_item': 86 $id = (int)$_POST['id']; 87 if( !$id ) { 88 $sResponce = echoMenuEditMsg( 'Error', 'red' ); 89 } else { 90 90 $aItemFields = array( 'Name', 'Caption', 'Link', 'Target', 'Icon', 'Script' ); 91 $aItem = array();91 $aItem = array(); 92 92 93 93 foreach( $aItemFields as $field ) { 94 $aItem[$field] = ( isset($_POST[$field]) ) ? $_POST[$field] : null ;95 }94 $aItem[$field] = ( isset($_POST[$field]) ) ? $_POST[$field] : null ; 95 } 96 96 97 97 if ( !$aItem['Icon'] ) { … … 99 99 } 100 100 101 $res = saveItem( $id, $aItem, $sMenuSection );102 updateLangFile( $_POST['Caption'], $_POST['LangCaption'] );103 104 $res['message'] = MsgBox($res['message']);105 $oJson = new Services_JSON(); 106 echo $oJson->encode($res);101 $res = saveItem( $id, $aItem, $sMenuSection ); 102 updateLangFile( $_POST['Caption'], $_POST['LangCaption'] ); 103 104 $res['message'] = MsgBox($res['message']); 105 $oJson = new Services_JSON(); 106 echo $oJson->encode($res); 107 107 exit; 108 108 } 109 break;110 111 case 'delete_item':112 $id = (int)$_POST['id'];113 if( !$id ) {114 $sResponce = 'Item ID is not specified';115 } else {116 $aItem = db_arr( "SELECT `Deletable` FROM `sys_menu_member` WHERE `ID` = $id" );117 if( !$aItem ) {118 $sResponce = 'Item not found';119 } else if( !(int)$aItem['Deletable'] ) {120 $sResponce = 'Item is non-deletable';121 } else {122 db_res( "DELETE FROM `sys_menu_member` WHERE `ID` = $id" );123 $sResponce = ( db_affected_rows() ) ? 'OK' : 'Couldn\'t delete the item';124 } 125 } 126 break;127 128 case 'save_orders':129 saveOrders( bx_get('top'), bx_get('custom'), $sMenuSection );130 $sResponce = 'OK';131 break;132 }109 break; 110 111 case 'delete_item': 112 $id = (int)$_POST['id']; 113 if( !$id ) { 114 $sResponce = 'Item ID is not specified'; 115 } else { 116 $aItem = db_arr( "SELECT `Deletable` FROM `sys_menu_member` WHERE `ID` = $id" ); 117 if( !$aItem ) { 118 $sResponce = 'Item not found'; 119 } else if( !(int)$aItem['Deletable'] ) { 120 $sResponce = 'Item is non-deletable'; 121 } else { 122 db_res( "DELETE FROM `sys_menu_member` WHERE `ID` = $id" ); 123 $sResponce = ( db_affected_rows() ) ? 'OK' : 'Couldn\'t delete the item'; 124 } 125 } 126 break; 127 128 case 'save_orders': 129 saveOrders( bx_get('top'), bx_get('custom'), $sMenuSection ); 130 $sResponce = 'OK'; 131 break; 132 } 133 133 134 134 // return script's response and recompile the menu cache ; … … 140 140 // generate all active menu items ; 141 141 142 $sTopQuery = "SELECT `ID`, `Name`, `Movable` FROM `sys_menu_member` WHERE `Active`='1' AND `Position`='{$sMenuSection}' AND `Type`<>'linked_item' ORDER BY `Order`";142 $sTopQuery = "SELECT `ID`, `Name`, `Movable` FROM `sys_menu_member` WHERE `Active`='1' AND `Position`='{$sMenuSection}' AND `Type`<>'linked_item' ORDER BY `Order`"; 143 143 $rTopItems = db_res($sTopQuery); 144 144 … … 148 148 149 149 $sComposerInit = " 150 <script type=\"text/javascript\">151 topParentID = 'menu_app_wrapper';152 urlIconLoading = '{$site['url_admin']}images/loading.gif';153 parserUrl = '" . $GLOBALS['site']['url_admin'] . "member_menu_compose.php?menu_position={$sMenuSection}';154 155 allowNewItem = true;156 allowAddToTop = true;157 allowAddToCustom = false;158 iInactivePerRow = 5;159 sendSystemOrder = false;160 161 aCoords = {};162 aCoords['startX'] = 270;163 aCoords['startY'] = 235;164 aCoords['width'] = 92;165 aCoords['height'] = 21;166 aCoords['diffX'] = 122;167 aCoords['diffY'] = 32;168 169 aTopItems = {};170 aCustomItems = {};171 aSystemItems = {};172 aAllItems = {};150 <script type=\"text/javascript\"> 151 topParentID = 'menu_app_wrapper'; 152 urlIconLoading = '{$site['url_admin']}images/loading.gif'; 153 parserUrl = '" . $GLOBALS['site']['url_admin'] . "member_menu_compose.php?menu_position={$sMenuSection}'; 154 155 allowNewItem = true; 156 allowAddToTop = true; 157 allowAddToCustom = false; 158 iInactivePerRow = 5; 159 sendSystemOrder = false; 160 161 aCoords = {}; 162 aCoords['startX'] = 270; 163 aCoords['startY'] = 235; 164 aCoords['width'] = 92; 165 aCoords['height'] = 21; 166 aCoords['diffX'] = 122; 167 aCoords['diffY'] = 32; 168 169 aTopItems = {}; 170 aCustomItems = {}; 171 aSystemItems = {}; 172 aAllItems = {}; 173 173 "; 174 174 175 175 $iIndex = 0; 176 176 while(($aTopItem = mysql_fetch_assoc($rTopItems)) !== false) { 177 $sComposerInit .= "178 179 aTopItems[$iIndex] = [{$aTopItem['ID']}, '" . addslashes( $aTopItem['Name'] ) . "', {$aTopItem['Movable']}];180 aCustomItems[$iIndex] = {};";181 182 $iIndex++;177 $sComposerInit .= " 178 179 aTopItems[$iIndex] = [{$aTopItem['ID']}, '" . addslashes( $aTopItem['Name'] ) . "', {$aTopItem['Movable']}]; 180 aCustomItems[$iIndex] = {};"; 181 182 $iIndex++; 183 183 } 184 184 185 185 $sComposerInit .= "\n"; 186 186 while(($aAllItem = mysql_fetch_assoc($rAllItems)) !== false) { 187 $sComposerInit .= "188 aAllItems[{$aAllItem['ID']}] = '" . addslashes( $aAllItem['Name'] ) . "';";189 } 190 $sComposerInit .= "191 </script>187 $sComposerInit .= " 188 aAllItems[{$aAllItem['ID']}] = '" . addslashes( $aAllItem['Name'] ) . "';"; 189 } 190 $sComposerInit .= " 191 </script> 192 192 "; 193 193 … … 203 203 $_page_cont[$iNameIndex]['controls'] = getSwitcherBlock(); 204 204 $_page_cont[$iNameIndex]['page_main_code'] = $GLOBALS['oAdmTemplate']->parseHtmlByName('menu_compose.html', array( 205 'extra_js' => $sComposerInit 205 'extra_js' => $sComposerInit 206 206 )); 207 207 … … 213 213 { 214 214 global $aMenuSection; 215 215 216 216 $sOutputCode = '<div class="dbTopMenu">'; 217 217 foreach($aMenuSection as $sKey) … … 231 231 switch($sClassName) { 232 232 case 'active' : 233 $sOutputCode .= 233 $sOutputCode .= 234 234 ' 235 235 <div class="' . $sClassName . '"> … … 238 238 '; 239 239 break; 240 240 241 241 case 'notActive' : 242 $sOutputCode .= 242 $sOutputCode .= 243 243 ' 244 244 <div class="' . $sClassName . '"> … … 263 263 'enctype' => 'multipart/form-data', 264 264 ), 265 'inputs' => array ( 265 'inputs' => array ( 266 266 'Name' => array( 267 267 'type' => 'text', … … 292 292 'attrs' => array() 293 293 ), 294 'Script' => array(294 'Script' => array( 295 295 'type' => 'text', 296 296 'name' => 'Script', … … 326 326 'onclick' => 'javascript:saveItem(' . $aItem['ID'] . ');' 327 327 ) 328 ), 328 ), 329 329 array( 330 330 'type' => 'button', … … 335 335 ) 336 336 ) 337 ), 337 ), 338 338 ) 339 339 ); 340 340 341 341 foreach($aForm['inputs'] as $sKey => $aInput) 342 342 if(in_array($aInput['type'], array('text', 'checkbox')) && !$aItem['Editable']) … … 349 349 350 350 $oForm = new BxTemplFormView($aForm); 351 return PopupBox('mmc_edit_popup', _t('_adm_mbuilder_edit_item')351 return PopupBox('mmc_edit_popup', _t('_adm_mbuilder_edit_item') 352 352 , $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html' 353 353 , array('content' => $oForm->getCode() . LoadingBox('formItemEditLoading')))); … … 356 356 /** 357 357 * @description : function will create new menu items ; 358 * @param : $type (string) - type of ellement ;359 * @param : $source (integer) - menu's ID;360 * @return : ID of created menu item ;358 * @param : $type (string) - type of ellement ; 359 * @param : $source (integer) - menu's ID; 360 * @return : ID of created menu item ; 361 361 */ 362 362 function createNewElement( $type, $source, $sMenuSection = 'top' ) { 363 global $oMenu;364 365 if( $source ) {366 $sourceActive = db_value( "SELECT `Active` FROM `sys_menu_member` WHERE `ID`=$source" );367 if( !$sourceActive ) {368 //convert to active369 db_res( "UPDATE `sys_menu_member` SET `Active`='1', `Position`='$type' WHERE `ID`=$source" );370 $newID = $source;371 } else {372 //create from source373 db_res( "INSERT INTO `sys_menu_member`374 ( `Name`, `Caption`, `Link`, `Target`, `Script`, `Position`, `Eval`, `Icon`, `Type`, `Bubble`, `Description`, `PopupMenu`)375 SELECT376 `Name`, `Caption`, `Link`, `Target`, `Script`, '$type', `Eval`, `Icon`, `Type`, `Bubble`, `Description`, `PopupMenu`377 FROM `sys_menu_member`378 WHERE `ID`=$source" );379 $newID = db_last_id();380 }381 } else {382 //create new383 db_res( "INSERT INTO `sys_menu_member` ( `Name`, `Position` ) VALUES ( 'NEW ITEM', '$type' )" );384 $newID = db_last_id();385 }386 387 return $newID;363 global $oMenu; 364 365 if( $source ) { 366 $sourceActive = db_value( "SELECT `Active` FROM `sys_menu_member` WHERE `ID`=$source" ); 367 if( !$sourceActive ) { 368 //convert to active 369 db_res( "UPDATE `sys_menu_member` SET `Active`='1', `Position`='$type' WHERE `ID`=$source" ); 370 $newID = $source; 371 } else { 372 //create from source 373 db_res( "INSERT INTO `sys_menu_member` 374 ( `Name`, `Caption`, `Link`, `Target`, `Script`, `Position`, `Eval`, `Icon`, `Type`, `Bubble`, `Description`, `PopupMenu`) 375 SELECT 376 `Name`, `Caption`, `Link`, `Target`, `Script`, '$type', `Eval`, `Icon`, `Type`, `Bubble`, `Description`, `PopupMenu` 377 FROM `sys_menu_member` 378 WHERE `ID`=$source" ); 379 $newID = db_last_id(); 380 } 381 } else { 382 //create new 383 db_res( "INSERT INTO `sys_menu_member` ( `Name`, `Position` ) VALUES ( 'NEW ITEM', '$type' )" ); 384 $newID = db_last_id(); 385 } 386 387 return $newID; 388 388 } 389 389 390 390 function echoMenuEditMsg( $text, $color = 'black' ) { 391 391 return <<<HTML 392 <div style="color:{$color};text-align:center;">{$text}</div>392 <div style="color:{$color};text-align:center;">{$text}</div> 393 393 HTML; 394 394 } … … 396 396 /** 397 397 * @description : function will save all changes into menu items ; 398 * @param : $id (integer) - ID of menu items ;399 * @param : $aItem (array) - all needed POST variables ;400 * @param : $sMenuSection (string) - position of menu ;401 * @return : Html presentation data (Answer code);398 * @param : $id (integer) - ID of menu items ; 399 * @param : $aItem (array) - all needed POST variables ; 400 * @param : $sMenuSection (string) - position of menu ; 401 * @return : Html presentation data (Answer code); 402 402 */ 403 403 function saveItem( $id, $aItem, $sMenuSection ) { 404 global $oMenu, $sMenuSection, $oMemeberMenu;405 406 $aOldItem = db_arr( "SELECT * FROM `sys_menu_member` WHERE `ID` = $id" );407 408 if(!$aOldItem) {409 return array( 'code' => 2, 'message' => _t('_adm_mbuilder_Item_not_found') );410 }411 412 if( (int) $aOldItem['Editable'] != 1 ) {413 return array('code' => 3, 'message' => _t('_adm_mbuilder_Item_is_non_editable') );414 }415 416 $sQuerySet = '';417 foreach( $aItem as $field => $value )418 $sQuerySet .= ", `$field`='" . process_db_input( $value ) ."'";419 420 $sQuerySet = substr( $sQuerySet, 1 );421 422 $sQuery = "UPDATE `sys_menu_member` SET $sQuerySet WHERE `ID` = $id";423 db_res( $sQuery );404 global $oMenu, $sMenuSection, $oMemeberMenu; 405 406 $aOldItem = db_arr( "SELECT * FROM `sys_menu_member` WHERE `ID` = $id" ); 407 408 if(!$aOldItem) { 409 return array( 'code' => 2, 'message' => _t('_adm_mbuilder_Item_not_found') ); 410 } 411 412 if( (int) $aOldItem['Editable'] != 1 ) { 413 return array('code' => 3, 'message' => _t('_adm_mbuilder_Item_is_non_editable') ); 414 } 415 416 $sQuerySet = ''; 417 foreach( $aItem as $field => $value ) 418 $sQuerySet .= ", `$field`='" . process_db_input( $value ) ."'"; 419 420 $sQuerySet = substr( $sQuerySet, 1 ); 421 422 $sQuery = "UPDATE `sys_menu_member` SET $sQuerySet WHERE `ID` = $id"; 423 db_res( $sQuery ); 424 424 425 425 // return script's response and recompile the menu cache ; 426 426 $oMemeberMenu -> createMemberMenuCache( $sMenuSection ); 427 427 428 return array('code' => 0, 'message' => _t('_Saved'), 'timer' => 3);428 return array('code' => 0, 'message' => _t('_Saved'), 'timer' => 3); 429 429 } 430 430 431 431 function updateLangFile( $key, $string ) { 432 // clear from special chars ;433 434 $key = preg_replace( '|\{([^\}]+)\}|', '', $key);435 436 $langName = getParam( 'lang_default' );437 $langID = db_value( "SELECT `ID` FROM `sys_localization_languages` WHERE `Name` = '" . addslashes( $langName ) . "'" );438 439 $keyID = db_value( "SELECT `ID` FROM `sys_localization_keys` WHERE `Key` = '" . process_db_input( $key ) . "'" );440 if( $keyID ) {441 db_res( "UPDATE `sys_localization_strings` SET `String` = '" .process_db_input( $string ) . "' WHERE `IDKey`=$keyID AND `IDLanguage`=$langID" );442 } else {443 db_res( "INSERT INTO `sys_localization_keys` SET `IDCategory` = 2, `Key` = '" . process_db_input( $key ) . "'" );444 db_res( "INSERT INTO `sys_localization_strings` SET `IDKey` = " . db_last_id() . ", `IDLanguage` = $langID, `String` = '" .process_db_input( $string ) . "'" );445 }446 447 compileLanguage($langID);432 // clear from special chars ; 433 434 $key = preg_replace( '|\{([^\}]+)\}|', '', $key); 435 436 $langName = getParam( 'lang_default' ); 437 $langID = db_value( "SELECT `ID` FROM `sys_localization_languages` WHERE `Name` = '" . addslashes( $langName ) . "'" ); 438 439 $keyID = db_value( "SELECT `ID` FROM `sys_localization_keys` WHERE `Key` = '" . process_db_input( $key ) . "'" ); 440 if( $keyID ) { 441 db_res( "UPDATE `sys_localization_strings` SET `String` = '" .process_db_input( $string ) . "' WHERE `IDKey`=$keyID AND `IDLanguage`=$langID" ); 442 } else { 443 db_res( "INSERT INTO `sys_localization_keys` SET `IDCategory` = 2, `Key` = '" . process_db_input( $key ) . "'" ); 444 db_res( "INSERT INTO `sys_localization_strings` SET `IDKey` = " . db_last_id() . ", `IDLanguage` = $langID, `String` = '" .process_db_input( $string ) . "'" ); 445 } 446 447 compileLanguage($langID); 448 448 } 449 449 450 450 /** 451 451 * @description : function will save menu orders ; 452 * @param : $sTop ( string ) - current menu ellement ;453 * @param : $aCustom ( array ) - all mrnu items ;454 * @param : $sMenuSection (string) - position of menu ;452 * @param : $sTop ( string ) - current menu ellement ; 453 * @param : $aCustom ( array ) - all mrnu items ; 454 * @param : $sMenuSection (string) - position of menu ; 455 455 */ 456 456 function saveOrders( $sTop, $aCustom, $sMenuSection ) { 457 db_res( "UPDATE `sys_menu_member` SET `Order` = 0 WHERE `Position` = '{$sMenuSection}' " );458 459 $sTop = trim( $sTop, ' ,' );460 $aTopIDs = explode( ',', $sTop );461 462 foreach( $aTopIDs as $iOrd => $iID ) {463 $iID = trim( $iID, ' ,' );464 $iID = (int)$iID;465 466 if( !$iID )467 continue;468 469 db_res( "UPDATE `sys_menu_member` SET `Order` = $iOrd, `Position` = '{$sMenuSection}' WHERE `ID` = $iID" );470 }457 db_res( "UPDATE `sys_menu_member` SET `Order` = 0 WHERE `Position` = '{$sMenuSection}' " ); 458 459 $sTop = trim( $sTop, ' ,' ); 460 $aTopIDs = explode( ',', $sTop ); 461 462 foreach( $aTopIDs as $iOrd => $iID ) { 463 $iID = trim( $iID, ' ,' ); 464 $iID = (int)$iID; 465 466 if( !$iID ) 467 continue; 468 469 db_res( "UPDATE `sys_menu_member` SET `Order` = $iOrd, `Position` = '{$sMenuSection}' WHERE `ID` = $iID" ); 470 } 471 471 } 472 472 -
trunk/administration/menu_compose_admin.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 36 36 37 37 if(bx_get('action') !== false) { 38 switch(bx_get('action')) {39 case 'edit_form':40 $id = (int)bx_get('id');41 42 if( $id < 1000 ) {43 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_admin` WHERE `id` = '{$id}'", 0 );44 if( $aItem )45 echo showEditFormCustom( $aItem );46 else47 echo echoMenuEditMsg( _t('_Error'), 'red' );48 } else {49 $id = $id - 1000;50 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_admin` WHERE `id` = '{$id}' AND `parent_id`='0'", 0 );51 if( $aItem )52 echo showEditFormTop( $aItem );53 else54 echo echoMenuEditMsg( _t('_Error'), 'red' );55 }56 exit;57 case 'create_item':58 $newID = createNewElement($_POST['type'], (int)$_POST['source']);59 echo $newID;60 exit;61 case 'deactivate_item':62 $id = (int)bx_get('id');63 if( $id > 1000 ) {64 $id = $id - 1000;65 db_res( "DELETE FROM `sys_menu_admin` WHERE `id`='{$id}' AND `parent_id`='0'" );66 echo db_affected_rows();67 } else68 echo 1;69 exit;70 case 'save_item':71 $id = (int)$_POST['id'];72 if( !$id ) {73 $aResult = array('code' => 1, 'message' => _t('_Error occured'));74 } else {75 if( $id < 1000 ) {76 $aItemFields = array( 'title', 'url', 'description', 'check', 'icon' );77 $aItem = array();78 foreach( $aItemFields as $field )79 $aItem[$field] = $_POST[$field];80 } else {81 $id = $id - 1000;82 $aItemFields = array( 'title', 'icon', 'icon_large' );83 $aItem = array();84 foreach( $aItemFields as $field )85 $aItem[$field] = $_POST[$field];86 }87 $aResult = saveItem( $id, $aItem );88 }89 $aResult['message'] = MsgBox($aResult['message']);90 91 $oJson = new Services_JSON();38 switch(bx_get('action')) { 39 case 'edit_form': 40 $id = (int)bx_get('id'); 41 42 if( $id < 1000 ) { 43 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_admin` WHERE `id` = '{$id}'", 0 ); 44 if( $aItem ) 45 echo showEditFormCustom( $aItem ); 46 else 47 echo echoMenuEditMsg( _t('_Error'), 'red' ); 48 } else { 49 $id = $id - 1000; 50 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_admin` WHERE `id` = '{$id}' AND `parent_id`='0'", 0 ); 51 if( $aItem ) 52 echo showEditFormTop( $aItem ); 53 else 54 echo echoMenuEditMsg( _t('_Error'), 'red' ); 55 } 56 exit; 57 case 'create_item': 58 $newID = createNewElement($_POST['type'], (int)$_POST['source']); 59 echo $newID; 60 exit; 61 case 'deactivate_item': 62 $id = (int)bx_get('id'); 63 if( $id > 1000 ) { 64 $id = $id - 1000; 65 db_res( "DELETE FROM `sys_menu_admin` WHERE `id`='{$id}' AND `parent_id`='0'" ); 66 echo db_affected_rows(); 67 } else 68 echo 1; 69 exit; 70 case 'save_item': 71 $id = (int)$_POST['id']; 72 if( !$id ) { 73 $aResult = array('code' => 1, 'message' => _t('_Error occured')); 74 } else { 75 if( $id < 1000 ) { 76 $aItemFields = array( 'title', 'url', 'description', 'check', 'icon' ); 77 $aItem = array(); 78 foreach( $aItemFields as $field ) 79 $aItem[$field] = $_POST[$field]; 80 } else { 81 $id = $id - 1000; 82 $aItemFields = array( 'title', 'icon', 'icon_large' ); 83 $aItem = array(); 84 foreach( $aItemFields as $field ) 85 $aItem[$field] = $_POST[$field]; 86 } 87 $aResult = saveItem( $id, $aItem ); 88 } 89 $aResult['message'] = MsgBox($aResult['message']); 90 91 $oJson = new Services_JSON(); 92 92 echo $oJson->encode($aResult); 93 exit;94 case 'delete_item':95 $id = (int)$_POST['id'];96 if( !$id ) {97 echo _t('_adm_mbuilder_Item_ID_not_specified');98 exit;99 }100 101 if( $id > 1000 ) {102 $id = $id - 1000;103 104 db_res( "DELETE FROM `sys_menu_admin` WHERE `id` = '{$id}' AND `parent_id`='0'" );105 } else {106 db_res( "DELETE FROM `sys_menu_admin` WHERE `id` = '{$id}'" );107 }108 109 if( db_affected_rows() )110 echo 'OK';111 else112 echo _t('_adm_mbuilder_Could_not_delete_the_item');113 exit;114 case 'save_orders':115 saveOrders(bx_get('top'), bx_get('custom'));116 echo 'OK';117 exit;118 }93 exit; 94 case 'delete_item': 95 $id = (int)$_POST['id']; 96 if( !$id ) { 97 echo _t('_adm_mbuilder_Item_ID_not_specified'); 98 exit; 99 } 100 101 if( $id > 1000 ) { 102 $id = $id - 1000; 103 104 db_res( "DELETE FROM `sys_menu_admin` WHERE `id` = '{$id}' AND `parent_id`='0'" ); 105 } else { 106 db_res( "DELETE FROM `sys_menu_admin` WHERE `id` = '{$id}'" ); 107 } 108 109 if( db_affected_rows() ) 110 echo 'OK'; 111 else 112 echo _t('_adm_mbuilder_Could_not_delete_the_item'); 113 exit; 114 case 'save_orders': 115 saveOrders(bx_get('top'), bx_get('custom')); 116 echo 'OK'; 117 exit; 118 } 119 119 } 120 120 … … 129 129 130 130 $sComposerInit = " 131 <script type=\"text/javascript\">132 topParentID = 'menu_app_wrapper';133 urlIconLoading = '{$site['url_admin']}images/loading.gif';134 parserUrl = '" . $GLOBALS['site']['url_admin'] . "menu_compose_admin.php?';135 136 allowNewItem = true;137 allowAddToTop = true;138 allowAddToCustom = true;139 iInactivePerRow = 7;140 sendSystemOrder = false;141 142 aCoords = {};143 aCoords['startX'] = 270;144 aCoords['startY'] = 235;145 aCoords['width'] = 92;146 aCoords['height'] = 21;147 aCoords['diffX'] = 122;148 aCoords['diffY'] = 32;149 150 aTopItems = {};151 aCustomItems = {};152 aSystemItems = {};153 aAllItems = {};131 <script type=\"text/javascript\"> 132 topParentID = 'menu_app_wrapper'; 133 urlIconLoading = '{$site['url_admin']}images/loading.gif'; 134 parserUrl = '" . $GLOBALS['site']['url_admin'] . "menu_compose_admin.php?'; 135 136 allowNewItem = true; 137 allowAddToTop = true; 138 allowAddToCustom = true; 139 iInactivePerRow = 7; 140 sendSystemOrder = false; 141 142 aCoords = {}; 143 aCoords['startX'] = 270; 144 aCoords['startY'] = 235; 145 aCoords['width'] = 92; 146 aCoords['height'] = 21; 147 aCoords['diffX'] = 122; 148 aCoords['diffY'] = 32; 149 150 aTopItems = {}; 151 aCustomItems = {}; 152 aSystemItems = {}; 153 aAllItems = {}; 154 154 "; 155 155 156 156 $iIndex = 0; 157 157 while(($aTopItem = mysql_fetch_assoc($rTopItems)) !== false) { 158 $sTopestTitle = _t($aTopItem['title']);159 $sComposerInit .= "160 161 aTopItems[$iIndex] = [" . ($aTopItem['id'] + 1000) . ", '{$sTopestTitle}', 3];162 aCustomItems[$iIndex] = {};";163 $sQuery = "SELECT `id`, `title` FROM `sys_menu_admin` WHERE `parent_id`='{$aTopItem['id']}' ORDER BY `order`";164 165 $iSubIndex = 0;166 $rCustomItems = db_res( $sQuery );167 while(($aCustomItem = mysql_fetch_assoc($rCustomItems)) !== false) {168 $sCustomTitle = _t($aCustomItem['title']);169 $sComposerInit .= "170 aCustomItems[$iIndex][" . ($iSubIndex++) . "] = [{$aCustomItem['id']}, '{$sCustomTitle}', 3];";171 }172 173 $iIndex++;158 $sTopestTitle = _t($aTopItem['title']); 159 $sComposerInit .= " 160 161 aTopItems[$iIndex] = [" . ($aTopItem['id'] + 1000) . ", '{$sTopestTitle}', 3]; 162 aCustomItems[$iIndex] = {};"; 163 $sQuery = "SELECT `id`, `title` FROM `sys_menu_admin` WHERE `parent_id`='{$aTopItem['id']}' ORDER BY `order`"; 164 165 $iSubIndex = 0; 166 $rCustomItems = db_res( $sQuery ); 167 while(($aCustomItem = mysql_fetch_assoc($rCustomItems)) !== false) { 168 $sCustomTitle = _t($aCustomItem['title']); 169 $sComposerInit .= " 170 aCustomItems[$iIndex][" . ($iSubIndex++) . "] = [{$aCustomItem['id']}, '{$sCustomTitle}', 3];"; 171 } 172 173 $iIndex++; 174 174 } 175 175 176 176 $sComposerInit .= "\n"; 177 177 while(($aAllTopItem = mysql_fetch_assoc($rAllTopItems)) !== false) { 178 $sTopTitle = _t($aAllTopItem['title']);179 $sComposerInit .= "180 aAllItems[" . ($aAllTopItem['id'] + 1000) . "] = '{$sTopTitle}';";178 $sTopTitle = _t($aAllTopItem['title']); 179 $sComposerInit .= " 180 aAllItems[" . ($aAllTopItem['id'] + 1000) . "] = '{$sTopTitle}';"; 181 181 } 182 182 183 183 $sComposerInit .= "\n"; 184 184 while(($aAllItem = mysql_fetch_assoc($rAllItems)) !== false) { 185 $sOrdTitle = _t($aAllItem['title']);186 $sComposerInit .= "187 aAllItems[{$aAllItem['id']}] = '{$sOrdTitle}';";185 $sOrdTitle = _t($aAllItem['title']); 186 $sComposerInit .= " 187 aAllItems[{$aAllItem['id']}] = '{$sOrdTitle}';"; 188 188 } 189 189 190 190 $sComposerInit .= " 191 </script>191 </script> 192 192 "; 193 193 … … 209 209 // Functions 210 210 function getMainPageCode() { 211 $sAdminUrl = BX_DOL_URL_ADMIN;212 $sAllItemsC = _t('_adm_mbuilder_All_Items');213 $sActiveItemsC = _t('_adm_mbuilder_Active_Items');214 215 return <<<EOF216 <div class="pseudo_wrapper">217 <div class="pseudo_head">{$sActiveItemsC}</div>218 <div id="pseudo1">219 <img src="{$sAdminUrl}images/loading.gif" />220 </div>221 <div class="pseudo_head">{$sAllItemsC}</div>222 <div id="pseudo2">223 <img src="{$sAdminUrl}images/loading.gif" />224 </div>225 </div>211 $sAdminUrl = BX_DOL_URL_ADMIN; 212 $sAllItemsC = _t('_adm_mbuilder_All_Items'); 213 $sActiveItemsC = _t('_adm_mbuilder_Active_Items'); 214 215 return <<<EOF 216 <div class="pseudo_wrapper"> 217 <div class="pseudo_head">{$sActiveItemsC}</div> 218 <div id="pseudo1"> 219 <img src="{$sAdminUrl}images/loading.gif" /> 220 </div> 221 <div class="pseudo_head">{$sAllItemsC}</div> 222 <div id="pseudo2"> 223 <img src="{$sAdminUrl}images/loading.gif" /> 224 </div> 225 </div> 226 226 EOF; 227 227 } … … 236 236 'enctype' => 'multipart/form-data', 237 237 ), 238 'inputs' => array ( 238 'inputs' => array ( 239 239 'Title' => array( 240 240 'type' => 'text', … … 251 251 'attrs' => array() 252 252 ), 253 'Check' => array(253 'Check' => array( 254 254 'type' => 'text', 255 255 'name' => 'check', … … 281 281 'onclick' => 'javascript:saveItem(' . $aItem['id'] . ');' 282 282 ) 283 ), 283 ), 284 284 array( 285 285 'type' => 'button', … … 290 290 ) 291 291 ) 292 ), 292 ), 293 293 ) 294 294 ); 295 295 296 296 $oForm = new BxTemplFormView($aForm); 297 return PopupBox('amc_edit_popup_custom', _t('_adm_mbuilder_edit_item'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . LoadingBox('formItemEditLoading'))));297 return PopupBox('amc_edit_popup_custom', _t('_adm_mbuilder_edit_item'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . LoadingBox('formItemEditLoading')))); 298 298 } 299 299 … … 307 307 'enctype' => 'multipart/form-data', 308 308 ), 309 'inputs' => array ( 309 'inputs' => array ( 310 310 'Title' => array( 311 311 'type' => 'text', … … 350 350 ) 351 351 ); 352 352 353 353 $oForm = new BxTemplFormView($aForm); 354 return PopupBox('amc_edit_popup_top', _t('_adm_mbuilder_edit_item'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . LoadingBox('formItemEditLoading'))));354 return PopupBox('amc_edit_popup_top', _t('_adm_mbuilder_edit_item'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . LoadingBox('formItemEditLoading')))); 355 355 } 356 356 357 357 function createNewElement( $type, $source ) { 358 if( $source ) {359 if( $type == 'top' and $source > 1000 ) {360 $source = $source - 1000;361 362 db_res( "363 INSERT INTO `sys_menu_admin`364 (`title`, `icon`, `icon_large`)365 SELECT366 `title`, `icon`, `icon_large`367 FROM `sys_menu_admin`368 WHERE `id` = '{$source}'369 " );370 $newID = db_last_id();371 } elseif( $type == 'custom' and $source < 1000 ) {372 $aItem = db_res( "SELECT * FROM `sys_menu_admin` WHERE `id` = '{$source}'" );373 374 if( $aItem['parent_id'] == 0 )375 $newID = $source;376 else {377 db_res( "378 INSERT INTO `sys_menu_admin`379 (`title`, `url`, `description`, `check`, `icon`)380 SELECT381 `title`, `url`, `description`, `check`, `icon`382 FROM `sys_menu_admin`383 WHERE `id` = '{$source}'384 " );385 $newID = db_last_id();386 }387 } elseif( $type == 'custom' and $source > 1000 ) {388 $source = $source - 1000;389 390 db_res( "391 INSERT INTO `sys_menu_admin`392 (`title`)393 SELECT394 `title`395 FROM `sys_menu_admin`396 WHERE `id` = '{$source}'397 " );398 $newID = db_last_id();399 } elseif( $type == 'top' and $source < 1000 ) {400 db_res( "401 INSERT INTO `sys_menu_admin`402 (`title`)403 SELECT404 `title`405 FROM `sys_menu_admin`406 WHERE `id` = '{$source}'407 " );408 $newID = db_last_id();409 }410 } else {411 db_res( "INSERT INTO `sys_menu_admin` SET `title` = 'NEW ITEM'" );412 $newID = db_last_id();413 }414 return $newID;358 if( $source ) { 359 if( $type == 'top' and $source > 1000 ) { 360 $source = $source - 1000; 361 362 db_res( " 363 INSERT INTO `sys_menu_admin` 364 (`title`, `icon`, `icon_large`) 365 SELECT 366 `title`, `icon`, `icon_large` 367 FROM `sys_menu_admin` 368 WHERE `id` = '{$source}' 369 " ); 370 $newID = db_last_id(); 371 } elseif( $type == 'custom' and $source < 1000 ) { 372 $aItem = db_res( "SELECT * FROM `sys_menu_admin` WHERE `id` = '{$source}'" ); 373 374 if( $aItem['parent_id'] == 0 ) 375 $newID = $source; 376 else { 377 db_res( " 378 INSERT INTO `sys_menu_admin` 379 (`title`, `url`, `description`, `check`, `icon`) 380 SELECT 381 `title`, `url`, `description`, `check`, `icon` 382 FROM `sys_menu_admin` 383 WHERE `id` = '{$source}' 384 " ); 385 $newID = db_last_id(); 386 } 387 } elseif( $type == 'custom' and $source > 1000 ) { 388 $source = $source - 1000; 389 390 db_res( " 391 INSERT INTO `sys_menu_admin` 392 (`title`) 393 SELECT 394 `title` 395 FROM `sys_menu_admin` 396 WHERE `id` = '{$source}' 397 " ); 398 $newID = db_last_id(); 399 } elseif( $type == 'top' and $source < 1000 ) { 400 db_res( " 401 INSERT INTO `sys_menu_admin` 402 (`title`) 403 SELECT 404 `title` 405 FROM `sys_menu_admin` 406 WHERE `id` = '{$source}' 407 " ); 408 $newID = db_last_id(); 409 } 410 } else { 411 db_res( "INSERT INTO `sys_menu_admin` SET `title` = 'NEW ITEM'" ); 412 $newID = db_last_id(); 413 } 414 return $newID; 415 415 } 416 416 417 417 function echoMenuEditMsg( $text, $color = 'black' ) { 418 return <<<EOF418 return <<<EOF 419 419 <div onclick="hideEditForm();" style="color:{$color};text-align:center;">{$text}</div> 420 420 EOF; … … 422 422 423 423 function saveItem( $id, $aItem ) { 424 $sSavedC = _t('_Saved');425 426 $aOldItem = db_arr( "SELECT * FROM `sys_menu_admin` WHERE `id`='{$id}'" );427 428 if( !$aOldItem )429 return array('code' => 2, 'message' => _t('_Error') . ' ' . _t('_adm_mbuilder_Item_not_found'));430 431 $sQuerySet = '';432 foreach( $aItem as $field => $value )433 $sQuerySet .= ", `{$field}`='" . process_db_input( $value ) ."'";434 435 $sQuerySet = substr( $sQuerySet, 1 );436 437 $sQuery = "UPDATE `sys_menu_admin` SET {$sQuerySet} WHERE `id` = '{$id}'";438 db_res( $sQuery );439 440 return array('code' => 0, 'message' => $sSavedC, 'timer' => 3);424 $sSavedC = _t('_Saved'); 425 426 $aOldItem = db_arr( "SELECT * FROM `sys_menu_admin` WHERE `id`='{$id}'" ); 427 428 if( !$aOldItem ) 429 return array('code' => 2, 'message' => _t('_Error') . ' ' . _t('_adm_mbuilder_Item_not_found')); 430 431 $sQuerySet = ''; 432 foreach( $aItem as $field => $value ) 433 $sQuerySet .= ", `{$field}`='" . process_db_input( $value ) ."'"; 434 435 $sQuerySet = substr( $sQuerySet, 1 ); 436 437 $sQuery = "UPDATE `sys_menu_admin` SET {$sQuerySet} WHERE `id` = '{$id}'"; 438 db_res( $sQuery ); 439 440 return array('code' => 0, 'message' => $sSavedC, 'timer' => 3); 441 441 } 442 442 443 443 function saveOrders( $sTop, $aCustom ) { 444 db_res( "UPDATE `sys_menu_admin` SET `order` = 0" );445 db_res( "UPDATE `sys_menu_admin` SET `order` = 0, `parent_id` = 0" );446 447 $sTop = trim( $sTop, ' ,' );448 $aTopIDs = explode( ',', $sTop );449 foreach( $aTopIDs as $iOrd => $iID ) {450 $iID = trim( $iID, ' ,' );451 $iID = (int)$iID;452 453 if( !$iID )454 continue;455 456 $iID = $iID - 1000;457 458 db_res( "UPDATE `sys_menu_admin` SET `order` = {$iOrd} WHERE `id` = '{$iID}'" );459 }460 461 foreach( $aCustom as $iParent => $sCustom ) {462 $iParent = (int)$iParent;463 $iParent = $iParent - 1000;464 465 $sCustom = trim( $sCustom, ' ,' );466 $aCustomIDs = explode( ',', $sCustom );467 468 foreach( $aCustomIDs as $iOrd => $iID ) {469 $iID = trim( $iID, ' ,' );470 $iID = (int)$iID;471 472 if( !$iID )473 continue;474 475 db_res( "UPDATE `sys_menu_admin` SET `order` = '{$iOrd}', `parent_id`='{$iParent}' WHERE `id` = '{$iID}'" );476 }477 }444 db_res( "UPDATE `sys_menu_admin` SET `order` = 0" ); 445 db_res( "UPDATE `sys_menu_admin` SET `order` = 0, `parent_id` = 0" ); 446 447 $sTop = trim( $sTop, ' ,' ); 448 $aTopIDs = explode( ',', $sTop ); 449 foreach( $aTopIDs as $iOrd => $iID ) { 450 $iID = trim( $iID, ' ,' ); 451 $iID = (int)$iID; 452 453 if( !$iID ) 454 continue; 455 456 $iID = $iID - 1000; 457 458 db_res( "UPDATE `sys_menu_admin` SET `order` = {$iOrd} WHERE `id` = '{$iID}'" ); 459 } 460 461 foreach( $aCustom as $iParent => $sCustom ) { 462 $iParent = (int)$iParent; 463 $iParent = $iParent - 1000; 464 465 $sCustom = trim( $sCustom, ' ,' ); 466 $aCustomIDs = explode( ',', $sCustom ); 467 468 foreach( $aCustomIDs as $iOrd => $iID ) { 469 $iID = trim( $iID, ' ,' ); 470 $iID = (int)$iID; 471 472 if( !$iID ) 473 continue; 474 475 db_res( "UPDATE `sys_menu_admin` SET `order` = '{$iOrd}', `parent_id`='{$iParent}' WHERE `id` = '{$iID}'" ); 476 } 477 } 478 478 } 479 479 -
trunk/administration/modules.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 67 67 'page_code_updates' => DesignBoxAdmin(_t('_adm_box_cpt_available_updates'), $oInstallerUi->getUpdates($sResultDeleteUpdate)), 68 68 'page_code_market_feed' => 'on' == getParam('feeds_enable') ? DesignBoxAdmin(_t('_adm_box_cpt_featured_modules'), ' 69 <div class="RSSAggrCont" rssid="boonex_unity_market_featured" rssnum="5" member="0">70 <div class="loading_rss">71 <img src="' . getTemplateImage('loading.gif') . '" alt="'._t('_loading ...').'" />72 </div>73 </div>') : '',69 <div class="RSSAggrCont" rssid="boonex_unity_market_featured" rssnum="5" member="0"> 70 <div class="loading_rss"> 71 <img src="' . getTemplateImage('loading.gif') . '" alt="'._t('_loading ...').'" /> 72 </div> 73 </div>') : '', 74 74 ); 75 75 -
trunk/administration/nav_menu_compose.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 43 43 44 44 $GLOBALS['oAdmTemplate']->addJsTranslation(array( 45 '_adm_mbuilder_Sorry_could_not_insert_object',46 '_adm_mbuilder_This_items_are_non_editable'45 '_adm_mbuilder_Sorry_could_not_insert_object', 46 '_adm_mbuilder_This_items_are_non_editable' 47 47 )); 48 48 … … 50 50 51 51 if(bx_get('action') !== false) { 52 switch(bx_get('action')) {53 case 'edit_form':54 $id = (int)bx_get('id');55 56 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_top` WHERE `ID` = '{$id}'", 0 );57 if( $aItem )58 echo showEditForm( $aItem );59 else60 echoMenuEditMsg( _t('_Error occured'), 'red' );61 exit;62 case 'create_item':63 $newID = createNewElement($_POST['type'], (int)$_POST['source']);64 echo $newID;65 exit;66 case 'deactivate_item':67 $res = db_res( "UPDATE `sys_menu_top` SET `Active`=0 WHERE `ID`=" . (int)bx_get('id'));68 echo db_affected_rows();69 $oMenu -> compile();70 exit;71 case 'save_item':72 $id = (int)$_POST['id'];73 if(!$id)74 $aResult = array('code' => 1, 'message' => _t('_Error occured'));75 else {76 $aItemFields = array('Name', 'Caption', 'Link', 'Picture', 'Icon');77 $aItem = array();78 foreach( $aItemFields as $field )79 $aItem[$field] = $_POST[$field];80 81 $aVis = array();82 if( (int)$_POST['Visible_non'] )83 $aVis[] = 'non';84 if( (int)$_POST['Visible_memb'] )85 $aVis[] = 'memb';86 87 $aItem['Visible'] = implode( ',', $aVis );88 $aItem['BQuickLink'] = (int)$_POST['BInQuickLink'] ? '1' : '0';89 $aItem['Target'] = $_POST['Target'] == '_blank' ? '_blank' : '';52 switch(bx_get('action')) { 53 case 'edit_form': 54 $id = (int)bx_get('id'); 55 56 $aItem = db_assoc_arr( "SELECT * FROM `sys_menu_top` WHERE `ID` = '{$id}'", 0 ); 57 if( $aItem ) 58 echo showEditForm( $aItem ); 59 else 60 echoMenuEditMsg( _t('_Error occured'), 'red' ); 61 exit; 62 case 'create_item': 63 $newID = createNewElement($_POST['type'], (int)$_POST['source']); 64 echo $newID; 65 exit; 66 case 'deactivate_item': 67 $res = db_res( "UPDATE `sys_menu_top` SET `Active`=0 WHERE `ID`=" . (int)bx_get('id')); 68 echo db_affected_rows(); 69 $oMenu -> compile(); 70 exit; 71 case 'save_item': 72 $id = (int)$_POST['id']; 73 if(!$id) 74 $aResult = array('code' => 1, 'message' => _t('_Error occured')); 75 else { 76 $aItemFields = array('Name', 'Caption', 'Link', 'Picture', 'Icon'); 77 $aItem = array(); 78 foreach( $aItemFields as $field ) 79 $aItem[$field] = $_POST[$field]; 80 81 $aVis = array(); 82 if( (int)$_POST['Visible_non'] ) 83 $aVis[] = 'non'; 84 if( (int)$_POST['Visible_memb'] ) 85 $aVis[] = 'memb'; 86 87 $aItem['Visible'] = implode( ',', $aVis ); 88 $aItem['BQuickLink'] = (int)$_POST['BInQuickLink'] ? '1' : '0'; 89 $aItem['Target'] = $_POST['Target'] == '_blank' ? '_blank' : ''; 90 90 91 91 $aResult = saveItem( $id, $aItem ); 92 }93 94 $aResult['message'] = MsgBox($aResult['message']);95 96 $oJson = new Services_JSON(); 92 } 93 94 $aResult['message'] = MsgBox($aResult['message']); 95 96 $oJson = new Services_JSON(); 97 97 echo $oJson->encode($aResult); 98 exit;99 case 'delete_item':100 $id = (int)$_POST['id'];101 if( !$id ) {102 echo _t('_adm_mbuilder_Item_ID_not_specified');103 exit;104 }105 106 $aItem = db_arr( "SELECT `Deletable` FROM `sys_menu_top` WHERE `ID` = '{$id}'" );107 if( !$aItem ) {108 echo _t('_adm_mbuilder_Item_not_found');109 exit;110 }111 112 if( !(int)$aItem['Deletable'] ) {113 echo _t('_adm_mbuilder_Item_is_non_deletable');114 exit;115 }116 117 db_res( "DELETE FROM `sys_menu_top` WHERE `ID` = $id" );118 if( db_affected_rows() )119 echo 'OK';120 else121 echo _t('_adm_mbuilder_Could_not_delete_the_item');122 $oMenu -> compile();123 exit;124 case 'save_orders':125 saveOrders(bx_get('top'), bx_get('custom'));126 echo 'OK';127 exit;128 }98 exit; 99 case 'delete_item': 100 $id = (int)$_POST['id']; 101 if( !$id ) { 102 echo _t('_adm_mbuilder_Item_ID_not_specified'); 103 exit; 104 } 105 106 $aItem = db_arr( "SELECT `Deletable` FROM `sys_menu_top` WHERE `ID` = '{$id}'" ); 107 if( !$aItem ) { 108 echo _t('_adm_mbuilder_Item_not_found'); 109 exit; 110 } 111 112 if( !(int)$aItem['Deletable'] ) { 113 echo _t('_adm_mbuilder_Item_is_non_deletable'); 114 exit; 115 } 116 117 db_res( "DELETE FROM `sys_menu_top` WHERE `ID` = $id" ); 118 if( db_affected_rows() ) 119 echo 'OK'; 120 else 121 echo _t('_adm_mbuilder_Could_not_delete_the_item'); 122 $oMenu -> compile(); 123 exit; 124 case 'save_orders': 125 saveOrders(bx_get('top'), bx_get('custom')); 126 echo 'OK'; 127 exit; 128 } 129 129 } 130 130 … … 141 141 142 142 $sComposerInit = " 143 <script type=\"text/javascript\">144 <!--145 topParentID = 'menu_app_wrapper';146 urlIconLoading = '{$sAdminUrl}images/loading.gif';147 parserUrl = '" . $GLOBALS['site']['url_admin'] . "nav_menu_compose.php?';148 149 allowNewItem = true;150 allowAddToTop = true;151 allowAddToCustom = true;152 iInactivePerRow = 7;153 sendSystemOrder = false;154 155 aCoords = {};156 aCoords['startX'] = 270;157 aCoords['startY'] = 235;158 aCoords['width'] = 92;159 aCoords['height'] = 21;160 aCoords['diffX'] = 122;161 aCoords['diffY'] = 32;162 163 aTopItems = {};164 aCustomItems = {};165 aSystemItems = {};166 aAllItems = {};143 <script type=\"text/javascript\"> 144 <!-- 145 topParentID = 'menu_app_wrapper'; 146 urlIconLoading = '{$sAdminUrl}images/loading.gif'; 147 parserUrl = '" . $GLOBALS['site']['url_admin'] . "nav_menu_compose.php?'; 148 149 allowNewItem = true; 150 allowAddToTop = true; 151 allowAddToCustom = true; 152 iInactivePerRow = 7; 153 sendSystemOrder = false; 154 155 aCoords = {}; 156 aCoords['startX'] = 270; 157 aCoords['startY'] = 235; 158 aCoords['width'] = 92; 159 aCoords['height'] = 21; 160 aCoords['diffX'] = 122; 161 aCoords['diffY'] = 32; 162 163 aTopItems = {}; 164 aCustomItems = {}; 165 aSystemItems = {}; 166 aAllItems = {}; 167 167 "; 168 168 169 169 $iIndex = 0; 170 170 while(($aTopItem = mysql_fetch_assoc($rTopItems)) !== false) { 171 $sComposerInit .= "172 173 aTopItems[$iIndex] = [{$aTopItem['ID']}, '" . addslashes( $aTopItem['Name'] ) . "', " . $aTopItem['Movable'] . "];174 aCustomItems[$iIndex] = {};";175 $sQuery = "SELECT `ID`, `Name`, `Movable` FROM `sys_menu_top` WHERE `Active`=1 AND `Type`='custom' AND `Parent`={$aTopItem['ID']} ORDER BY `Order`";176 177 $iSubIndex = 0;178 $rCustomItems = db_res( $sQuery );179 while(($aCustomItem = mysql_fetch_assoc($rCustomItems)) !== false) {180 $sComposerInit .= "181 aCustomItems[$iIndex][" . ($iSubIndex++) . "] = [{$aCustomItem['ID']}, '" . addslashes( $aCustomItem['Name'] ) . "', " . $aCustomItem['Movable'] . "];";182 }183 184 $iIndex++;171 $sComposerInit .= " 172 173 aTopItems[$iIndex] = [{$aTopItem['ID']}, '" . addslashes( $aTopItem['Name'] ) . "', " . $aTopItem['Movable'] . "]; 174 aCustomItems[$iIndex] = {};"; 175 $sQuery = "SELECT `ID`, `Name`, `Movable` FROM `sys_menu_top` WHERE `Active`=1 AND `Type`='custom' AND `Parent`={$aTopItem['ID']} ORDER BY `Order`"; 176 177 $iSubIndex = 0; 178 $rCustomItems = db_res( $sQuery ); 179 while(($aCustomItem = mysql_fetch_assoc($rCustomItems)) !== false) { 180 $sComposerInit .= " 181 aCustomItems[$iIndex][" . ($iSubIndex++) . "] = [{$aCustomItem['ID']}, '" . addslashes( $aCustomItem['Name'] ) . "', " . $aCustomItem['Movable'] . "];"; 182 } 183 184 $iIndex++; 185 185 } 186 186 187 187 while(($aSystemItem = mysql_fetch_assoc($rSysItems)) !== false) { 188 $sComposerInit .= "189 190 aSystemItems[$iIndex] = [{$aSystemItem['ID']}, '" . addslashes( $aSystemItem['Name'] ) . "', " . $aSystemItem['Movable'] . "];191 aCustomItems[$iIndex] = {};";192 $sQuery = "SELECT `ID`, `Name`, `Movable` FROM `sys_menu_top` WHERE `Active`=1 AND `Type`='custom' AND `Parent`={$aSystemItem['ID']} ORDER BY `Order`";193 194 $iSubIndex = 0;195 $rCustomItems = db_res( $sQuery );196 while(($aCustomItem = mysql_fetch_assoc($rCustomItems)) !== false) {197 $sComposerInit .= "198 aCustomItems[$iIndex][" . ($iSubIndex++) . "] = [{$aCustomItem['ID']}, '" . addslashes( $aCustomItem['Name'] ) . "', " . $aCustomItem['Movable'] . "];";199 }200 201 $iIndex++;188 $sComposerInit .= " 189 190 aSystemItems[$iIndex] = [{$aSystemItem['ID']}, '" . addslashes( $aSystemItem['Name'] ) . "', " . $aSystemItem['Movable'] . "]; 191 aCustomItems[$iIndex] = {};"; 192 $sQuery = "SELECT `ID`, `Name`, `Movable` FROM `sys_menu_top` WHERE `Active`=1 AND `Type`='custom' AND `Parent`={$aSystemItem['ID']} ORDER BY `Order`"; 193 194 $iSubIndex = 0; 195 $rCustomItems = db_res( $sQuery ); 196 while(($aCustomItem = mysql_fetch_assoc($rCustomItems)) !== false) { 197 $sComposerInit .= " 198 aCustomItems[$iIndex][" . ($iSubIndex++) . "] = [{$aCustomItem['ID']}, '" . addslashes( $aCustomItem['Name'] ) . "', " . $aCustomItem['Movable'] . "];"; 199 } 200 201 $iIndex++; 202 202 } 203 203 204 204 $sComposerInit .= "\n"; 205 205 while(($aAllItem = mysql_fetch_assoc($rAllItems)) !== false) { 206 $sComposerInit .= "207 aAllItems[{$aAllItem['ID']}] = '" . addslashes( $aAllItem['Name'] ) . "';";206 $sComposerInit .= " 207 aAllItems[{$aAllItem['ID']}] = '" . addslashes( $aAllItem['Name'] ) . "';"; 208 208 } 209 209 $sComposerInit .= " 210 -->211 </script>";210 --> 211 </script>"; 212 212 213 213 $iNameIndex = 12; … … 237 237 'enctype' => 'multipart/form-data', 238 238 ), 239 'inputs' => array ( 239 'inputs' => array ( 240 240 'Name' => array( 241 241 'type' => 'text', … … 265 265 'value' => $aItem['Link'], 266 266 'attrs' => array() 267 ), 267 ), 268 268 'Picture' => array( 269 269 'type' => 'text', … … 319 319 'onclick' => 'javascript:saveItem(' . $aItem['ID'] . ');' 320 320 ) 321 ), 321 ), 322 322 array( 323 323 'type' => 'button', … … 328 328 ) 329 329 ) 330 ), 330 ), 331 331 ) 332 332 ); 333 333 334 334 foreach($aForm['inputs'] as $sKey => $aInput) 335 335 if(in_array($aInput['type'], array('text', 'checkbox')) && !$aItem['Editable']) … … 342 342 343 343 $oForm = new BxTemplFormView($aForm); 344 return PopupBox('tmc_edit_popup', _t('_adm_mbuilder_edit_item'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . LoadingBox('formItemEditLoading'))));344 return PopupBox('tmc_edit_popup', _t('_adm_mbuilder_edit_item'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode() . LoadingBox('formItemEditLoading')))); 345 345 } 346 346 347 347 function createNewElement( $type, $source ) { 348 global $oMenu;349 350 if( $source ) {351 $sourceActive = db_value( "SELECT `Active` FROM `sys_menu_top` WHERE `ID`='{$source}'" );352 if( !$sourceActive ) {353 //convert to active354 db_res( "UPDATE `sys_menu_top` SET `Active`=1, `Type`='{$type}' WHERE `ID`='{$source}'" );355 $newID = $source;356 } else {357 //create from source358 db_res( "INSERT INTO `sys_menu_top`359 ( `Name`, `Caption`, `Link`, `Visible`, `Target`, `Onclick`, `Check`, `Type` )360 SELECT361 `Name`, `Caption`, `Link`, `Visible`, `Target`, `Onclick`, `Check`, '{$type}'362 FROM `sys_menu_top`363 WHERE `ID`='{$source}'" );364 $newID = db_last_id();365 }366 } else {367 //create new368 db_res( "INSERT INTO `sys_menu_top` ( `Name`, `Type` ) VALUES ( 'NEW ITEM', '{$type}' )" );369 $newID = db_last_id();370 }371 372 $oMenu -> compile();373 return $newID;348 global $oMenu; 349 350 if( $source ) { 351 $sourceActive = db_value( "SELECT `Active` FROM `sys_menu_top` WHERE `ID`='{$source}'" ); 352 if( !$sourceActive ) { 353 //convert to active 354 db_res( "UPDATE `sys_menu_top` SET `Active`=1, `Type`='{$type}' WHERE `ID`='{$source}'" ); 355 $newID = $source; 356 } else { 357 //create from source 358 db_res( "INSERT INTO `sys_menu_top` 359 ( `Name`, `Caption`, `Link`, `Visible`, `Target`, `Onclick`, `Check`, `Type` ) 360 SELECT 361 `Name`, `Caption`, `Link`, `Visible`, `Target`, `Onclick`, `Check`, '{$type}' 362 FROM `sys_menu_top` 363 WHERE `ID`='{$source}'" ); 364 $newID = db_last_id(); 365 } 366 } else { 367 //create new 368 db_res( "INSERT INTO `sys_menu_top` ( `Name`, `Type` ) VALUES ( 'NEW ITEM', '{$type}' )" ); 369 $newID = db_last_id(); 370 } 371 372 $oMenu -> compile(); 373 return $newID; 374 374 } 375 375 376 376 function echoMenuEditMsg( $text, $color = 'black' ) { 377 echo <<<EOF377 echo <<<EOF 378 378 <div onclick="hideEditForm();" style="color:{$color};text-align:center;">{$text}</div> 379 379 <script type="text/javascript">setTimeout( 'hideEditForm();', 1000 )</script> … … 382 382 383 383 function saveItem( $id, $aItem ) { 384 global $oMenu;385 386 $sSavedC = _t('_Saved');387 $sItemNotFoundC = _t('_adm_mbuilder_Item_not_found');388 $sItemNonEditableC = _t('_adm_mbuilder_Item_is_non_editable');389 390 $aOldItem = db_arr( "SELECT * FROM `sys_menu_top` WHERE `ID`='{$id}'" );391 392 if(!$aOldItem)393 return array('code' => 2, 'message' => $sItemNotFoundC);394 395 if((int)$aOldItem['Editable'] != 1)396 return array('code' => 3, 'message' => $sItemNonEditableC);397 398 $sQuerySet = '';399 foreach( $aItem as $field => $value )400 $sQuerySet .= ", `{$field}`='" . process_db_input( $value ) ."'";401 402 $sQuerySet = substr( $sQuerySet, 1 );403 404 $sQuery = "UPDATE `sys_menu_top` SET {$sQuerySet} WHERE `ID` = '{$id}'";405 406 db_res( $sQuery );407 $oMenu -> compile();408 409 return array('code' => 0, 'message' => $sSavedC, 'timer' => 3);384 global $oMenu; 385 386 $sSavedC = _t('_Saved'); 387 $sItemNotFoundC = _t('_adm_mbuilder_Item_not_found'); 388 $sItemNonEditableC = _t('_adm_mbuilder_Item_is_non_editable'); 389 390 $aOldItem = db_arr( "SELECT * FROM `sys_menu_top` WHERE `ID`='{$id}'" ); 391 392 if(!$aOldItem) 393 return array('code' => 2, 'message' => $sItemNotFoundC); 394 395 if((int)$aOldItem['Editable'] != 1) 396 return array('code' => 3, 'message' => $sItemNonEditableC); 397 398 $sQuerySet = ''; 399 foreach( $aItem as $field => $value ) 400 $sQuerySet .= ", `{$field}`='" . process_db_input( $value ) ."'"; 401 402 $sQuerySet = substr( $sQuerySet, 1 ); 403 404 $sQuery = "UPDATE `sys_menu_top` SET {$sQuerySet} WHERE `ID` = '{$id}'"; 405 406 db_res( $sQuery ); 407 $oMenu -> compile(); 408 409 return array('code' => 0, 'message' => $sSavedC, 'timer' => 3); 410 410 } 411 411 412 412 function updateLangFile( $key, $string ) { 413 $langName = getParam( 'lang_default' );414 $langID = db_value( "SELECT `ID` FROM `sys_localization_languages` WHERE `Name` = '" . addslashes( $langName ) . "'" );415 416 $keyID = db_value( "SELECT `ID` FROM `sys_localization_keys` WHERE `Key` = '" . process_db_input( $key ) . "'" );417 if( $keyID ) {418 db_res( "UPDATE `sys_localization_strings` SET `String` = '" .process_db_input( $string ) . "' WHERE `IDKey`='{$keyID}' AND `IDLanguage`='{$langID}'" );419 } else {420 db_res( "INSERT INTO `sys_localization_keys` SET `IDCategory` = 2, `Key` = '" . process_db_input( $key ) . "'" );421 db_res( "INSERT INTO `sys_localization_strings` SET `IDKey` = " . db_last_id() . ", `IDLanguage` = '{$langID}', `String` = '" .process_db_input( $string ) . "'" );422 }423 424 compileLanguage($langID);413 $langName = getParam( 'lang_default' ); 414 $langID = db_value( "SELECT `ID` FROM `sys_localization_languages` WHERE `Name` = '" . addslashes( $langName ) . "'" ); 415 416 $keyID = db_value( "SELECT `ID` FROM `sys_localization_keys` WHERE `Key` = '" . process_db_input( $key ) . "'" ); 417 if( $keyID ) { 418 db_res( "UPDATE `sys_localization_strings` SET `String` = '" .process_db_input( $string ) . "' WHERE `IDKey`='{$keyID}' AND `IDLanguage`='{$langID}'" ); 419 } else { 420 db_res( "INSERT INTO `sys_localization_keys` SET `IDCategory` = 2, `Key` = '" . process_db_input( $key ) . "'" ); 421 db_res( "INSERT INTO `sys_localization_strings` SET `IDKey` = " . db_last_id() . ", `IDLanguage` = '{$langID}', `String` = '" .process_db_input( $string ) . "'" ); 422 } 423 424 compileLanguage($langID); 425 425 } 426 426 427 427 function saveOrders( $sTop, $aCustom ) { 428 global $oMenu;429 430 db_res( "UPDATE `sys_menu_top` SET `Order` = 0, `Parent` = 0" );431 432 $sTop = trim( $sTop, ' ,' );433 $aTopIDs = explode( ',', $sTop );434 foreach( $aTopIDs as $iOrd => $iID ) {435 $iID = trim( $iID, ' ,' );436 $iID = (int)$iID;437 438 if( !$iID )439 continue;440 441 db_res( "UPDATE `sys_menu_top` SET `Order` = '{$iOrd}', `Type` = 'top' WHERE `ID` = '{$iID}'" );442 }443 444 foreach( $aCustom as $iParent => $sCustom ) {445 $iParent = (int)$iParent;446 $sCustom = trim( $sCustom, ' ,' );447 $aCustomIDs = explode( ',', $sCustom );448 foreach( $aCustomIDs as $iOrd => $iID ) {449 $iID = trim( $iID, ' ,' );450 $iID = (int)$iID;451 452 if( !$iID )453 continue;454 455 db_res( "UPDATE `sys_menu_top` SET `Order` = '{$iOrd}', `Type` = 'custom', `Parent`='{$iParent}' WHERE `ID` = '{$iID}'" );456 }457 }458 $oMenu -> compile();428 global $oMenu; 429 430 db_res( "UPDATE `sys_menu_top` SET `Order` = 0, `Parent` = 0" ); 431 432 $sTop = trim( $sTop, ' ,' ); 433 $aTopIDs = explode( ',', $sTop ); 434 foreach( $aTopIDs as $iOrd => $iID ) { 435 $iID = trim( $iID, ' ,' ); 436 $iID = (int)$iID; 437 438 if( !$iID ) 439 continue; 440 441 db_res( "UPDATE `sys_menu_top` SET `Order` = '{$iOrd}', `Type` = 'top' WHERE `ID` = '{$iID}'" ); 442 } 443 444 foreach( $aCustom as $iParent => $sCustom ) { 445 $iParent = (int)$iParent; 446 $sCustom = trim( $sCustom, ' ,' ); 447 $aCustomIDs = explode( ',', $sCustom ); 448 foreach( $aCustomIDs as $iOrd => $iID ) { 449 $iID = trim( $iID, ' ,' ); 450 $iID = (int)$iID; 451 452 if( !$iID ) 453 continue; 454 455 db_res( "UPDATE `sys_menu_top` SET `Order` = '{$iOrd}', `Type` = 'custom', `Parent`='{$iParent}' WHERE `ID` = '{$iID}'" ); 456 } 457 } 458 $oMenu -> compile(); 459 459 } 460 460 -
trunk/administration/notifies.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 38 38 $logged['admin'] = member_auth(1, true, true); 39 39 40 if($_POST['queue_message'] && $_POST['msgs_id']) 41 $sActionResult = QueueMessage(); 40 if($_POST['queue_message'] && $_POST['msgs_id']) 41 $sActionResult = QueueMessage(); 42 42 if ($_POST['add_message']) 43 $action = 'add';43 $action = 'add'; 44 44 if($_POST['delete_message'] && $_POST['msgs_id']) 45 45 $sActionResult = DeleteMessage() ? _t('_adm_mmail_Message_was_deleted') : _t('_adm_mmail_Message_was_not_deleted'); 46 46 if($_POST['preview_message'] && $_POST['msgs_id']) 47 $action = 'preview';47 $action = 'preview'; 48 48 if(bx_get('action') == 'empty' ) 49 49 $sActionResult = EmptyQueue() ? _t('_adm_mmail_Queue_empty') : _t('_adm_mmail_Queue_emptying_failed'); … … 56 56 ); 57 57 58 $_page_cont[$iNameIndex] = array( 58 $_page_cont[$iNameIndex] = array( 59 59 'page_code_status' => PrintStatus($sActionResult), 60 60 'page_code_new_message' => getEmailMessage($action), … … 67 67 68 68 function PrintStatus($sActionResult) { 69 $sSubjC = _t('_Subject');70 $sEmailsC = _t('_adm_mmail_emails');71 $sEmptyQueueC = _t('_adm_mmail_Empty_Queue');72 $sCupidStatusC = _t('_adm_mmail_Cupid_mails_status');73 74 $sSingleEmailsTRs = '';75 76 // Select count of emails in queue per one message 77 $iCount = (int)$GLOBALS['MySQL']->getOne("SELECT COUNT(`id`) AS `count` FROM `sys_sbs_queue`");78 if ($iCount <= 0)79 $sSingleEmailsTRs .= "<tr><td align=center><b><font color=red>" . _t('_adm_mmail_no_emails_in_queue') . "</font></b></td></tr>";80 else81 $sSingleEmailsTRs .= "<tr><td align=center>" . _t('_adm_mmail_mails_in_queue', $iCount) . "</td></tr>"; 82 83 $sEmptyQueueTable = '';84 // If queue is not empty then show link to clear it85 if($iCount > 0) {86 $sEmptyQueueTable = "<hr>87 <table class=\"text\" width=\"50%\" style=\"height: 30px;\">88 <tr class=\"table\">89 <td align=\"center\" colspan=\"3\">90 <a href=\"" . BX_DOL_URL_ADMIN . "notifies.php?action=empty\">{$sEmptyQueueC}</a>91 </td>92 </tr>93 </table>94 <hr>";95 }69 $sSubjC = _t('_Subject'); 70 $sEmailsC = _t('_adm_mmail_emails'); 71 $sEmptyQueueC = _t('_adm_mmail_Empty_Queue'); 72 $sCupidStatusC = _t('_adm_mmail_Cupid_mails_status'); 73 74 $sSingleEmailsTRs = ''; 75 76 // Select count of emails in queue per one message 77 $iCount = (int)$GLOBALS['MySQL']->getOne("SELECT COUNT(`id`) AS `count` FROM `sys_sbs_queue`"); 78 if ($iCount <= 0) 79 $sSingleEmailsTRs .= "<tr><td align=center><b><font color=red>" . _t('_adm_mmail_no_emails_in_queue') . "</font></b></td></tr>"; 80 else 81 $sSingleEmailsTRs .= "<tr><td align=center>" . _t('_adm_mmail_mails_in_queue', $iCount) . "</td></tr>"; 82 83 $sEmptyQueueTable = ''; 84 // If queue is not empty then show link to clear it 85 if($iCount > 0) { 86 $sEmptyQueueTable = "<hr> 87 <table class=\"text\" width=\"50%\" style=\"height: 30px;\"> 88 <tr class=\"table\"> 89 <td align=\"center\" colspan=\"3\"> 90 <a href=\"" . BX_DOL_URL_ADMIN . "notifies.php?action=empty\">{$sEmptyQueueC}</a> 91 </td> 92 </tr> 93 </table> 94 <hr>"; 95 } 96 96 97 97 ob_start(); … … 99 99 <div style="margin:9px;"> 100 100 <center> 101 <table cellspacing=2 cellpadding=2 class=text border=0>102 <tr class=header align="center"><td><?=_t('_adm_mmail_Queue_status');?>:</td></tr>103 <?=$sSingleEmailsTRs;?>104 </table>105 <?=$sEmptyQueueTable;?>101 <table cellspacing=2 cellpadding=2 class=text border=0> 102 <tr class=header align="center"><td><?=_t('_adm_mmail_Queue_status');?>:</td></tr> 103 <?=$sSingleEmailsTRs;?> 104 </table> 105 <?=$sEmptyQueueTable;?> 106 106 </center> 107 107 </div> … … 109 109 $sResult = ob_get_clean(); 110 110 111 if(!empty($sActionResult))112 $sResult = MsgBox($sActionResult, 3) . $sResult;113 114 return DesignBoxContent(_t('_Status'), $sResult, 1);111 if(!empty($sActionResult)) 112 $sResult = MsgBox($sActionResult, 3) . $sResult; 113 114 return DesignBoxContent(_t('_Status'), $sResult, 1); 115 115 } 116 116 117 117 function getAllMessagesBox() { 118 $aMessages = $GLOBALS['MySQL']->getAll("SELECT `id`, `subject`, (`id`=". (int)$_POST['msgs_id'] ." OR `subject`='". process_db_input($_POST['Subj']) ."' ) AS `selected` FROM `sys_sbs_messages`");119 120 $sAllMessagesOptions = '';121 foreach($aMessages as $aMessage)122 $sAllMessagesOptions .= "<option value=\"" . $aMessage['id'] . "\" " . ($aMessage['selected'] ? "selected=\"selected\"" : "") . ">" . $aMessage['subject'] . "</option>";123 118 $aMessages = $GLOBALS['MySQL']->getAll("SELECT `id`, `subject`, (`id`=". (int)$_POST['msgs_id'] ." OR `subject`='". process_db_input($_POST['Subj']) ."' ) AS `selected` FROM `sys_sbs_messages`"); 119 120 $sAllMessagesOptions = ''; 121 foreach($aMessages as $aMessage) 122 $sAllMessagesOptions .= "<option value=\"" . $aMessage['id'] . "\" " . ($aMessage['selected'] ? "selected=\"selected\"" : "") . ">" . $aMessage['subject'] . "</option>"; 123 124 124 ob_start(); 125 125 ?> 126 126 <form name="form_messages" method="POST" action="<?=$GLOBALS['site']['url_admin'] . 'notifies.php';?>"> 127 <input type="hidden" name="action" value="view">128 <center class="text"><?= _t('_Messages'); ?>: 129 <select name=msgs_id onChange="javascript: document.forms['form_messages'].submit();">130 <option value=0><?=_t('_None');?></option>131 <?=$sAllMessagesOptions;?>132 </select>133 </center>127 <input type="hidden" name="action" value="view"> 128 <center class="text"><?= _t('_Messages'); ?>: 129 <select name=msgs_id onChange="javascript: document.forms['form_messages'].submit();"> 130 <option value=0><?=_t('_None');?></option> 131 <?=$sAllMessagesOptions;?> 132 </select> 133 </center> 134 134 </form> 135 135 <? 136 136 $sResult = ob_get_clean(); 137 137 138 return DesignBoxContent(_t('_adm_mmail_All_Messages'), '<div style="margin:9px;">' . $sResult . '</div>', 1);138 return DesignBoxContent(_t('_adm_mmail_All_Messages'), '<div style="margin:9px;">' . $sResult . '</div>', 1); 139 139 } 140 140 141 141 function getEmailMessage($sAction) { 142 $sErrorC = _t('_Error Occured');143 $sApplyChangesC = _t('_Submit');144 $sSubjectC = _t('_Subject');145 $sBodyC = _t('_adm_mmail_Body');146 $sTextBodyC = _t('_adm_mmail_Text_email_body');147 $sPreviewMessageC = _t('_Preview');148 $sDeleteC = _t('_Delete');149 150 $sMessageID = (int)$_POST['msgs_id'];151 152 $sSubject = $sBody = "";153 if($_POST['body'] && $_POST['action'] != 'delete' ) {154 $sSubject = process_pass_data( $_POST['subject'] );155 $sBody = process_pass_data( $_POST['body'] ); 156 } elseif ( $sMessageID )157 list($sSubject, $sBody) = $GLOBALS['MySQL']->getRow("SELECT `subject`, `body` FROM `sys_sbs_messages` WHERE `id`='". $sMessageID . "' LIMIT 1", MYSQL_NUM);158 159 $sSubject = htmlspecialchars($sSubject); 160 161 $aForm = array(162 'form_attrs' => array(163 'name' => 'sys_sbs_messages',164 'action' => $GLOBALS['site']['url_admin'] . 'notifies.php',165 'method' => 'post',166 ),167 'params' => array (168 'db' => array(169 'table' => 'sys_sbs_messages',170 'key' => 'ID',171 'submit_name' => 'add_message',172 ),173 ),174 'inputs' => array(175 'subject' => array(176 'type' => 'text',177 'name' => 'subject',178 'value' => $sSubject,179 'caption' => $sSubjectC,180 'required' => true,181 'checker' => array (182 'func' => 'length',183 'params' => array(2,128),184 'error' => $sErrorC,185 ),186 'db' => array (187 'pass' => 'Xss',188 ),189 ),190 'body' => array(191 'type' => 'textarea',192 'name' => 'body',193 'value' => $sBody,194 'caption' => $sBodyC,195 'required' => true,196 'html' => 1,197 'checker' => array (198 'func' => 'length',199 'params' => array(10,32000),200 'error' => $sErrorC,201 ), 202 'db' => array (203 'pass' => 'XssHtml', 204 ), 205 ),206 'msgs_id' => array(207 'type' => 'hidden',208 'name' => 'msgs_id',209 'value' => $sMessageID,210 ),211 'control' => array (142 $sErrorC = _t('_Error Occured'); 143 $sApplyChangesC = _t('_Submit'); 144 $sSubjectC = _t('_Subject'); 145 $sBodyC = _t('_adm_mmail_Body'); 146 $sTextBodyC = _t('_adm_mmail_Text_email_body'); 147 $sPreviewMessageC = _t('_Preview'); 148 $sDeleteC = _t('_Delete'); 149 150 $sMessageID = (int)$_POST['msgs_id']; 151 152 $sSubject = $sBody = ""; 153 if($_POST['body'] && $_POST['action'] != 'delete' ) { 154 $sSubject = process_pass_data( $_POST['subject'] ); 155 $sBody = process_pass_data( $_POST['body'] ); 156 } elseif ( $sMessageID ) 157 list($sSubject, $sBody) = $GLOBALS['MySQL']->getRow("SELECT `subject`, `body` FROM `sys_sbs_messages` WHERE `id`='". $sMessageID . "' LIMIT 1", MYSQL_NUM); 158 159 $sSubject = htmlspecialchars($sSubject); 160 161 $aForm = array( 162 'form_attrs' => array( 163 'name' => 'sys_sbs_messages', 164 'action' => $GLOBALS['site']['url_admin'] . 'notifies.php', 165 'method' => 'post', 166 ), 167 'params' => array ( 168 'db' => array( 169 'table' => 'sys_sbs_messages', 170 'key' => 'ID', 171 'submit_name' => 'add_message', 172 ), 173 ), 174 'inputs' => array( 175 'subject' => array( 176 'type' => 'text', 177 'name' => 'subject', 178 'value' => $sSubject, 179 'caption' => $sSubjectC, 180 'required' => true, 181 'checker' => array ( 182 'func' => 'length', 183 'params' => array(2,128), 184 'error' => $sErrorC, 185 ), 186 'db' => array ( 187 'pass' => 'Xss', 188 ), 189 ), 190 'body' => array( 191 'type' => 'textarea', 192 'name' => 'body', 193 'value' => $sBody, 194 'caption' => $sBodyC, 195 'required' => true, 196 'html' => 1, 197 'checker' => array ( 198 'func' => 'length', 199 'params' => array(10,32000), 200 'error' => $sErrorC, 201 ), 202 'db' => array ( 203 'pass' => 'XssHtml', 204 ), 205 ), 206 'msgs_id' => array( 207 'type' => 'hidden', 208 'name' => 'msgs_id', 209 'value' => $sMessageID, 210 ), 211 'control' => array ( 212 212 'type' => 'input_set', 213 213 array( 214 'type' => 'submit',215 'name' => 'add_message',216 'caption' => $sApplyChangesC,217 'value' => $sApplyChangesC,218 ),219 array(220 'type' => 'submit',221 'name' => 'preview_message',222 'caption' => $sPreviewMessageC,223 'value' => $sPreviewMessageC,224 ),225 )226 ),227 );228 if($sMessageID) {229 $aForm['inputs']['control'][] = array (230 'type' => 'submit',231 'name' => 'delete_message',232 'caption' => $sDeleteC,233 'value' => $sDeleteC,234 );235 }236 237 $sResult = '';238 $oForm = new BxTemplFormView($aForm);239 $oForm->initChecker();240 if ($oForm->isSubmittedAndValid()) {241 if ($sAction == 'add') {242 if ($sMessageID > 0) {243 $oForm->update($sMessageID);244 } else {245 $sMessageID = $oForm->insert();246 }247 }248 249 $sResult = $sMessageID > 0 ? MsgBox(_t('_Success'), 3) : MsgBox($sErrorC);250 }251 252 return DesignBoxContent(_t('_adm_mmail_Email_message'), '<div style="margin:9px;">' . $sResult . $oForm->getCode() . '</div>', 1);214 'type' => 'submit', 215 'name' => 'add_message', 216 'caption' => $sApplyChangesC, 217 'value' => $sApplyChangesC, 218 ), 219 array( 220 'type' => 'submit', 221 'name' => 'preview_message', 222 'caption' => $sPreviewMessageC, 223 'value' => $sPreviewMessageC, 224 ), 225 ) 226 ), 227 ); 228 if($sMessageID) { 229 $aForm['inputs']['control'][] = array ( 230 'type' => 'submit', 231 'name' => 'delete_message', 232 'caption' => $sDeleteC, 233 'value' => $sDeleteC, 234 ); 235 } 236 237 $sResult = ''; 238 $oForm = new BxTemplFormView($aForm); 239 $oForm->initChecker(); 240 if ($oForm->isSubmittedAndValid()) { 241 if ($sAction == 'add') { 242 if ($sMessageID > 0) { 243 $oForm->update($sMessageID); 244 } else { 245 $sMessageID = $oForm->insert(); 246 } 247 } 248 249 $sResult = $sMessageID > 0 ? MsgBox(_t('_Success'), 3) : MsgBox($sErrorC); 250 } 251 252 return DesignBoxContent(_t('_adm_mmail_Email_message'), '<div style="margin:9px;">' . $sResult . $oForm->getCode() . '</div>', 1); 253 253 } 254 254 255 255 function getQueueMessage() { 256 global $aPreValues;257 258 if ( $_POST['msgs_id'] ) {259 $aSexValues = getFieldValues('Sex');260 foreach($aSexValues as $sKey => $sValue)261 $aSexValues[$sKey] = _t($sValue);262 263 $aStartAgesOptions = array();264 $aEndAgesOptions = array();265 $gl_search_start_age = (int)getParam('search_start_age');266 $gl_search_end_age = (int)getParam('search_end_age');267 for ( $i = $gl_search_start_age ; $i <= $gl_search_end_age ; $i++ ) {268 $aStartAgesOptions[$i] = $i;269 }270 for ( $i = $gl_search_start_age ; $i <= $gl_search_end_age ; $i++ ) {271 $aEndAgesOptions[$i] = $i;272 }273 274 $aCountryOptions = array('all' => _t('_All'));275 foreach ( $aPreValues['Country'] as $key => $value ) {276 $aCountryOptions[$key] = _t($value['LKey']);277 }278 279 $aMembershipOptions = array('all' => _t('_All'));280 $memberships_arr = getMemberships();281 foreach ( $memberships_arr as $membershipID => $membershipName ) {282 if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) continue;283 $aMembershipOptions[$membershipID] = $membershipName;284 }285 286 $iRecipientMembers = (int)$GLOBALS['MySQL']->getOne("SELECT COUNT(`ID`) AS `count` FROM `Profiles` WHERE `Status`<>'Unconfirmed' AND `EmailNotify` = 1 LIMIT 1");287 $aForm = array(288 'form_attrs' => array(289 'name' => 'form_queue',290 'class' => 'form_queue_form',291 'action' => $GLOBALS['site']['url_admin'] . 'notifies.php',292 'method' => 'post',293 ),294 'inputs' => array (295 'Send1' => array(296 'type' => 'checkbox',297 'name' => 'send_to_subscribers',298 'label' => _t('_adm_mmail_Send_to_subscribers'),299 'value' => 'non',300 'checked' => true301 ),302 'Send2' => array(303 'type' => 'checkbox',304 'name' => 'send_to_members',305 'label' => _t('_adm_mmail_Send_to_members'),306 'value' => 'memb',307 'checked' => true,308 'attrs' => array(309 'onClick' => 'setControlsState();',310 ),311 'info' => _t('_adm_mmail_Send_to_members_info', $iRecipientMembers),312 ),313 'sex' => array (314 'type' => 'checkbox_set',315 'name' => 'sex',316 'values' => $aSexValues,317 'value' => array_keys($aSexValues)318 ),319 'StartAge' => array (320 'type' => 'select',321 'name' => 'age_start',322 'caption' => _t('_adm_mmail_Age') . ' ' . _t('_from'),323 'values' => $aStartAgesOptions,324 'value' => $gl_search_start_age,325 ),326 'EndAge' => array (327 'type' => 'select',328 'name' => 'age_end',329 'caption' => _t('_to'),330 'values' => $aEndAgesOptions,331 'value' => $gl_search_end_age,332 ),333 'Country' => array (334 'type' => 'select',335 'name' => 'country',336 'caption' => _t('_Country'),337 'values' => $aCountryOptions,338 'value' => 'all',339 ),340 'Membership' => array (341 'type' => 'select',342 'name' => 'membership',343 'caption' => _t('_adm_mmi_membership_levels'),344 'values' => $aMembershipOptions,345 'value' => 'all',346 ),347 'msgs_id' => array (348 'type' => 'hidden',349 'name' => 'msgs_id',350 'value' => (int)$_POST['msgs_id'],351 ),352 'submit' => array (353 'type' => 'submit',354 'name' => 'queue_message',355 'value' => _t('_Submit'),356 )357 )358 );359 360 $oForm = new BxTemplFormView($aForm);256 global $aPreValues; 257 258 if ( $_POST['msgs_id'] ) { 259 $aSexValues = getFieldValues('Sex'); 260 foreach($aSexValues as $sKey => $sValue) 261 $aSexValues[$sKey] = _t($sValue); 262 263 $aStartAgesOptions = array(); 264 $aEndAgesOptions = array(); 265 $gl_search_start_age = (int)getParam('search_start_age'); 266 $gl_search_end_age = (int)getParam('search_end_age'); 267 for ( $i = $gl_search_start_age ; $i <= $gl_search_end_age ; $i++ ) { 268 $aStartAgesOptions[$i] = $i; 269 } 270 for ( $i = $gl_search_start_age ; $i <= $gl_search_end_age ; $i++ ) { 271 $aEndAgesOptions[$i] = $i; 272 } 273 274 $aCountryOptions = array('all' => _t('_All')); 275 foreach ( $aPreValues['Country'] as $key => $value ) { 276 $aCountryOptions[$key] = _t($value['LKey']); 277 } 278 279 $aMembershipOptions = array('all' => _t('_All')); 280 $memberships_arr = getMemberships(); 281 foreach ( $memberships_arr as $membershipID => $membershipName ) { 282 if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) continue; 283 $aMembershipOptions[$membershipID] = $membershipName; 284 } 285 286 $iRecipientMembers = (int)$GLOBALS['MySQL']->getOne("SELECT COUNT(`ID`) AS `count` FROM `Profiles` WHERE `Status`<>'Unconfirmed' AND `EmailNotify` = 1 LIMIT 1"); 287 $aForm = array( 288 'form_attrs' => array( 289 'name' => 'form_queue', 290 'class' => 'form_queue_form', 291 'action' => $GLOBALS['site']['url_admin'] . 'notifies.php', 292 'method' => 'post', 293 ), 294 'inputs' => array ( 295 'Send1' => array( 296 'type' => 'checkbox', 297 'name' => 'send_to_subscribers', 298 'label' => _t('_adm_mmail_Send_to_subscribers'), 299 'value' => 'non', 300 'checked' => true 301 ), 302 'Send2' => array( 303 'type' => 'checkbox', 304 'name' => 'send_to_members', 305 'label' => _t('_adm_mmail_Send_to_members'), 306 'value' => 'memb', 307 'checked' => true, 308 'attrs' => array( 309 'onClick' => 'setControlsState();', 310 ), 311 'info' => _t('_adm_mmail_Send_to_members_info', $iRecipientMembers), 312 ), 313 'sex' => array ( 314 'type' => 'checkbox_set', 315 'name' => 'sex', 316 'values' => $aSexValues, 317 'value' => array_keys($aSexValues) 318 ), 319 'StartAge' => array ( 320 'type' => 'select', 321 'name' => 'age_start', 322 'caption' => _t('_adm_mmail_Age') . ' ' . _t('_from'), 323 'values' => $aStartAgesOptions, 324 'value' => $gl_search_start_age, 325 ), 326 'EndAge' => array ( 327 'type' => 'select', 328 'name' => 'age_end', 329 'caption' => _t('_to'), 330 'values' => $aEndAgesOptions, 331 'value' => $gl_search_end_age, 332 ), 333 'Country' => array ( 334 'type' => 'select', 335 'name' => 'country', 336 'caption' => _t('_Country'), 337 'values' => $aCountryOptions, 338 'value' => 'all', 339 ), 340 'Membership' => array ( 341 'type' => 'select', 342 'name' => 'membership', 343 'caption' => _t('_adm_mmi_membership_levels'), 344 'values' => $aMembershipOptions, 345 'value' => 'all', 346 ), 347 'msgs_id' => array ( 348 'type' => 'hidden', 349 'name' => 'msgs_id', 350 'value' => (int)$_POST['msgs_id'], 351 ), 352 'submit' => array ( 353 'type' => 'submit', 354 'name' => 'queue_message', 355 'value' => _t('_Submit'), 356 ) 357 ) 358 ); 359 360 $oForm = new BxTemplFormView($aForm); 361 361 $sTmplResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('notifies_filter.html', array()); 362 return DesignBoxContent(_t('_adm_mmail_Queue_message'), '<div style="margin:9px;">' . $oForm->getCode() . $sTmplResult . '</div>', 1);363 }362 return DesignBoxContent(_t('_adm_mmail_Queue_message'), '<div style="margin:9px;">' . $oForm->getCode() . $sTmplResult . '</div>', 1); 363 } 364 364 } 365 365 366 366 function QueueMessage() { 367 367 global $MySQL; 368 369 $iEmails = 0;370 $sReturn = "";371 $iMsgId = (int)$_POST['msgs_id'];372 373 $aOriginalMessage = $MySQL->getRow("SELECT `id`, `subject`, `body` FROM `sys_sbs_messages` WHERE `id`='" . $iMsgId . "' LIMIT 1");374 if(!is_array($aOriginalMessage) || empty($aOriginalMessage)) {375 return _t('_adm_mmail_Failed_to_queue_emails_X', $iMsgId);376 } 377 378 //--- Send to all subscribers379 $oEmailTemplates = new BxDolEmailTemplates(); 380 if($_POST['send_to_subscribers'] == 'non') {381 $sSql = "SELECT368 369 $iEmails = 0; 370 $sReturn = ""; 371 $iMsgId = (int)$_POST['msgs_id']; 372 373 $aOriginalMessage = $MySQL->getRow("SELECT `id`, `subject`, `body` FROM `sys_sbs_messages` WHERE `id`='" . $iMsgId . "' LIMIT 1"); 374 if(!is_array($aOriginalMessage) || empty($aOriginalMessage)) { 375 return _t('_adm_mmail_Failed_to_queue_emails_X', $iMsgId); 376 } 377 378 //--- Send to all subscribers 379 $oEmailTemplates = new BxDolEmailTemplates(); 380 if($_POST['send_to_subscribers'] == 'non') { 381 $sSql = "SELECT 382 382 `tsu`.`name` AS `user_name`, 383 383 `tsu`.`email` AS `user_email`, … … 387 387 INNER JOIN `sys_sbs_users` AS `tsu` ON `tse`.`subscriber_id`=`tsu`.`id` 388 388 WHERE 389 `tst`.`unit`='system' AND 389 `tst`.`unit`='system' AND 390 390 `tst`.`action`='mass_mailer'"; 391 391 $aSubscribers = $MySQL->getAll($sSql); 392 392 393 foreach($aSubscribers as $aSubscriber) {394 if(empty($aSubscriber['user_email']))395 continue;396 397 $aMessage = $oEmailTemplates->parseTemplate($aSubscriber['template_name'], array(393 foreach($aSubscribers as $aSubscriber) { 394 if(empty($aSubscriber['user_email'])) 395 continue; 396 397 $aMessage = $oEmailTemplates->parseTemplate($aSubscriber['template_name'], array( 398 398 'RealName' => $aSubscriber['user_name'], 399 399 'Email' => $aSubscriber['user_email'], 400 400 'MessageSubject' => $aOriginalMessage['subject'], 401 401 'MessageText' => $aOriginalMessage['body'] 402 ));403 404 $mixedResult = $MySQL->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aSubscriber['user_email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_STRIP) . "', '" . process_db_input($aMessage['body'], BX_TAGS_VALIDATE) . "')");405 if($mixedResult === false) {406 $sReturn .= _t('_adm_mmail_Email_not_added_to_queue_X', $aSubscriber['user_email']);407 continue;408 }409 $iEmails++;410 }411 }412 413 //--- Send to all profiles414 if($_POST['send_to_members'] == 'memb') {415 //--- Sex filter416 $sex_filter_sql = '';417 if(is_array($_POST['sex']) && !empty($_POST['sex']))418 $sex_filter_sql = "AND `Sex` IN ('" . implode("','", $_POST['sex']) . "')";419 420 //--- Age filter421 $age_filter_sql = '';422 $age_start = (int)$_POST['age_start'];423 $age_end = (int)$_POST['age_end'];424 if ( $age_start && $age_end ) {425 $date_start = (int)( date( "Y" ) - $age_start );426 $date_end = (int)( date( "Y" ) - $age_end - 1 );427 $date_start = $date_start . date( "-m-d" );428 $date_end = $date_end . date( "-m-d" );429 $age_filter_sql = "AND (TO_DAYS(`DateOfBirth`) BETWEEN TO_DAYS('{$date_end}') AND (TO_DAYS('{$date_start}')+1))";430 }431 432 //--- Country filter433 $country_filter_sql = '';434 if($_POST['country'] != 'all') {435 $country = process_db_input($_POST['country']);436 $country_filter_sql = "AND `Country` = '{$country}'";437 }438 439 //--- Membership filter440 $membershipID = $_POST['membership'] != 'all' ? (int)$_POST['membership'] : -1;441 442 $aMembers = $MySQL->getAll("SELECT `ID` AS `id`, `Email` AS `email` FROM `Profiles` WHERE `Status` <> 'Unconfirmed' AND `EmailNotify` = 1 AND (`Couple` = '0' OR `Couple` > `ID`) {$sex_filter_sql} {$age_filter_sql} {$country_filter_sql}");443 foreach($aMembers as $aMember) {444 if(empty($aMember['email']))445 continue;446 447 //--- Dynamic membership filter448 $membership_info = getMemberMembershipInfo($aMember['id']);449 if ($membershipID != -1 && $membership_info['ID'] != $membershipID )450 continue;402 )); 403 404 $mixedResult = $MySQL->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aSubscriber['user_email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_STRIP) . "', '" . process_db_input($aMessage['body'], BX_TAGS_VALIDATE) . "')"); 405 if($mixedResult === false) { 406 $sReturn .= _t('_adm_mmail_Email_not_added_to_queue_X', $aSubscriber['user_email']); 407 continue; 408 } 409 $iEmails++; 410 } 411 } 412 413 //--- Send to all profiles 414 if($_POST['send_to_members'] == 'memb') { 415 //--- Sex filter 416 $sex_filter_sql = ''; 417 if(is_array($_POST['sex']) && !empty($_POST['sex'])) 418 $sex_filter_sql = "AND `Sex` IN ('" . implode("','", $_POST['sex']) . "')"; 419 420 //--- Age filter 421 $age_filter_sql = ''; 422 $age_start = (int)$_POST['age_start']; 423 $age_end = (int)$_POST['age_end']; 424 if ( $age_start && $age_end ) { 425 $date_start = (int)( date( "Y" ) - $age_start ); 426 $date_end = (int)( date( "Y" ) - $age_end - 1 ); 427 $date_start = $date_start . date( "-m-d" ); 428 $date_end = $date_end . date( "-m-d" ); 429 $age_filter_sql = "AND (TO_DAYS(`DateOfBirth`) BETWEEN TO_DAYS('{$date_end}') AND (TO_DAYS('{$date_start}')+1))"; 430 } 431 432 //--- Country filter 433 $country_filter_sql = ''; 434 if($_POST['country'] != 'all') { 435 $country = process_db_input($_POST['country']); 436 $country_filter_sql = "AND `Country` = '{$country}'"; 437 } 438 439 //--- Membership filter 440 $membershipID = $_POST['membership'] != 'all' ? (int)$_POST['membership'] : -1; 441 442 $aMembers = $MySQL->getAll("SELECT `ID` AS `id`, `Email` AS `email` FROM `Profiles` WHERE `Status` <> 'Unconfirmed' AND `EmailNotify` = 1 AND (`Couple` = '0' OR `Couple` > `ID`) {$sex_filter_sql} {$age_filter_sql} {$country_filter_sql}"); 443 foreach($aMembers as $aMember) { 444 if(empty($aMember['email'])) 445 continue; 446 447 //--- Dynamic membership filter 448 $membership_info = getMemberMembershipInfo($aMember['id']); 449 if ($membershipID != -1 && $membership_info['ID'] != $membershipID ) 450 continue; 451 451 452 452 $aMessage = $oEmailTemplates->parseTemplate('t_AdminEmail', array( 453 453 'MessageSubject' => $aOriginalMessage['subject'], 454 454 'MessageText' => $aOriginalMessage['body'] 455 ), $aMember['id']);456 457 $mixedResult = $MySQL->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aMember['email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_STRIP) . "', '" . process_db_input($aMessage['body'], BX_TAGS_VALIDATE) . "')");458 if($mixedResult === false) {459 $sReturn .= _t('_adm_mmail_Email_not_added_to_queue_X', $aMember['email']);460 continue;461 }462 $iEmails++;463 }464 }465 466 $sReturn .= _t('_adm_mmail_X_emails_was_succ_added_to_queue', (int)$iEmails);467 return $sReturn;455 ), $aMember['id']); 456 457 $mixedResult = $MySQL->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aMember['email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_STRIP) . "', '" . process_db_input($aMessage['body'], BX_TAGS_VALIDATE) . "')"); 458 if($mixedResult === false) { 459 $sReturn .= _t('_adm_mmail_Email_not_added_to_queue_X', $aMember['email']); 460 continue; 461 } 462 $iEmails++; 463 } 464 } 465 466 $sReturn .= _t('_adm_mmail_X_emails_was_succ_added_to_queue', (int)$iEmails); 467 return $sReturn; 468 468 } 469 469 … … 475 475 476 476 $sPreview = '<div style="margin:9px;">' . $aMessage['body'] . '</div>'; 477 return DesignBoxContent(_t('_Preview'), $sPreview, 1);477 return DesignBoxContent(_t('_Preview'), $sPreview, 1); 478 478 } 479 479 480 480 function DeleteMessage() { 481 $mixedResult = $GLOBALS['MySQL']->query("DELETE FROM `sys_sbs_messages` WHERE `id`='". (int)$_POST['msgs_id'] . "' LIMIT 1");482 if($mixedResult === false)483 return $mixedResult;484 485 $_POST['msgs_id'] = 0;486 return true;481 $mixedResult = $GLOBALS['MySQL']->query("DELETE FROM `sys_sbs_messages` WHERE `id`='". (int)$_POST['msgs_id'] . "' LIMIT 1"); 482 if($mixedResult === false) 483 return $mixedResult; 484 485 $_POST['msgs_id'] = 0; 486 return true; 487 487 } 488 488 489 489 function EmptyQueue() { 490 return db_res("TRUNCATE TABLE `sys_sbs_queue`");490 return db_res("TRUNCATE TABLE `sys_sbs_queue`"); 491 491 } 492 492 -
trunk/administration/notify_preview.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ -
trunk/administration/pageBuilder.php
r15201 r15211 41 41 42 42 $GLOBALS['oAdmTemplate']->addJsTranslation(array( 43 '_adm_btn_Column', '_Are you sure?',43 '_adm_btn_Column', '_Are you sure?', 44 44 )); 45 45 -
trunk/administration/phpinfo.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ -
trunk/administration/preValues.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 33 33 34 34 $aFields = array( 35 'Value' => 'The value stored in the database',36 'LKey' => 'Primary language key used for displaying',37 'LKey2' => 'Secondary language key used for displaying in some other places',38 'LKey3' => 'Miscelaniuos language key used for displaying in some other places.',39 'Extra' => 'Extra parameter. Used for example as link to profile image for Sex list.',40 'Extra2' => 'Miscelanious extra parameter',41 'Extra3' => 'Miscelanious extra parameter'35 'Value' => 'The value stored in the database', 36 'LKey' => 'Primary language key used for displaying', 37 'LKey2' => 'Secondary language key used for displaying in some other places', 38 'LKey3' => 'Miscelaniuos language key used for displaying in some other places.', 39 'Extra' => 'Extra parameter. Used for example as link to profile image for Sex list.', 40 'Extra2' => 'Miscelanious extra parameter', 41 'Extra3' => 'Miscelanious extra parameter' 42 42 ); 43 43 44 44 if(bx_get('popup') !== false && (int)bx_get('popup') == 1) { 45 $iAmInPopup = true;46 47 $iNameIndex = 17;45 $iAmInPopup = true; 46 47 $iNameIndex = 17; 48 48 $_page = array( 49 49 'name_index' => $iNameIndex, 50 50 'css_name' => array('predefined_values.css'), 51 51 'js_name' => array(), 52 'header' => _t('_adm_page_cpt_pvalues_manage'), 53 'header_text' => _t('_adm_box_cpt_pvalues_manage'), 52 'header' => _t('_adm_page_cpt_pvalues_manage'), 53 'header_text' => _t('_adm_box_cpt_pvalues_manage'), 54 54 ); 55 55 $_page_cont[$iNameIndex]['page_main_code'] = PageCompPageMainCode(); 56 56 } else { 57 $iAmInPopup = false;58 59 $iNameIndex = 0;57 $iAmInPopup = false; 58 59 $iNameIndex = 0; 60 60 $_page = array( 61 61 'name_index' => $iNameIndex, 62 62 'css_name' => array('predefined_values.css'), 63 63 'js_name' => array(), 64 'header' => _t('_adm_page_cpt_pvalues_manage'), 65 'header_text' => _t('_adm_box_cpt_pvalues_manage'), 64 'header' => _t('_adm_page_cpt_pvalues_manage'), 65 'header_text' => _t('_adm_box_cpt_pvalues_manage'), 66 66 ); 67 $_page_cont[$iNameIndex]['page_main_code'] = PageCompPageMainCode(); 67 $_page_cont[$iNameIndex]['page_main_code'] = PageCompPageMainCode(); 68 68 } 69 69 … … 71 71 72 72 function PageCompPageMainCode() { 73 global $iAmInPopup;74 global $aFields;75 76 $sDeleteIcon = $GLOBALS['oAdmTemplate']->getImageUrl('minus1.gif');77 $sUpIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_up.gif');78 $sDownIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_down.gif');73 global $iAmInPopup; 74 global $aFields; 75 76 $sDeleteIcon = $GLOBALS['oAdmTemplate']->getImageUrl('minus1.gif'); 77 $sUpIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_up.gif'); 78 $sDownIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_down.gif'); 79 79 80 80 $sPopupAdd = $iAmInPopup ? '&popup=1' : ''; 81 81 $sResultMsg = ''; 82 82 83 if( isset( $_POST['action'] ) and $_POST['action'] == 'Save' and isset( $_POST['PreList'] ) and is_array( $_POST['PreList'] ) ) {83 if( isset( $_POST['action'] ) and $_POST['action'] == 'Save' and isset( $_POST['PreList'] ) and is_array( $_POST['PreList'] ) ) { 84 84 if (true === saveList( $_POST['list'], $_POST['PreList'] )) 85 85 $sResultMsg = _t('_Success'); 86 86 else 87 87 $sResultMsg = _t('_Failed to apply changes'); 88 }89 90 //get lists91 $aLists = array( '' => '- Select -' );92 $aKeys = getPreKeys();93 foreach ($aKeys as $aList)94 $aLists[ $aList['Key'] ] = $aList['Key'];95 96 $sListIn = bx_get('list');97 if ($sListIn !== false) {98 $sList_db = process_db_input($sListIn);99 $sList = process_pass_data($sListIn);100 101 $iCount = getPreValuesCount($sListIn); 102 if (!$iCount) //if no rows returned...103 $aLists[ $sList ] = $sList; //create new list104 } else {105 $sList = '';106 }88 } 89 90 //get lists 91 $aLists = array( '' => '- Select -' ); 92 $aKeys = getPreKeys(); 93 foreach ($aKeys as $aList) 94 $aLists[ $aList['Key'] ] = $aList['Key']; 95 96 $sListIn = bx_get('list'); 97 if ($sListIn !== false) { 98 $sList_db = process_db_input($sListIn); 99 $sList = process_pass_data($sListIn); 100 101 $iCount = getPreValuesCount($sListIn); 102 if (!$iCount) //if no rows returned... 103 $aLists[ $sList ] = $sList; //create new list 104 } else { 105 $sList = ''; 106 } 107 107 108 108 ob_start(); … … 110 110 if ($sResultMsg) 111 111 echo MsgBox($sResultMsg); 112 ?> 113 <script type="text/javascript">114 function createNewList() {115 var sNewList = prompt( 'Please enter name of new list' );116 117 if( sNewList == null )118 return false;119 120 sNewList = $.trim( sNewList );121 122 if( !sNewList.length ) {123 alert( 'You should enter correct name' );124 return false;125 }126 127 window.location = '<?=$GLOBALS['site']['url_admin'] . 'preValues.php'; ?>?list=' + encodeURIComponent( sNewList ) + '<?= $sPopupAdd ?>';128 }129 130 function addRow( eImg ) {131 132 $( eImg ).parent().parent().before(133 '<tr>' +134 <?135 foreach( $aFields as $sField => $sHelp ) {136 ?>137 '<td><input type="text" class="value_input" name="PreList[' + iNextInd + '][<?= $sField ?>]" value="" /></td>' +138 <?139 }140 ?>141 '<th>' +142 '<img src="<?= $sDeleteIcon ?>" class="row_control" title="Delete" alt="Delete" onclick="delRow( this );" />' +143 '<img src="<?= $sUpIcon ?>" class="row_control" title="Move up" alt="Move up" onclick="moveUpRow( this );" />' +144 '<img src="<?= $sDownIcon ?>" class="row_control" title="Move down" alt="Move down" onclick="moveDownRow( this );" />' +145 '</th>' +146 '</tr>'147 );148 149 iNextInd ++;150 151 sortZebra();152 }153 154 function delRow( eImg ) {155 $( eImg ).parent().parent().remove();156 sortZebra();157 }158 159 function moveUpRow( eImg ) {160 var oCur = $( eImg ).parent().parent();161 var oPrev = oCur.prev( ':not(.headers)' );162 if( !oPrev.length )163 return;164 165 // swap elements values166 var oCurElems = $('input', oCur.get(0));167 var oPrevElems = $('input', oPrev.get(0));168 169 oCurElems.each( function(iInd) {170 var oCurElem = $( this );171 var oPrevElem = oPrevElems.filter( ':eq(' + iInd + ')' );172 173 // swap them174 var sCurValue = oCurElem.val();175 oCurElem.val( oPrevElem.val() );176 oPrevElem.val( sCurValue );177 } );178 }179 180 function moveDownRow( eImg ) {181 var oCur = $( eImg ).parent().parent();182 var oPrev = oCur.next( ':not(.headers)' );183 if( !oPrev.length )184 return;185 186 // swap elements values187 var oCurElems = $('input', oCur.get(0));188 var oPrevElems = $('input', oPrev.get(0));189 190 oCurElems.each( function(iInd) {191 var oCurElem = $( this );192 var oPrevElem = oPrevElems.filter( ':eq(' + iInd + ')' );193 194 // swap them195 var sCurValue = oCurElem.val();196 oCurElem.val( oPrevElem.val() );197 oPrevElem.val( sCurValue );198 } );199 }200 201 function sortZebra() {202 $( '#listEdit tr:even' ).removeClass( 'even odd' ).addClass( 'even' );203 $( '#listEdit tr:odd' ).removeClass( 'even odd' ).addClass( 'odd' );204 }205 206 //just a design207 $( document ).ready( sortZebra );208 </script>209 210 <form action="<?=$GLOBALS['site']['url_admin'] . 'preValues.php'; ?>" method="post">211 <table id="listEdit" cellpadding="0" cellspacing="0">212 <tr>213 <th colspan="<?= count( $aFields ) + 1 ?>">214 Select a list:215 <select name="list"216 onchange="if( this.value != '' ) window.location = '<?=$GLOBALS['site']['url_admin'] . 'preValues.php'; ?>' + '?list=' + encodeURIComponent( this.value ) + '<?= $sPopupAdd ?>';">217 <?= genListOptions( $aLists, $sList ) ?>218 </select>219 <input type="button" value="Create New" onclick="createNewList();" />220 </th>221 </tr>222 <?223 if( $sList !== '' ) {224 $iNextInd = genListRows( $sList_db );225 ?>226 <tr>227 <th colspan="8">228 <input type="hidden" name="popup" value="<?= $iAmInPopup ?>" />229 <input type="submit" name="action" value="Save" />230 </th>231 </tr>232 <?233 } else234 $iNextInd = 0;235 ?>236 </table>237 238 <script type="text/javascript">239 iNextInd = <?= $iNextInd ?>;240 </script>241 </form>242 <?243 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => ob_get_clean()));112 ?> 113 <script type="text/javascript"> 114 function createNewList() { 115 var sNewList = prompt( 'Please enter name of new list' ); 116 117 if( sNewList == null ) 118 return false; 119 120 sNewList = $.trim( sNewList ); 121 122 if( !sNewList.length ) { 123 alert( 'You should enter correct name' ); 124 return false; 125 } 126 127 window.location = '<?=$GLOBALS['site']['url_admin'] . 'preValues.php'; ?>?list=' + encodeURIComponent( sNewList ) + '<?= $sPopupAdd ?>'; 128 } 129 130 function addRow( eImg ) { 131 132 $( eImg ).parent().parent().before( 133 '<tr>' + 134 <? 135 foreach( $aFields as $sField => $sHelp ) { 136 ?> 137 '<td><input type="text" class="value_input" name="PreList[' + iNextInd + '][<?= $sField ?>]" value="" /></td>' + 138 <? 139 } 140 ?> 141 '<th>' + 142 '<img src="<?= $sDeleteIcon ?>" class="row_control" title="Delete" alt="Delete" onclick="delRow( this );" />' + 143 '<img src="<?= $sUpIcon ?>" class="row_control" title="Move up" alt="Move up" onclick="moveUpRow( this );" />' + 144 '<img src="<?= $sDownIcon ?>" class="row_control" title="Move down" alt="Move down" onclick="moveDownRow( this );" />' + 145 '</th>' + 146 '</tr>' 147 ); 148 149 iNextInd ++; 150 151 sortZebra(); 152 } 153 154 function delRow( eImg ) { 155 $( eImg ).parent().parent().remove(); 156 sortZebra(); 157 } 158 159 function moveUpRow( eImg ) { 160 var oCur = $( eImg ).parent().parent(); 161 var oPrev = oCur.prev( ':not(.headers)' ); 162 if( !oPrev.length ) 163 return; 164 165 // swap elements values 166 var oCurElems = $('input', oCur.get(0)); 167 var oPrevElems = $('input', oPrev.get(0)); 168 169 oCurElems.each( function(iInd) { 170 var oCurElem = $( this ); 171 var oPrevElem = oPrevElems.filter( ':eq(' + iInd + ')' ); 172 173 // swap them 174 var sCurValue = oCurElem.val(); 175 oCurElem.val( oPrevElem.val() ); 176 oPrevElem.val( sCurValue ); 177 } ); 178 } 179 180 function moveDownRow( eImg ) { 181 var oCur = $( eImg ).parent().parent(); 182 var oPrev = oCur.next( ':not(.headers)' ); 183 if( !oPrev.length ) 184 return; 185 186 // swap elements values 187 var oCurElems = $('input', oCur.get(0)); 188 var oPrevElems = $('input', oPrev.get(0)); 189 190 oCurElems.each( function(iInd) { 191 var oCurElem = $( this ); 192 var oPrevElem = oPrevElems.filter( ':eq(' + iInd + ')' ); 193 194 // swap them 195 var sCurValue = oCurElem.val(); 196 oCurElem.val( oPrevElem.val() ); 197 oPrevElem.val( sCurValue ); 198 } ); 199 } 200 201 function sortZebra() { 202 $( '#listEdit tr:even' ).removeClass( 'even odd' ).addClass( 'even' ); 203 $( '#listEdit tr:odd' ).removeClass( 'even odd' ).addClass( 'odd' ); 204 } 205 206 //just a design 207 $( document ).ready( sortZebra ); 208 </script> 209 210 <form action="<?=$GLOBALS['site']['url_admin'] . 'preValues.php'; ?>" method="post"> 211 <table id="listEdit" cellpadding="0" cellspacing="0"> 212 <tr> 213 <th colspan="<?= count( $aFields ) + 1 ?>"> 214 Select a list: 215 <select name="list" 216 onchange="if( this.value != '' ) window.location = '<?=$GLOBALS['site']['url_admin'] . 'preValues.php'; ?>' + '?list=' + encodeURIComponent( this.value ) + '<?= $sPopupAdd ?>';"> 217 <?= genListOptions( $aLists, $sList ) ?> 218 </select> 219 <input type="button" value="Create New" onclick="createNewList();" /> 220 </th> 221 </tr> 222 <? 223 if( $sList !== '' ) { 224 $iNextInd = genListRows( $sList_db ); 225 ?> 226 <tr> 227 <th colspan="8"> 228 <input type="hidden" name="popup" value="<?= $iAmInPopup ?>" /> 229 <input type="submit" name="action" value="Save" /> 230 </th> 231 </tr> 232 <? 233 } else 234 $iNextInd = 0; 235 ?> 236 </table> 237 238 <script type="text/javascript"> 239 iNextInd = <?= $iNextInd ?>; 240 </script> 241 </form> 242 <? 243 return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => ob_get_clean())); 244 244 } 245 245 246 246 function genListOptions( $aLists, $sActive ) { 247 $sRet = '';248 foreach( $aLists as $sKey => $sValue ) {249 $sRet .= '250 <option value="' .251 htmlspecialchars( $sKey ) .252 '"' . ( ( $sKey == $sActive ) ? ' selected="selected"' : '' ) .253 '>' . htmlspecialchars( $sValue ) . '</option>';254 }255 256 return $sRet;247 $sRet = ''; 248 foreach( $aLists as $sKey => $sValue ) { 249 $sRet .= ' 250 <option value="' . 251 htmlspecialchars( $sKey ) . 252 '"' . ( ( $sKey == $sActive ) ? ' selected="selected"' : '' ) . 253 '>' . htmlspecialchars( $sValue ) . '</option>'; 254 } 255 256 return $sRet; 257 257 } 258 258 259 259 function genListRows( $sList ) { 260 global $aFields;261 262 $sDeleteIcon = $GLOBALS['oAdmTemplate']->getImageUrl('minus1.gif');263 $sUpIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_up.gif');264 $sDownIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_down.gif');265 266 $aRows = getPreValues($sList);267 268 ?>269 <tr class="headers">270 <?271 foreach( $aFields as $sField => $sHelp ) {272 ?>273 <th>274 <span class="tableLabel"275 onmouseover="showFloatDesc( '<?= addslashes( htmlspecialchars( $sHelp ) ) ?>' );"276 onmousemove="moveFloatDesc( event );"277 onmouseout="hideFloatDesc();">278 <?= $sField ?>279 </span>280 </th>281 <?282 }283 ?>284 <th> </th>285 </tr>286 <?287 288 $iCounter = 0;289 290 foreach ($aRows as $aRow) {291 ?>292 <tr>293 <?294 foreach( $aFields as $sField => $sHelp ) {295 ?>296 <td><input type="text" class="value_input" name="PreList[<?= $iCounter ?>][<?= $sField ?>]" value="<?= htmlspecialchars( $aRow[$sField] ) ?>" /></td>297 <?298 }299 ?>300 <th><img src="<?=$sDeleteIcon?>" class="row_control" title="Delete" alt="Delete" onclick="delRow( this );" /><img src="<?= $sUpIcon ?>" class="row_control" title="Move up" alt="Move up" onclick="moveUpRow( this );" /><img src="<?= $sDownIcon ?>" class="row_control" title="Move down" alt="Move down" onclick="moveDownRow( this );" /></th>301 </tr>302 <?303 304 $iCounter ++;305 }306 ?>307 <tr class="headers">308 <td colspan="<?= count( $aFields ) ?>"> </td>309 <th>260 global $aFields; 261 262 $sDeleteIcon = $GLOBALS['oAdmTemplate']->getImageUrl('minus1.gif'); 263 $sUpIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_up.gif'); 264 $sDownIcon = $GLOBALS['oAdmTemplate']->getImageUrl('arrow_down.gif'); 265 266 $aRows = getPreValues($sList); 267 268 ?> 269 <tr class="headers"> 270 <? 271 foreach( $aFields as $sField => $sHelp ) { 272 ?> 273 <th> 274 <span class="tableLabel" 275 onmouseover="showFloatDesc( '<?= addslashes( htmlspecialchars( $sHelp ) ) ?>' );" 276 onmousemove="moveFloatDesc( event );" 277 onmouseout="hideFloatDesc();"> 278 <?= $sField ?> 279 </span> 280 </th> 281 <? 282 } 283 ?> 284 <th> </th> 285 </tr> 286 <? 287 288 $iCounter = 0; 289 290 foreach ($aRows as $aRow) { 291 ?> 292 <tr> 293 <? 294 foreach( $aFields as $sField => $sHelp ) { 295 ?> 296 <td><input type="text" class="value_input" name="PreList[<?= $iCounter ?>][<?= $sField ?>]" value="<?= htmlspecialchars( $aRow[$sField] ) ?>" /></td> 297 <? 298 } 299 ?> 300 <th><img src="<?=$sDeleteIcon?>" class="row_control" title="Delete" alt="Delete" onclick="delRow( this );" /><img src="<?= $sUpIcon ?>" class="row_control" title="Move up" alt="Move up" onclick="moveUpRow( this );" /><img src="<?= $sDownIcon ?>" class="row_control" title="Move down" alt="Move down" onclick="moveDownRow( this );" /></th> 301 </tr> 302 <? 303 304 $iCounter ++; 305 } 306 ?> 307 <tr class="headers"> 308 <td colspan="<?= count( $aFields ) ?>"> </td> 309 <th> 310 310 <img src="<?= $GLOBALS['oAdmTemplate']->getImageUrl('plus1.gif') ?>" class="row_control" title="Add" alt="Add" onclick="addRow( this );" /> 311 </th>312 </tr>313 <?314 315 return $iCounter;311 </th> 312 </tr> 313 <? 314 315 return $iCounter; 316 316 } 317 317 318 318 function saveList( $sList, $aData ) { 319 global $aFields;320 global $iAmInPopup;321 322 $sList_db = trim( process_db_input( $sList ) );323 324 if( $sList_db == '' )325 return false;326 327 $sQuery = "DELETE FROM `" . BX_SYS_PRE_VALUES_TABLE . "` WHERE `Key` = '$sList_db'";328 329 db_res( $sQuery );330 331 $sValuesAlter = '';332 333 foreach( $aData as $iInd => $aRow ) {334 $aRow['Value'] = str_replace( ',', '', trim( $aRow['Value'] ) );335 336 if( $aRow['Value'] == '' )337 continue;338 339 $sValuesAlter .= "'" . process_db_input( $aRow['Value'] ) . "', ";340 341 $sInsFields = '';342 $sInsValues = '';343 foreach( $aFields as $sField => $sTemp ) {344 $sValue = trim( process_db_input( $aRow[$sField] ) );345 346 $sInsFields .= "`$sField`, ";347 $sInsValues .= "'$sValue', ";348 }349 350 $sInsFields = substr( $sInsFields, 0, -2 ); //remove ', '351 $sInsValues = substr( $sInsValues, 0, -2 );352 353 $sQuery = "INSERT INTO `" . BX_SYS_PRE_VALUES_TABLE . "` ( `Key`, $sInsFields, `Order` ) VALUES ( '$sList_db', $sInsValues, $iInd )";354 355 db_res( $sQuery );356 }357 358 //alter Profiles table359 $sValuesAlter = substr( $sValuesAlter, 0, -2 ); //remove ', '360 $sQuery = "SELECT `Name` FROM `sys_profile_fields` WHERE `Type` = 'select_set' AND `Values` = '#!{$sList_db}'";361 $rFields = db_res( $sQuery );362 while( $aField = mysql_fetch_assoc( $rFields ) ) {363 $sField = $aField['Name'];364 365 $sQuery = "ALTER TABLE `Profiles` CHANGE `$sField` `$sField` set($sValuesAlter) NOT NULL default ''";366 db_res( $sQuery );367 }368 369 compilePreValues();319 global $aFields; 320 global $iAmInPopup; 321 322 $sList_db = trim( process_db_input( $sList ) ); 323 324 if( $sList_db == '' ) 325 return false; 326 327 $sQuery = "DELETE FROM `" . BX_SYS_PRE_VALUES_TABLE . "` WHERE `Key` = '$sList_db'"; 328 329 db_res( $sQuery ); 330 331 $sValuesAlter = ''; 332 333 foreach( $aData as $iInd => $aRow ) { 334 $aRow['Value'] = str_replace( ',', '', trim( $aRow['Value'] ) ); 335 336 if( $aRow['Value'] == '' ) 337 continue; 338 339 $sValuesAlter .= "'" . process_db_input( $aRow['Value'] ) . "', "; 340 341 $sInsFields = ''; 342 $sInsValues = ''; 343 foreach( $aFields as $sField => $sTemp ) { 344 $sValue = trim( process_db_input( $aRow[$sField] ) ); 345 346 $sInsFields .= "`$sField`, "; 347 $sInsValues .= "'$sValue', "; 348 } 349 350 $sInsFields = substr( $sInsFields, 0, -2 ); //remove ', ' 351 $sInsValues = substr( $sInsValues, 0, -2 ); 352 353 $sQuery = "INSERT INTO `" . BX_SYS_PRE_VALUES_TABLE . "` ( `Key`, $sInsFields, `Order` ) VALUES ( '$sList_db', $sInsValues, $iInd )"; 354 355 db_res( $sQuery ); 356 } 357 358 //alter Profiles table 359 $sValuesAlter = substr( $sValuesAlter, 0, -2 ); //remove ', ' 360 $sQuery = "SELECT `Name` FROM `sys_profile_fields` WHERE `Type` = 'select_set' AND `Values` = '#!{$sList_db}'"; 361 $rFields = db_res( $sQuery ); 362 while( $aField = mysql_fetch_assoc( $rFields ) ) { 363 $sField = $aField['Name']; 364 365 $sQuery = "ALTER TABLE `Profiles` CHANGE `$sField` `$sField` set($sValuesAlter) NOT NULL default ''"; 366 db_res( $sQuery ); 367 } 368 369 compilePreValues(); 370 370 371 371 if( $iAmInPopup ) -
trunk/administration/profiles.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 55 55 $oEmailTemplate = new BxDolEmailTemplates(); 56 56 foreach($_POST['members'] as $iId) { 57 createUserDataFile((int)$iId);58 reparseObjTags('profile', (int)$iId);59 60 $aProfile = getProfileInfo($iId);61 $aMail = $oEmailTemplate->parseTemplate('t_Activation', array(), $iId);62 sendMail($aProfile['Email'], $aMail['subject'], $aMail['body']);57 createUserDataFile((int)$iId); 58 reparseObjTags('profile', (int)$iId); 59 60 $aProfile = getProfileInfo($iId); 61 $aMail = $oEmailTemplate->parseTemplate('t_Activation', array(), $iId); 62 sendMail($aProfile['Email'], $aMail['subject'], $aMail['body']); 63 63 64 64 $oAlert = new BxDolAlerts('profile', 'change_status', (int)$iId, 0, array('status' => 'Active')); … … 67 67 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; 68 68 exit; 69 } 69 } 70 70 else if(isset($_POST['adm-mp-deactivate']) && (bool)$_POST['members']) { 71 71 $GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status`='Approval' WHERE `ID` IN ('" . implode("','", $_POST['members']) . "')"); 72 72 foreach($_POST['members'] as $iId) { 73 createUserDataFile((int)$iId);74 reparseObjTags('profile', (int)$iId);73 createUserDataFile((int)$iId); 74 reparseObjTags('profile', (int)$iId); 75 75 $oAlert = new BxDolAlerts('profile', 'change_status', (int)$iId, 0, array('status' => 'Approval')); 76 76 $oAlert->alert(); … … 79 79 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; 80 80 exit; 81 } 81 } 82 82 else if(isset($_POST['adm-mp-ban']) && (bool)$_POST['members']) { 83 83 foreach($_POST['members'] as $iId) 84 84 $GLOBALS['MySQL']->query("REPLACE INTO `sys_admin_ban_list` SET `ProfID`='" . $iId . "', `Time`='0', `DateTime`=NOW()"); 85 85 86 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";87 exit; 88 } 89 else if(isset($_POST['adm-mp-unban']) && (bool)$_POST['members']) { 86 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; 87 exit; 88 } 89 else if(isset($_POST['adm-mp-unban']) && (bool)$_POST['members']) { 90 90 $GLOBALS['MySQL']->query("DELETE FROM `sys_admin_ban_list` WHERE `ProfID` IN ('" . implode("','", $_POST['members']) . "')"); 91 91 92 92 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; 93 93 exit; 94 } 95 else if(isset($_POST['adm-mp-delete']) && (bool)$_POST['members']) { 94 } 95 else if(isset($_POST['adm-mp-delete']) && (bool)$_POST['members']) { 96 96 foreach($_POST['members'] as $iId) 97 97 $bResult = profile_delete((int)$iId); 98 98 99 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";100 exit; 101 } 102 else if(isset($_POST['adm-mp-confirm']) && (bool)$_POST['members']) { 99 echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; 100 exit; 101 } 102 else if(isset($_POST['adm-mp-confirm']) && (bool)$_POST['members']) { 103 103 foreach($_POST['members'] as $iId) 104 104 activation_mail((int)$iId, 0); 105 105 106 echo "<script>alert('" . _t('_adm_txt_mp_activation_sent') . "')</script>";106 echo "<script>alert('" . _t('_adm_txt_mp_activation_sent') . "')</script>"; 107 107 exit; 108 108 } … … 115 115 } 116 116 117 $oJson = new Services_JSON(); 117 $oJson = new Services_JSON(); 118 118 echo $oJson->encode(array('code' => 0, 'content' => getMembers(array( 119 'view_type' => $_POST['view_type'], 119 'view_type' => $_POST['view_type'], 120 120 'view_start' => (int)$_POST['view_start'], 121 121 'view_per_page' => (int)$_POST['view_per_page'], … … 127 127 } 128 128 else if(isset($_POST['action']) && $_POST['action'] == 'get_controls') { 129 $oJson = new Services_JSON();130 131 $sCtlType = process_db_input($_POST['ctl_type'], BX_TAGS_STRIP);132 $sMethodName = 'getBlock' . ucfirst($sCtlType);133 if(!function_exists($sMethodName)) {134 echo '{}';135 exit;136 }129 $oJson = new Services_JSON(); 130 131 $sCtlType = process_db_input($_POST['ctl_type'], BX_TAGS_STRIP); 132 $sMethodName = 'getBlock' . ucfirst($sCtlType); 133 if(!function_exists($sMethodName)) { 134 echo '{}'; 135 exit; 136 } 137 137 138 138 echo $oJson->encode(array( 139 'code' => 0,140 'content' => $oAdmTemplate->parseHtmlByName('mp_ctl_type_' . $sCtlType . '.html', $sMethodName($sCtlType))139 'code' => 0, 140 'content' => $oAdmTemplate->parseHtmlByName('mp_ctl_type_' . $sCtlType . '.html', $sMethodName($sCtlType)) 141 141 )); 142 142 exit; … … 164 164 165 165 function PageCodeControls($sDefault = BX_DOL_ADM_MP_CTL) { 166 global $oAdmTemplate; 167 168 $aTopMenu = array( 166 global $oAdmTemplate; 167 168 $aTopMenu = array( 169 169 'ctl-type-qlinks' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeControl(this);', 'title' => _t('_adm_btn_mp_qlinks'), 'active' => $sDefault == 'qlinks' ? 1 : 0), 170 170 //'ctl-type-browse' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeControl(this);', 'title' => _t('_adm_btn_mp_browse'), 'active' => $sDefault == 'browse' ? 1 : 0), … … 172 172 'ctl-type-tags' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeControl(this);', 'title' => _t('_adm_btn_mp_tags'), 'active' => $sDefault == 'tags' ? 1 : 0), 173 173 'ctl-type-search' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeControl(this);', 'title' => _t('_adm_btn_mp_search'), 'active' => $sDefault == 'search' ? 1 : 0) 174 ); 174 ); 175 175 176 176 $aParams = array_merge( 177 getBlockQlinks($sDefault),178 getBlockBrowse($sDefault),179 getBlockCalendar($sDefault),180 getBlockTags($sDefault),181 getBlockSearch($sDefault),182 array(183 'loading' => LoadingBox('adm-mp-controls-loading')184 )177 getBlockQlinks($sDefault), 178 getBlockBrowse($sDefault), 179 getBlockCalendar($sDefault), 180 getBlockTags($sDefault), 181 getBlockSearch($sDefault), 182 array( 183 'loading' => LoadingBox('adm-mp-controls-loading') 184 ) 185 185 ); 186 186 return DesignBoxAdmin(_t('_adm_box_cpt_mp_controls'), $oAdmTemplate->parseHtmlByName('mp_controls.html', $aParams), $aTopMenu); … … 188 188 function getBlockQlinks($sDefault) { 189 189 global $MySQL; 190 190 191 191 $aResult = array(); 192 192 $sBaseUrl = $GLOBALS['site']['url_admin'] . 'profiles.php?type=qlinks&value='; 193 193 194 194 $aItems = array(); 195 195 $aItems = array_merge($aItems, $MySQL->getAll("SELECT 'all' AS `by`, 'all' AS `value`, COUNT(`ID`) AS `count` FROM `Profiles` WHERE 1 AND (`Couple`='0' OR `Couple`>`ID`)")); … … 202 202 $aItems = array_merge($aItems, $MySQL->getAll("SELECT 'type' AS `by`, 'couple' AS `value`, COUNT(`ID`) AS `count` FROM `Profiles` WHERE `Couple`<>'0' AND `Couple`>`ID`")); 203 203 $aItems = array_merge($aItems, $MySQL->getAll("SELECT 'role' AS `by`, 'admins' AS `value`, COUNT(`ID`) AS `count` FROM `Profiles` WHERE `Role` & " . BX_DOL_ROLE_ADMIN . "")); 204 204 205 205 foreach($aItems as $aItem) 206 206 $aResult[] = array('link' => 'javascript:void(0)', 'on_click' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeFilterQlinks(\'' . strtolower($aItem['by']) . '\', \'' . strtolower($aItem['value']) . '\')', 'title' => _t('_adm_txt_mp_' . strtolower($aItem['value'])), 'count' => $aItem['count']); 207 207 208 return array( 209 'styles_qlinks' => $sDefault != 'qlinks' ? "display: none;" : "",210 'bx_repeat:content_qlinks' => $aResult208 return array( 209 'styles_qlinks' => $sDefault != 'qlinks' ? "display: none;" : "", 210 'bx_repeat:content_qlinks' => $aResult 211 211 ); 212 212 } 213 213 function getBlockBrowse($sDefault) { 214 return array(215 'styles_browse' => $sDefault != 'browse' ? "display: none;" : "",216 'content_browse' => ''217 );214 return array( 215 'styles_browse' => $sDefault != 'browse' ? "display: none;" : "", 216 'content_browse' => '' 217 ); 218 218 } 219 219 function getBlockCalendar($sDefault) { 220 return array(221 'styles_calendar' => $sDefault != 'calendar' ? "display: none;" : "",222 'content_calendar' => ''223 );220 return array( 221 'styles_calendar' => $sDefault != 'calendar' ? "display: none;" : "", 222 'content_calendar' => '' 223 ); 224 224 } 225 225 function getBlockTags($sDefault) { … … 229 229 $aTags = $oTags->getTagList(array('type' => 'profile')); 230 230 return array( 231 'styles_tags' => $sDefault != 'tags' ? "display: none;" : "",232 'content_tags' => $oTags->getTagsView($aTags, BX_DOL_ADM_MP_JS_NAME . '.changeFilterTags(\'{tag}\')')231 'styles_tags' => $sDefault != 'tags' ? "display: none;" : "", 232 'content_tags' => $oTags->getTagsView($aTags, BX_DOL_ADM_MP_JS_NAME . '.changeFilterTags(\'{tag}\')') 233 233 ); 234 234 } … … 255 255 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeFilterSearch()' 256 256 ) 257 ), 257 ), 258 258 ) 259 259 ); … … 261 261 $oForm = new BxTemplFormView($aForm); 262 262 return array( 263 'styles_search' => $sDefault != 'search' ? "display: none;" : "",264 'content_search' => $oForm->getCode()263 'styles_search' => $sDefault != 'search' ? "display: none;" : "", 264 'content_search' => $oForm->getCode() 265 265 ); 266 266 } … … 272 272 'adm-mp-deactivate' => _t('_adm_btn_mp_deactivate'), 273 273 'adm-mp-ban' => _t('_adm_btn_mp_ban'), 274 'adm-mp-unban' => _t('_adm_btn_mp_unban'), 274 'adm-mp-unban' => _t('_adm_btn_mp_unban'), 275 275 'adm-mp-confirm' => _t('_adm_btn_mp_confirm'), 276 276 'adm-mp-delete' => _t('_adm_btn_mp_delete'), 277 ); 277 ); 278 278 $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mp-members-form', $aButtons, 'members'); 279 279 280 280 $aTopMenu = array( 281 'view-type-simple' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_simple'), 'active' => $sDefaultView == 'simple' ? 1 : 0), 282 'view-type-extended' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_extended'), 'active' => $sDefaultView == 'extended' ? 1 : 0), 281 'view-type-simple' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_simple'), 'active' => $sDefaultView == 'simple' ? 1 : 0), 282 'view-type-extended' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_extended'), 'active' => $sDefaultView == 'extended' ? 1 : 0), 283 283 'view-type-geeky' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_geeky'), 'active' => $sDefaultView == 'geeky' ? 1 : 0) 284 284 ); … … 288 288 'per_page_step' => BX_DOL_ADM_MP_PER_PAGE_STEP, 289 289 'on_change_per_page' => BX_DOL_ADM_MP_JS_NAME . '.changePerPage(this);' 290 )); 290 )); 291 291 292 292 $aResult = array( 293 'action_url' => $GLOBALS['site']['url_admin'] . 'profiles.php',293 'action_url' => $GLOBALS['site']['url_admin'] . 'profiles.php', 294 294 'ctl_type' => $sDefaultCtl, 295 295 'view_type' => $sDefaultView, … … 301 301 302 302 foreach(array('simple', 'extended', 'geeky') as $sType) 303 if($sType == $sDefaultView) 303 if($sType == $sDefaultView) 304 304 $aResult = array_merge($aResult, array('style_' . $sType => '', 'content_' . $sType => getMembers(array('view_type' => $sType)))); 305 else 305 else 306 306 $aResult = array_merge($aResult, array('style_' . $sType => 'display: none;', 'content_' . $sType => '')); 307 307 … … 316 316 $aParams['view_per_page'] = BX_DOL_ADM_MP_PER_PAGE; 317 317 318 $aParams['view_order_way'] = 'ASC';318 $aParams['view_order_way'] = 'ASC'; 319 319 if(!isset($aParams['view_order']) || empty($aParams['view_order'])) 320 320 $aParams['view_order'] = 'ID'; 321 else {322 $aOrder = explode(' ', $aParams['view_order']);323 if(count($aOrder) > 1) {324 $aParams['view_order'] = $aOrder[0];325 $aParams['view_order_way'] = $aOrder[1]; 326 }327 }321 else { 322 $aOrder = explode(' ', $aParams['view_order']); 323 if(count($aOrder) > 1) { 324 $aParams['view_order'] = $aOrder[0]; 325 $aParams['view_order_way'] = $aOrder[1]; 326 } 327 } 328 328 329 329 $sDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB); … … 342 342 $sWhereClause .= " AND (`tbl`.`Time`='0' OR (`tbl`.`Time`<>'0' AND DATE_ADD(`tbl`.`DateTime`, INTERVAL `tbl`.`Time` HOUR)>NOW()))"; 343 343 break; 344 case 'type': 344 case 'type': 345 345 $sWhereClause .= $aParams['ctl_params']['value'] == 'single' ? " AND `tp`.`Couple`='0'" : " AND `tp`.`Couple`<>'0' AND `tp`.`Couple`>`tp`.`ID`"; 346 346 break; … … 367 367 case 'search': 368 368 $sWhereClause .= " AND ( 369 `tp`.`ID` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR370 `tp`.`NickName` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 371 `tp`.`Email` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 372 `tp`.`Headline` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 373 `tp`.`DescriptionMe` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 374 `tp`.`Tags` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 375 `tp`.`DateReg` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 369 `tp`.`ID` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 370 `tp`.`NickName` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 371 `tp`.`Email` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 372 `tp`.`Headline` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 373 `tp`.`DescriptionMe` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 374 `tp`.`Tags` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 375 `tp`.`DateReg` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR 376 376 `tp`.`DateLastLogin` LIKE '%" . $aParams['ctl_params']['value'] . "%' 377 377 )"; 378 378 break; 379 379 } 380 380 381 381 //--- Get Paginate ---// 382 382 $oPaginate = new BxDolPaginate(array( … … 387 387 'on_change_page' => BX_DOL_ADM_MP_JS_NAME . '.changePage({start})' 388 388 )); 389 $sPaginate = $oPaginate->getPaginate(); 389 $sPaginate = $oPaginate->getPaginate(); 390 390 391 391 //--- Get Items ---// 392 392 $sQuery = " 393 SELECT394 `tp`.`ID` as `id`,395 `tp`.`NickName` AS `username`,396 `tp`.`Headline` AS `headline`,397 `tp`.`Sex` AS `sex`,398 `tp`.`DateOfBirth` AS `date_of_birth`,399 `tp`.`Country` AS `country`,400 `tp`.`City` AS `city`,401 `tp`.`DescriptionMe` AS `description`,402 `tp`.`Email` AS `email`,403 DATE_FORMAT(`tp`.`DateReg`, '" . $sDateFormat . "' ) AS `registration`,404 DATE_FORMAT(`tp`.`DateLastLogin`, '" . $sDateFormat . "' ) AS `last_login`,405 `tp`.`Status` AS `status`,406 IF(`tbl`.`Time`='0' OR DATE_ADD(`tbl`.`DateTime`, INTERVAL `tbl`.`Time` HOUR)>NOW(), 1, 0) AS `banned`,407 `tl`.`ID` AS `ml_id`,408 IF(ISNULL(`tl`.`Name`),'', `tl`.`Name`) AS `ml_name`409 " . $sSelectClause . "410 FROM `Profiles` AS `tp`393 SELECT 394 `tp`.`ID` as `id`, 395 `tp`.`NickName` AS `username`, 396 `tp`.`Headline` AS `headline`, 397 `tp`.`Sex` AS `sex`, 398 `tp`.`DateOfBirth` AS `date_of_birth`, 399 `tp`.`Country` AS `country`, 400 `tp`.`City` AS `city`, 401 `tp`.`DescriptionMe` AS `description`, 402 `tp`.`Email` AS `email`, 403 DATE_FORMAT(`tp`.`DateReg`, '" . $sDateFormat . "' ) AS `registration`, 404 DATE_FORMAT(`tp`.`DateLastLogin`, '" . $sDateFormat . "' ) AS `last_login`, 405 `tp`.`Status` AS `status`, 406 IF(`tbl`.`Time`='0' OR DATE_ADD(`tbl`.`DateTime`, INTERVAL `tbl`.`Time` HOUR)>NOW(), 1, 0) AS `banned`, 407 `tl`.`ID` AS `ml_id`, 408 IF(ISNULL(`tl`.`Name`),'', `tl`.`Name`) AS `ml_name` 409 " . $sSelectClause . " 410 FROM `Profiles` AS `tp` 411 411 LEFT JOIN `sys_admin_ban_list` AS `tbl` ON `tp`.`ID`=`tbl`.`ProfID` 412 LEFT JOIN `sys_acl_levels_members` AS `tlm` ON `tp`.`ID`=`tlm`.`IDMember` AND `tlm`.`DateStarts` < NOW() AND (`tlm`.`DateExpires`>NOW() || ISNULL(`tlm`.`DateExpires`)) 413 LEFT JOIN `sys_acl_levels` AS `tl` ON `tlm`.`IDLevel`=`tl`.`ID` 414 " . $sJoinClause . "415 WHERE416 1 AND (`tp`.`Couple`=0 OR `tp`.`Couple`>`tp`.`ID`)" . $sWhereClause . "417 " . $sGroupClause . "418 ORDER BY `tp`.`" . $aParams['view_order'] . "` " . $aParams['view_order_way'] . "419 LIMIT " . $aParams['view_start'] . ", " . $aParams['view_per_page'];412 LEFT JOIN `sys_acl_levels_members` AS `tlm` ON `tp`.`ID`=`tlm`.`IDMember` AND `tlm`.`DateStarts` < NOW() AND (`tlm`.`DateExpires`>NOW() || ISNULL(`tlm`.`DateExpires`)) 413 LEFT JOIN `sys_acl_levels` AS `tl` ON `tlm`.`IDLevel`=`tl`.`ID` 414 " . $sJoinClause . " 415 WHERE 416 1 AND (`tp`.`Couple`=0 OR `tp`.`Couple`>`tp`.`ID`)" . $sWhereClause . " 417 " . $sGroupClause . " 418 ORDER BY `tp`.`" . $aParams['view_order'] . "` " . $aParams['view_order_way'] . " 419 LIMIT " . $aParams['view_start'] . ", " . $aParams['view_per_page']; 420 420 $aProfiles = $GLOBALS['MySQL']->getAll($sQuery); 421 421 422 422 //--- Display ---// 423 423 $sFunction = 'getMembers' . ucfirst($aParams['view_type']); … … 426 426 427 427 function getMembersGeeky($aProfiles, $sPaginate) { 428 $iEmailLength = 20; 428 $iEmailLength = 20; 429 429 $aItems = array(); 430 430 foreach($aProfiles as $aProfile){ … … 439 439 'edit_class' => (int)$aProfile['banned'] == 1 ? 'adm-mp-banned' : ($aProfile['status'] != 'Active' ? 'adm-mp-inactive' : 'adm-mp-active'), 440 440 'registration' => $aProfile['registration'], 441 'last_login' => $aProfile['last_login'], 441 'last_login' => $aProfile['last_login'], 442 442 'status' => $aProfile['status'], 443 443 'ml_id' => !empty($aProfile['ml_id']) ? (int)$aProfile['ml_id'] : 2, … … 445 445 ); 446 446 } 447 447 448 448 return $GLOBALS['oAdmTemplate']->parseHtmlByName('mp_members_geeky.html', array( 449 449 'bx_repeat:items' => array_values($aItems), … … 462 462 'username' => $aProfile['username'] 463 463 ); 464 464 465 465 return $GLOBALS['oAdmTemplate']->parseHtmlByName('mp_members_simple.html', array( 466 466 'bx_repeat:items' => array_values($aItems), -
trunk/administration/settings.php
r15201 r15211 11 11 * This file is part of Dolphin - Smart Community Builder 12 12 * 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 13 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 14 14 * http://creativecommons.org/licenses/by/3.0/ 15 15 * 16 16 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 17 17 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * See the Creative Commons Attribution 3.0 License for more details. 19 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 20 20 * see license.txt file; if not, write to marketing@boonex.com 21 21 ***************************************************************************/ … … 32 32 $mixedCategory = 0; 33 33 if(bx_get('cat') !== false) 34 $mixedCategory = bx_get('cat');34 $mixedCategory = bx_get('cat'); 35 35 36 36 $oSettings = new BxDolAdminSettings($mixedCategory); … … 52 52 $_page_cont[$iNameIndex]['page_main_code'] = $oSettings->getForm(); 53 53 if (26 == $mixedCategory) { 54 define('BX_PROMO_CODE', adm_hosting_promo());54 define('BX_PROMO_CODE', adm_hosting_promo()); 55 55 } 56 56 -
trunk/administration/templates/base/_footer.html
r10490 r15211 1 <bx_injection:injection_footer />1 <bx_injection:injection_footer /> 2 2 </body> 3 3 </html> -
trunk/administration/templates/base/_header.html
r15201 r15211 3 3 <head> 4 4 <meta http-equiv="Content-Type" content="text/html; charset=__page_charset__" /> 5 <title>__page_header__</title> 5 <title>__page_header__</title> 6 6 7 7 <bx_include_css /> … … 15 15 var site_url = '<bx_url_root />'; 16 16 var glUserInfoDisabled = 'yes'; 17 </script> 17 </script> 18 18 __extra_js__ 19 19 -
trunk/administration/templates/base/_sub_header.html
r15201 r15211 4 4 5 5 <div id="bx-logo-container" class="bx-def-margin-top"> 6 <img src="<bx_image_url:logo.png />" /> 6 <img src="<bx_image_url:logo.png />" /> 7 7 </div> 8 8 … … 13 13 <div class="bx-def-margin-top"> 14 14 15 <table id="bx-admin-page-table">16 <tr>17 <td class="bx-adm-middle-menu">15 <table id="bx-admin-page-table"> 16 <tr> 17 <td class="bx-adm-middle-menu"> 18 18 __main_menu__ 19 19 __boonex_promo__ 20 </td>21 22 <td class="bx-adm-middle-main" id="main_cont">20 </td> 21 22 <td class="bx-adm-middle-main" id="main_cont"> 23 23 24 24 <div id="bx-adm-page-content-container" class="bx-def-padding-left"> 25 25 26 26 <div class="bx-def-padding-bottom"> 27 <h1 id="bx-adm-page-header">__page_header__</h1>28 </div>27 <h1 id="bx-adm-page-header">__page_header__</h1> 28 </div> 29 29 30 <div id="bx-adm-page-content">30 <div id="bx-adm-page-content"> -
trunk/administration/templates/base/antispam_dnsbl_recheck.html
r15201 r15211 11 11 var iId = m[1]; 12 12 var eStatus = this; 13 $(this).html('Checking...'); 13 $(this).html('Checking...'); 14 14 $.post('__admin_url__antispam.php', {action: '__action__', id: iId, 'test': sTest}, function (sRet) { 15 15 if ('LISTED' == sRet) { 16 $(eStatus).html('__txt_listed__'); 16 $(eStatus).html('__txt_listed__'); 17 17 } 18 18 else if ('NOT LISTED' == sRet) { … … 37 37 </tr> 38 38 </bx_repeat:items> 39 </table> 39 </table> 40 40 </div> -
trunk/administration/templates/base/antispam_manage_dnsbl.html
r15201 r15211 32 32 </tr> 33 33 </bx_repeat:items> 34 34 35 35 </table> 36 36 __controls__ -
trunk/administration/templates/base/boonex_promo.html
r15201 r15211 1 1 <div class="bx-adm-boonex-promo bx-def-padding bx-def-border bx-def-margin-top"> 2 <div>3 <a target="_blank" href="http://www.boonex.com/payment.php"><bx_text:_adm_txt_boonex_promo_title /></a>4 <bx_text:_adm_txt_boonex_promo_text />5 </div>2 <div> 3 <a target="_blank" href="http://www.boonex.com/payment.php"><bx_text:_adm_txt_boonex_promo_title /></a> 4 <bx_text:_adm_txt_boonex_promo_text /> 5 </div> 6 6 </div> -
trunk/administration/templates/base/categories.html
r15201 r15211 3 3 <div class="adm-category-items"> 4 4 <bx_repeat:items> 5 <div class="adm-category-item"> 6 <img src="__icon__" />7 <div class="adm-ci-link"><a href="__link__" __onclick__>__title__</a></div>8 <div class="adm-ci-description">__description__</div>5 <div class="adm-category-item"> 6 <img src="__icon__" /> 7 <div class="adm-ci-link"><a href="__link__" __onclick__>__title__</a></div> 8 <div class="adm-ci-description">__description__</div> 9 9 </div> 10 10 </bx_repeat:items> -
trunk/administration/templates/base/css/activityTrac.css
r15201 r15211 2 2 3 3 .alertUnit { 4 position: relative;5 width: 600px;6 margin: 5px 0px 5px 0px;4 position: relative; 5 width: 600px; 6 margin: 5px 0px 5px 0px; 7 7 } 8 8 .alertUnit div { 9 text-align: center;10 position: relative;11 float: left;9 text-align: center; 10 position: relative; 11 float: left; 12 12 } 13 13 .alertRcpt { 14 width: 60px;14 width: 60px; 15 15 } 16 16 .alertMessage { 17 width: 340px;17 width: 340px; 18 18 } 19 19 .alertDate { 20 width: 120px;20 width: 120px; 21 21 } -
trunk/administration/templates/base/css/admin.css
r15201 r15211 2 2 3 3 table#bx-admin-page-table { 4 border-collapse:collapse; 4 border-collapse:collapse; 5 5 } 6 6 … … 10 10 } 11 11 12 td.bx-adm-middle-menu { 13 width: 300px;14 15 border: 0px; 12 td.bx-adm-middle-menu { 13 width: 300px; 14 15 border: 0px; 16 16 } 17 17 … … 38 38 div.menu_categ_hover_header { 39 39 height: 44px; 40 padding-left: 44px;40 padding-left: 44px; 41 41 42 z-index: 5; 43 42 z-index: 5; 43 44 44 border:1px solid #ddd; 45 45 background-color:#fff; 46 46 47 line-height: 44px;48 font-size: 16px;49 font-weight: bold;47 line-height: 44px; 48 font-size: 16px; 49 font-weight: bold; 50 50 } 51 51 div.adm-mmh-hover { 52 border:1px solid #999;52 border:1px solid #999; 53 53 } 54 54 div.adm-mmh-active { 55 border:1px solid #ccc;55 border:1px solid #ccc; 56 56 } 57 57 div.adm-mmh-opened { 58 border:1px solid #ccc;58 border:1px solid #ccc; 59 59 } 60 60 61 61 img.adm-menu-icon { 62 62 top: -5px; 63 left: 7px;63 left: 7px; 64 64 65 position: absolute; 66 z-index: 10;65 position: absolute; 66 z-index: 10; 67 67 } 68 68 … … 72 72 width: 17px; 73 73 height: 17px; 74 75 position: absolute;76 z-index: 5; 77 78 background-image: url(../images/mm_item_arrow_bg.png);79 background-repeat: no-repeat;80 background-position: 0px 0px;81 82 cursor:pointer;74 75 position: absolute; 76 z-index: 5; 77 78 background-image: url(../images/mm_item_arrow_bg.png); 79 background-repeat: no-repeat; 80 background-position: 0px 0px; 81 82 cursor:pointer; 83 83 } 84 84 img.adm-mma-opened { … … 90 90 padding: 5px 0px; 91 91 92 border: 1px solid #ccc;93 border-top: none;92 border: 1px solid #ccc; 93 border-top: none; 94 94 background-color: #f6f6f6; 95 96 position: relative;97 z-index: 1;98 display: none;99 100 101 font-size: 13px; 102 color: black;95 96 position: relative; 97 z-index: 1; 98 display: none; 99 100 101 font-size: 13px; 102 color: black; 103 103 } 104 104 div.adm-mmi-opened { … … 108 108 div.adm-menu-item-wrapper { 109 109 height: 26px; 110 padding-left: 33px;111 112 position: relative;110 padding-left: 33px; 111 112 position: relative; 113 113 114 114 line-height: 26px; … … 117 117 img.adm-menu-item-icon { 118 118 top: 5px; 119 left: 9px;120 width: 16px;121 height: 16px;122 123 position: absolute; 124 z-index: 5;119 left: 9px; 120 width: 16px; 121 height: 16px; 122 123 position: absolute; 124 z-index: 5; 125 125 } 126 126 -
trunk/administration/templates/base/css/anchor.css
r15201 r15211 2 2 3 3 a, a:link { 4 color:#3333CC;5 font-family:Verdana,Arial;4 color:#3333CC; 5 font-family:Verdana,Arial; 6 6 } 7 7 a:visited { 8 color:#000099;8 color:#000099; 9 9 } 10 10 11 11 a:hover, a:active { 12 color:#3333CC;12 color:#3333CC; 13 13 } 14 14 15 15 a, a:link, a:visited, a:active { 16 text-decoration:none;16 text-decoration:none; 17 17 } 18 18 a:hover { 19 text-decoration:underline;19 text-decoration:underline; 20 20 } -
trunk/administration/templates/base/css/dashboard.css
r15201 r15211 9 9 10 10 position: relative; 11 float: left; 11 float: left; 12 12 } 13 13 div.adm-dashboard-item { … … 15 15 height: 73px; 16 16 margin-bottom: 10px; 17 17 18 18 position: relative; 19 19 … … 25 25 width: 73px; 26 26 height: 73px; 27 27 28 28 position: absolute; 29 29 30 30 background-repeat: no-repeat; 31 31 background-position: center; 32 32 } 33 div.adm-di-title, 33 div.adm-di-title, 34 34 div.adm-di-content { 35 35 margin: 0px 10px 0px 73px; -
trunk/administration/templates/base/css/fields.css
r15201 r15211 3 3 #main_container {} 4 4 #tabs_container { 5 position:relative;5 position:relative; 6 6 } 7 7 … … 10 10 #mode_switcher_2 ul, 11 11 #mode_switcher_3 ul { 12 margin: 0px;13 padding: 5px;14 15 list-style: none; 12 margin: 0px; 13 padding: 5px; 14 15 list-style: none; 16 16 } 17 17 … … 20 20 #mode_switcher_3 ul li { 21 21 margin:0px; 22 float:left;23 line-height: 14px;22 float:left; 23 line-height: 14px; 24 24 } 25 25 … … 27 27 #mode_switcher_2 ul li a , 28 28 #mode_switcher_3 ul li a { 29 cursor:default;30 padding:3px 7px 3px 18px;31 font-size:12px;32 display:block;33 background-position:3px 3px;34 background-repeat:no-repeat;35 background-image:url(../images/radio.gif);29 cursor:default; 30 padding:3px 7px 3px 18px; 31 font-size:12px; 32 display:block; 33 background-position:3px 3px; 34 background-repeat:no-repeat; 35 background-image:url(../images/radio.gif); 36 36 } 37 37 … … 51 51 #mode_switcher_3 ul li a:active, 52 52 #mode_switcher_3 ul li a:visited { 53 color:#000000;54 text-decoration:none;53 color:#000000; 54 text-decoration:none; 55 55 } 56 56 … … 59 59 #mode_switcher_3 ul li.ui-tabs-selected a 60 60 { 61 background-image:url(../images/radio_active.gif);61 background-image:url(../images/radio_active.gif); 62 62 } 63 63 … … 65 65 66 66 .build_container { 67 padding:15px;68 font-size:11px;67 padding:15px; 68 font-size:11px; 69 69 } 70 70 71 71 .build_zone_header { 72 font-weight:bold;72 font-weight:bold; 73 73 } 74 74 75 75 .blocks_cont_bord { 76 border:1px solid #cccccc;77 76 border:1px solid #cccccc; 77 78 78 } 79 79 80 80 .blocks_container { 81 background-color:#ffffff;82 padding:6px;81 background-color:#ffffff; 82 padding:6px; 83 83 } 84 84 … … 88 88 .build_block, 89 89 .build_block_inactive { 90 width:142px;91 float:left;92 margin-left:2px;93 margin-right:2px;94 /*position:relative;*/90 width:142px; 91 float:left; 92 margin-left:2px; 93 margin-right:2px; 94 /*position:relative;*/ 95 95 } 96 96 97 97 .build_block_header { 98 padding-top:7px;99 height:21px;100 background-image:url(../images/block_header.gif);101 text-align:center;102 color:#999999;103 cursor:move;104 margin-top:2px;105 margin-bottom:2px;106 107 background-repeat:no-repeat;98 padding-top:7px; 99 height:21px; 100 background-image:url(../images/block_header.gif); 101 text-align:center; 102 color:#999999; 103 cursor:move; 104 margin-top:2px; 105 margin-bottom:2px; 106 107 background-repeat:no-repeat; 108 108 } 109 109 110 110 .build_block_hover { 111 border: 1px dotted #999999;111 border: 1px dotted #999999; 112 112 } 113 113 … … 116 116 117 117 .build_item_active { 118 width:117px;119 height:21px;120 padding-left:25px;121 padding-top:7px;122 background-image:url(../images/block_item_bg.gif);123 color: #6666cc;124 margin-top:2px;125 margin-bottom:2px;126 cursor:move;118 width:117px; 119 height:21px; 120 padding-left:25px; 121 padding-top:7px; 122 background-image:url(../images/block_item_bg.gif); 123 color: #6666cc; 124 margin-top:2px; 125 margin-bottom:2px; 126 cursor:move; 127 127 } 128 128 129 129 .build_item_hover { 130 border: 1px dotted #999999;130 border: 1px dotted #999999; 131 131 } 132 132 … … 139 139 .build_item_fake, 140 140 .build_block_fake { 141 height:2px;142 font-size:1px;143 /*background-color:yellow;*/141 height:2px; 142 font-size:1px; 143 /*background-color:yellow;*/ 144 144 } 145 145 146 146 .build_inac_items_col { 147 width:142px;148 margin-left:2px;149 margin-right:2px;150 float:left;151 min-height:1px;152 position:relative;153 /*background-color:red;*/147 width:142px; 148 margin-left:2px; 149 margin-right:2px; 150 float:left; 151 min-height:1px; 152 position:relative; 153 /*background-color:red;*/ 154 154 } 155 155 156 156 .build_block_inactive_items { 157 width:744px;157 width:744px; 158 158 } 159 159 160 160 *html .build_block_inactive_items { 161 width:748px;161 width:748px; 162 162 } 163 163 … … 167 167 168 168 .ui-tabs-container { 169 clear:both;169 clear:both; 170 170 } 171 171 172 172 .ui-tabs-hide { 173 display:none;173 display:none; 174 174 } 175 175 … … 177 177 178 178 #fieldFormWrap { 179 background-image:url(../images/sp_op.png);180 position:absolute;181 z-index:100;179 background-image:url(../images/sp_op.png); 180 position:absolute; 181 z-index:100; 182 182 } 183 183 184 184 * html #fieldFormWrap 185 185 { 186 background-image:url( ../images/spacer.gif );187 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op.png', sizingMethod='scale');186 background-image:url( ../images/spacer.gif ); 187 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op.png', sizingMethod='scale'); 188 188 } 189 189 190 190 191 191 #edit_form_cont { 192 position:relative;192 position:relative; 193 193 z-index: 1000; 194 194 } 195 195 196 196 .notify_msg { 197 color:green;198 text-align:center;197 color:green; 198 text-align:center; 199 199 } 200 200 201 201 .error_msg { 202 color:red;203 text-align:center;202 color:red; 203 text-align:center; 204 204 } 205 205 … … 210 210 .popup_form_wrapper 211 211 { 212 border-collapse:collapse;213 margin:0px;214 padding:0px;215 width:482px;212 border-collapse:collapse; 213 margin:0px; 214 padding:0px; 215 width:482px; 216 216 } 217 217 218 218 .popup_form_wrapper td 219 219 { 220 padding:0px;221 margin:0px;220 padding:0px; 221 margin:0px; 222 222 } 223 223 224 224 .popup_form_wrapper td.corner 225 225 { 226 width:16px;227 height:16px;228 font-size:1px;226 width:16px; 227 height:16px; 228 font-size:1px; 229 229 } 230 230 231 231 .popup_form_wrapper td.side 232 232 { 233 width:16px;233 width:16px; 234 234 } 235 235 236 236 .popup_form_wrapper td.side_ver 237 237 { 238 height:16px;238 height:16px; 239 239 } 240 240 … … 242 242 .popup_form_wrapper td.side 243 243 { 244 background-image:url(../images/sp_op_gr.png);245 font-size:1px;244 background-image:url(../images/sp_op_gr.png); 245 font-size:1px; 246 246 } 247 247 … … 249 249 * html .popup_form_wrapper td.side 250 250 { 251 background-image:url( ../images/spacer.gif );252 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op_gr.png', sizingMethod='scale');251 background-image:url( ../images/spacer.gif ); 252 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op_gr.png', sizingMethod='scale'); 253 253 } 254 254 … … 256 256 .popup_form_wrapper td.container 257 257 { 258 background-color:white;259 width:450px;258 background-color:white; 259 width:450px; 260 260 } 261 261 262 262 .edit_item_table_cont 263 263 { 264 position:relative; 264 position:relative; 265 265 } 266 266 … … 269 269 270 270 .field_edit_tab { 271 border-collapse:collapse;272 width:100%;271 border-collapse:collapse; 272 width:100%; 273 273 } 274 274 275 275 .field_edit_tab td.label { 276 width:40%;277 text-align:right;278 font-weight:bold;279 padding:5px;280 vertical-align:center;276 width:40%; 277 text-align:right; 278 font-weight:bold; 279 padding:5px; 280 vertical-align:center; 281 281 } 282 282 283 283 .field_edit_tab td.warned { 284 background-color:#f20000;284 background-color:#f20000; 285 285 } 286 286 287 287 .field_edit_tab td.value { 288 width:40%;289 text-align:left;290 padding:5px;291 vertical-align:center;288 width:40%; 289 text-align:left; 290 padding:5px; 291 vertical-align:center; 292 292 } 293 293 294 294 .field_edit_tab td.info { 295 width:20%;296 text-align:left;297 padding:5px;298 vertical-align:center;295 width:20%; 296 text-align:left; 297 padding:5px; 298 vertical-align:center; 299 299 } 300 300 301 301 .field_edit_tab td.buttons { 302 text-align:center;302 text-align:center; 303 303 } 304 304 305 305 .field_edit_tab td.buttons input { 306 margin:5px;306 margin:5px; 307 307 } 308 308 … … 310 310 .field_edit_tab select.select_type, 311 311 .field_edit_tab textarea.input_text { 312 width:170px;313 border:1px solid #ccc;312 width:170px; 313 border:1px solid #ccc; 314 314 } 315 315 316 316 .field_edit_tab select.select_page { 317 border: 1px solid #ccc;318 width: 45px;317 border: 1px solid #ccc; 318 width: 45px; 319 319 } 320 320 321 321 input.input_checkbox { 322 /*border:1px solid #ccc;*/322 /*border:1px solid #ccc;*/ 323 323 } 324 324 325 325 .field_edit_tab select.select_multiple { 326 width:170px;327 height:75px;328 border:1px solid #ccc;326 width:170px; 327 height:75px; 328 border:1px solid #ccc; 329 329 } 330 330 331 331 .field_edit_tab textarea.input_text { 332 height:62px;333 font-family: Arial,Helvetica,sans-serif;334 font-size:12px;332 height:62px; 333 font-family: Arial,Helvetica,sans-serif; 334 font-size:12px; 335 335 } 336 336 337 337 img.info_icon, 338 338 img.depr_icon { 339 width: 16px;340 height:16px;341 cursor:help;342 margin:2px;339 width: 16px; 340 height:16px; 341 cursor:help; 342 margin:2px; 343 343 } 344 344 … … 346 346 347 347 ul#form_tabs_switcher { 348 margin:0px;349 margin-bottom:3px;350 padding:0px;351 border-bottom:1px solid #ccc;352 list-style:none;353 height:25px;348 margin:0px; 349 margin-bottom:3px; 350 padding:0px; 351 border-bottom:1px solid #ccc; 352 list-style:none; 353 height:25px; 354 354 } 355 355 356 356 ul#form_tabs_switcher li { 357 float:left;358 padding:5px;357 float:left; 358 padding:5px; 359 359 } 360 360 361 361 ul#form_tabs_switcher li.ui-tabs-selected { 362 background-color:#ccc;363 364 } 362 background-color:#ccc; 363 364 } -
trunk/administration/templates/base/css/general.css
r15201 r15211 8 8 } 9 9 div#FloatDesc { 10 position:absolute;11 display:none;12 z-index:10000;13 background-color:#ffffe0;14 border:1px solid #000000;15 padding:3px;16 width:180px;10 position:absolute; 11 display:none; 12 z-index:10000; 13 background-color:#ffffe0; 14 border:1px solid #000000; 15 padding:3px; 16 width:180px; 17 17 } 18 18 19 19 form, p { 20 margin:0px;21 padding:0px;20 margin:0px; 21 padding:0px; 22 22 } 23 23 24 24 a img { 25 border:none;25 border:none; 26 26 } 27 27 28 28 .err { 29 color: #FF0000;29 color: #FF0000; 30 30 } 31 31 32 32 /*--- Top Header ---*/ 33 33 div.adm-header { 34 height: 87px; 35 36 position: relative; 34 height: 87px; 35 36 position: relative; 37 37 38 38 border-bottom: 1px solid #c8c8c8; 39 background-image: url(../images/header_bg.png);40 background-repeat: repeat-x;41 background-position: 0px 0px; 39 background-image: url(../images/header_bg.png); 40 background-repeat: repeat-x; 41 background-position: 0px 0px; 42 42 } 43 43 div.adm-header-content { … … 46 46 } 47 47 48 img.adm-header-logo { 49 top: 0px;50 left: 0px;51 width: 105px;52 height: 116px;53 54 position:absolute;48 img.adm-header-logo { 49 top: 0px; 50 left: 0px; 51 width: 105px; 52 height: 116px; 53 54 position:absolute; 55 55 } 56 56 div.adm-header-title { … … 59 59 position: relative; 60 60 float: left; 61 62 line-height: 87px; 61 62 line-height: 87px; 63 63 font-family: Copperplate Gothic Bold; 64 font-size: 48px;65 font-weight: bold;66 color: #333333;64 font-size: 48px; 65 font-weight: bold; 66 color: #333333; 67 67 } 68 68 div.adm-header-verion { … … 72 72 height: 10px; 73 73 position: absolute; 74 74 75 75 line-height: 9px; 76 76 font-family: Verdana; … … 100 100 margin: 0px; 101 101 padding: 0px; 102 102 103 103 display: block; 104 104 … … 129 129 table.adm-middle { 130 130 width: 900px; 131 margin: 0px auto;132 padding: 0px;133 134 border: 0px;131 margin: 0px auto; 132 padding: 0px; 133 134 border: 0px; 135 135 } 136 136 td.adm-middle-menu { 137 width: 214px;138 padding: 0px;139 margin: 0px;140 141 border: 0px;142 143 vertical-align: top;137 width: 214px; 138 padding: 0px; 139 margin: 0px; 140 141 border: 0px; 142 143 vertical-align: top; 144 144 } 145 145 td.adm-middle-main { 146 146 padding: 0px; 147 margin: 0px;148 149 background-repeat: no-repeat;150 background-position: 470px 0px;151 vertical-align: top;147 margin: 0px; 148 149 background-repeat: no-repeat; 150 background-position: 470px 0px; 151 vertical-align: top; 152 152 } 153 153 154 154 div.adm-page-header { 155 155 margin: 0px 0px 20px 34px; 156 157 font-weight: bold;158 font-size: 30px;156 157 font-weight: bold; 158 font-size: 30px; 159 159 } 160 160 div.adm-page-content { 161 margin: 0px 0px 0px 34px;161 margin: 0px 0px 0px 34px; 162 162 } 163 163 … … 165 165 /*--- Footer Part ---*/ 166 166 div.adm-footer { 167 position:relative;168 height: 73px; 169 170 background-color: #6e6e6e;171 background-repeat: repeat-x;172 background-image: url(../images/bottom_bord.gif);173 174 font-size: 14px;175 line-height: 20px;176 color: #ffffff;167 position:relative; 168 height: 73px; 169 170 background-color: #6e6e6e; 171 background-repeat: repeat-x; 172 background-image: url(../images/bottom_bord.gif); 173 174 font-size: 14px; 175 line-height: 20px; 176 color: #ffffff; 177 177 } 178 178 .adm-footer-logo { 179 position:absolute; 180 top:20px; 181 right:20px;179 position:absolute; 180 top:20px; 181 right:20px; 182 182 } 183 183 div.adm-footer-content { … … 190 190 div.adm-footer a:hover, 191 191 div.adm-footer a:active { 192 color:#ffffff;192 color:#ffffff; 193 193 } 194 194 … … 196 196 /*--- DesignBox ---*/ 197 197 div.adm-design-box { 198 margin-bottom: 10px;199 200 border: 1px solid #CCC;201 background-image: url(../images/head_bg.gif);202 background-repeat: repeat-x;203 background-color: #fff;198 margin-bottom: 10px; 199 200 border: 1px solid #CCC; 201 background-image: url(../images/head_bg.gif); 202 background-repeat: repeat-x; 203 background-color: #fff; 204 204 } 205 205 div.adm-db-head { 206 height: 28px; 207 position: relative;208 border-bottom: 1px solid #ccc;209 210 line-height: 28px;211 text-indent: 10px;212 text-align: left;213 text-transform: capitalize;214 215 font-size: 12px; 216 font-weight: bold;217 font-family: Verdana,Arial;218 color: #333; 206 height: 28px; 207 position: relative; 208 border-bottom: 1px solid #ccc; 209 210 line-height: 28px; 211 text-indent: 10px; 212 text-align: left; 213 text-transform: capitalize; 214 215 font-size: 12px; 216 font-weight: bold; 217 font-family: Verdana,Arial; 218 color: #333; 219 219 } 220 220 div.adm-db-content { 221 padding: 1px;222 font-size: 11px;221 padding: 1px; 222 font-size: 11px; 223 223 } 224 224 div.adm-db-control-panel { 225 225 height: 30px; 226 226 227 227 background-color: #ededed; 228 228 229 229 line-height: 30px; 230 230 font-size: 11px; 231 231 } 232 232 div.adm-db-content-wrapper { 233 padding: 9px;234 position: relative;233 padding: 9px; 234 position: relative; 235 235 } 236 236 div.adm-design-box div.adm-db-head .dbTopMenu { 237 237 top: 0px; 238 right: 1px;239 240 position: absolute;241 242 text-transform: capitalize;243 text-indent: 0px;244 white-space: nowrap;245 246 font-size: 11px;247 font-weight: bold;248 color: #333;249 } 250 .dbTopMenu div.active, 238 right: 1px; 239 240 position: absolute; 241 242 text-transform: capitalize; 243 text-indent: 0px; 244 white-space: nowrap; 245 246 font-size: 11px; 247 font-weight: bold; 248 color: #333; 249 } 250 .dbTopMenu div.active, 251 251 .dbTopMenu div.notActive { 252 float: left;253 padding: 0px 5px;254 border-left: 0px solid #ccc;255 height: 28px;256 line-height: 28px;257 position: relative;258 font-weight: normal;252 float: left; 253 padding: 0px 5px; 254 border-left: 0px solid #ccc; 255 height: 28px; 256 line-height: 28px; 257 position: relative; 258 font-weight: normal; 259 259 } 260 260 .dbTopMenu div a, … … 263 263 .dbTopMenu div a:active, 264 264 .dbTopMenu div a:visited { 265 color: #666;266 font-family:Verdana,Arial;267 font-size:11px;265 color: #666; 266 font-family:Verdana,Arial; 267 font-size:11px; 268 268 } 269 269 .dbTopMenu div.active { 270 background:transparent url(../images/head_ti_left.gif) no-repeat scroll 0%;271 cursor:pointer;272 display:block;273 float:left;274 height:28px;275 line-height:28px;276 padding:0pt 0pt 0pt 5px;270 background:transparent url(../images/head_ti_left.gif) no-repeat scroll 0%; 271 cursor:pointer; 272 display:block; 273 float:left; 274 height:28px; 275 line-height:28px; 276 padding:0pt 0pt 0pt 5px; 277 277 } 278 278 .dbTopMenu .active span { 279 background:transparent url(../images/head_ti_right.gif) repeat-y scroll right top;280 display:block;281 float:left;282 height:28px;283 padding:0pt 5px 0pt 0px;279 background:transparent url(../images/head_ti_right.gif) repeat-y scroll right top; 280 display:block; 281 float:left; 282 height:28px; 283 padding:0pt 5px 0pt 0px; 284 284 } 285 285 div.adm-db-head div.notActiveIcon { 286 background-position: 0px 5px;287 background-repeat: no-repeat;288 padding-left: 18px;286 background-position: 0px 5px; 287 background-repeat: no-repeat; 288 padding-left: 18px; 289 289 } 290 290 div.adm-design-box div.adm-db-close { … … 303 303 304 304 /* top settings */ 305 div.top_settings_block 305 div.top_settings_block 306 306 { 307 background-color:#EDEDED;308 height:30px;309 width:100%;310 color:#666666;311 } 312 313 div.top_settings_block div.ordered_block 307 background-color:#EDEDED; 308 height:30px; 309 width:100%; 310 color:#666666; 311 } 312 313 div.top_settings_block div.ordered_block 314 314 { 315 padding-top:5px;316 padding-left:9px;317 float:left;318 } 319 320 div.top_settings_block div.per_page_block 315 padding-top:5px; 316 padding-left:9px; 317 float:left; 318 } 319 320 div.top_settings_block div.per_page_block 321 321 { 322 padding-top:5px;323 float:right;324 padding-right:9px;322 padding-top:5px; 323 float:right; 324 padding-right:9px; 325 325 } 326 326 … … 336 336 } 337 337 338 .sys-adm-enabled { 338 .sys-adm-enabled { 339 339 color:#fff; 340 340 background-color:#0b0; 341 341 } 342 342 343 .sys-adm-disabled { 343 .sys-adm-disabled { 344 344 color:#fff; 345 345 background-color:#d00; -
trunk/administration/templates/base/css/index.css
r15201 r15211 6 6 } 7 7 div.adm-category-item { 8 position: relative; 9 margin-bottom: 10px;8 position: relative; 9 margin-bottom: 10px; 10 10 } 11 11 div.adm-category-item img { 12 12 top: 3px; 13 left: 7px;14 position: absolute; 13 left: 7px; 14 position: absolute; 15 15 } 16 16 div.adm-ci-link { 17 margin-left: 35px;18 19 line-height: 20px;20 font-size: 18px;21 font-weight: bold; 17 margin-left: 35px; 18 19 line-height: 20px; 20 font-size: 18px; 21 font-weight: bold; 22 22 } 23 23 div.adm-ci-description { 24 margin-left: 35px;24 margin-left: 35px; 25 25 26 font-size: 13px;26 font-size: 13px; 27 27 } 28 28 … … 41 41 } 42 42 div.adm-news-item { 43 padding-bottom: 8px;43 padding-bottom: 8px; 44 44 } 45 45 /*div.adm-ni-title { 46 font-size: 12px;46 font-size: 12px; 47 47 font-weight:bold; 48 color: #3333cc;48 color: #3333cc; 49 49 }*/ 50 50 div.adm-ni-title a, … … 65 65 } 66 66 span.adm-ni-date { 67 color: #999999;67 color: #999999; 68 68 display:block; 69 69 font-size:9px; -
trunk/administration/templates/base/css/lang_file.css
r15201 r15211 25 25 div.adm-lk-chb-apply { 26 26 position: relative; 27 float: left; 27 float: left; 28 28 } 29 29 div.adm-lk-btn-new { … … 34 34 div.adm-lk-keys { 35 35 margin: 10px; 36 padding: 0px; 36 padding: 0px; 37 37 } 38 38 div.adm-lk-key { … … 44 44 div#adm-langs-add-key, 45 45 div#adm-langs-edit-key { 46 width: 562px; 46 width: 562px; 47 47 } 48 48 div#adm-langs-add-key table.popup_form_wrapper, … … 72 72 width: 480px; 73 73 height: 295px; 74 position: relative;74 position: relative; 75 75 76 76 overflow-y: scroll; 77 overflow-x: hidden;77 overflow-x: hidden; 78 78 } 79 79 div#adm-langs-add-key-content table.form_advanced_table, … … 81 81 div#adm-langs-add-key-content table.form_advanced_table tr, 82 82 div#adm-langs-edit-key-content table.form_advanced_table tr { 83 width: 478px;84 overflow: hidden;83 width: 478px; 84 overflow: hidden; 85 85 } 86 86 -
trunk/administration/templates/base/css/login.css
r15201 r15211 7 7 8 8 a img { 9 border: none;9 border: none; 10 10 } 11 11 … … 16 16 17 17 .admin_login_wrapper { 18 background-image: url(../images/admin_login_bg.png);19 background-repeat: no-repeat;20 width: 680px;21 height: 400px;22 18 background-image: url(../images/admin_login_bg.png); 19 background-repeat: no-repeat; 20 width: 680px; 21 height: 400px; 22 23 23 position:absolute; 24 24 top:50%; … … 26 26 margin-left:-340px; 27 27 margin-top:-146px; 28 29 overflow: hidden;30 31 color: #333333;28 29 overflow: hidden; 30 31 color: #333333; 32 32 } 33 33 … … 36 36 .admin_login_wrapper a:visited 37 37 { 38 color: #3333cc;39 text-decoration: none;38 color: #3333cc; 39 text-decoration: none; 40 40 } 41 41 … … 43 43 .admin_login_wrapper a:active 44 44 { 45 text-decoration: underline;45 text-decoration: underline; 46 46 } 47 47 48 48 .admin_login_icon { 49 width: 159px;50 height: 200px;51 float: right;52 margin-right: 45px;53 margin-top: 40px;54 position: relative;49 width: 159px; 50 height: 200px; 51 float: right; 52 margin-right: 45px; 53 margin-top: 40px; 54 position: relative; 55 55 } 56 56 57 57 .admin_login_form_wrapper { 58 margin-top: 50px;59 margin-left: 35px;58 margin-top: 50px; 59 margin-left: 35px; 60 60 } 61 61 62 62 .admin_license_form_wrapper { 63 margin-left: 15px;64 margin-top: 25px;63 margin-left: 15px; 64 margin-top: 25px; 65 65 } 66 66 67 67 .admin_login_table td { 68 vertical-align: middle;68 vertical-align: middle; 69 69 } 70 70 71 71 .admin_login_table td.value { 72 text-align: right;72 text-align: right; 73 73 } 74 74 … … 77 77 #admin_login_license 78 78 { 79 border: none;80 background-image: url(../images/admin_login_input.png);81 background-repeat: no-repeat;82 width: 251px;83 height: 23px;84 background-color: transparent;85 vertical-align: middle;86 padding: 10px;79 border: none; 80 background-image: url(../images/admin_login_input.png); 81 background-repeat: no-repeat; 82 width: 251px; 83 height: 23px; 84 background-color: transparent; 85 vertical-align: middle; 86 padding: 10px; 87 87 } 88 88 89 89 #admin_login_license { 90 background-image: url(../images/admin_login_input_long.png);91 width: 484px;90 background-image: url(../images/admin_login_input_long.png); 91 width: 484px; 92 92 } 93 93 94 94 #admin_login_remember { 95 width: 21px;96 height: 21px;97 vertical-align: middle;95 width: 21px; 96 height: 21px; 97 vertical-align: middle; 98 98 } 99 99 100 100 .remember_me_row label 101 101 { 102 vertical-align: middle;102 vertical-align: middle; 103 103 } 104 104 105 105 #admin_login_form_submit { 106 width: 97px;107 height: 31px;108 color: #666666;109 background-repeat: no-repeat;110 background-image: url(../images/admin_login_button.png);111 background-color: transparent;112 border: none;113 background-position: left top;114 overflow: visible;106 width: 97px; 107 height: 31px; 108 color: #666666; 109 background-repeat: no-repeat; 110 background-image: url(../images/admin_login_button.png); 111 background-color: transparent; 112 border: none; 113 background-position: left top; 114 overflow: visible; 115 115 } 116 116 117 117 #admin_login_form_submit:hover { 118 background-position: left -33px;118 background-position: left -33px; 119 119 } 120 120 121 121 #admin_login_form_submit:focus { 122 background-position: left -66px;122 background-position: left -66px; 123 123 } 124 124 125 125 126 126 .admin_login_footers { 127 position: fixed;128 bottom: 0px;129 left: 0px;130 width: 100%;131 height: 54px;127 position: fixed; 128 bottom: 0px; 129 left: 0px; 130 width: 100%; 131 height: 54px; 132 132 } 133 133 134 134 .admin_login_footers .left_banner { 135 float: left;136 position: relative;137 margin-left: 30px;135 float: left; 136 position: relative; 137 margin-left: 30px; 138 138 } 139 139 140 140 .admin_login_footers .right_banner { 141 float: right;142 position: relative;143 margin-right: 30px;141 float: right; 142 position: relative; 143 margin-right: 30px; 144 144 } -
trunk/administration/templates/base/css/memb_levels.css
r15201 r15211 35 35 /*--- 'Manage Action' section ---*/ 36 36 div.calendar { 37 z-index: 9999;37 z-index: 9999; 38 38 } 39 39 div#adm-mlevels-action{ 40 width: 562px; 40 width: 562px; 41 41 } 42 42 div#adm-mlevels-action table.popup_form_wrapper, … … 58 58 } 59 59 div.ui-datepicker { 60 z-index: 9999;60 z-index: 9999; 61 61 } -
trunk/administration/templates/base/css/menu_compose.css
r15201 r15211 12 12 /*position: relative;*/ 13 13 14 cursor:default; 14 cursor:default; 15 15 } 16 16 … … 21 21 .inactive_item 22 22 { 23 position:absolute;24 width:92px;25 height:21px;26 color: #6666CC;27 font-size:11px;23 position:absolute; 24 width:92px; 25 height:21px; 26 color: #6666CC; 27 font-size:11px; 28 28 } 29 29 30 30 #mov_indic 31 31 { 32 padding-left:23px;33 padding-top:5px;34 border: 1px dashed #999;32 padding-left:23px; 33 padding-top:5px; 34 border: 1px dashed #999; 35 35 } 36 36 … … 40 40 .inactive_item 41 41 { 42 cursor:move;43 padding: 7px 5px 0px 20px; 44 overflow:hidden;45 white-space:nowrap;42 cursor:move; 43 padding: 7px 5px 0px 20px; 44 overflow:hidden; 45 white-space:nowrap; 46 46 } 47 47 48 48 .top_item 49 49 { 50 background-image:url( ../images/top_item_bg.gif );50 background-image:url( ../images/top_item_bg.gif ); 51 51 } 52 52 53 53 .custom_item 54 54 { 55 background-image:url( ../images/custom_item_bg.gif );55 background-image:url( ../images/custom_item_bg.gif ); 56 56 } 57 57 58 58 .inactive_item 59 59 { 60 background-image:url( ../images/inact_item_bg.gif );61 } 62 .system_item 63 { 64 background-image:url( ../images/system_item_bg.gif );60 background-image:url( ../images/inact_item_bg.gif ); 61 } 62 .system_item 63 { 64 background-image:url( ../images/system_item_bg.gif ); 65 65 } 66 66 … … 87 87 { 88 88 display: block; 89 color: #6666CC;90 text-decoration:none;91 overflow: hidden;92 } 93 94 .pseudo_wrapper { 95 position: relative; 89 color: #6666CC; 90 text-decoration:none; 91 overflow: hidden; 92 } 93 94 .pseudo_wrapper { 95 position: relative; 96 96 } 97 97 98 98 .pseudo_head { 99 font-weight:bold; 99 font-weight:bold; 100 100 } 101 101 … … 103 103 #pseudo2, 104 104 .legend { 105 border: 1px solid #cccccc105 border: 1px solid #cccccc 106 106 } 107 107 108 108 #edit_form_wrapper 109 109 { 110 position:absolute;111 z-index:15000;112 background-image:url( ../images/sp_op.png );110 position:absolute; 111 z-index:15000; 112 background-image:url( ../images/sp_op.png ); 113 113 } 114 114 115 115 * html #edit_form_wrapper 116 116 { 117 background-image:url( ../images/spacer.gif );118 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op.png', sizingMethod='scale');117 background-image:url( ../images/spacer.gif ); 118 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op.png', sizingMethod='scale'); 119 119 } 120 120 … … 125 125 .popup_form_wrapper 126 126 { 127 border-collapse:collapse;128 margin:0px;129 padding:0px;130 width:482px;127 border-collapse:collapse; 128 margin:0px; 129 padding:0px; 130 width:482px; 131 131 } 132 132 133 133 .popup_form_wrapper td 134 134 { 135 padding:0px;136 margin:0px;135 padding:0px; 136 margin:0px; 137 137 } 138 138 139 139 .popup_form_wrapper td.corner 140 140 { 141 width:16px;142 height:16px;141 width:16px; 142 height:16px; 143 143 } 144 144 145 145 .popup_form_wrapper td.side 146 146 { 147 width:16px;147 width:16px; 148 148 } 149 149 150 150 .popup_form_wrapper td.side_ver 151 151 { 152 height:16px;152 height:16px; 153 153 } 154 154 … … 156 156 .popup_form_wrapper td.side 157 157 { 158 background-image:url(../images/sp_op_gr.png);159 font-size:1px;158 background-image:url(../images/sp_op_gr.png); 159 font-size:1px; 160 160 } 161 161 … … 163 163 * html .popup_form_wrapper td.side 164 164 { 165 background-image:url( ../images/spacer.gif );166 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op_gr.png', sizingMethod='scale');165 background-image:url( ../images/spacer.gif ); 166 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/sp_op_gr.png', sizingMethod='scale'); 167 167 } 168 168 … … 170 170 .popup_form_wrapper td.container 171 171 { 172 background-color:white;173 width:450px;172 background-color:white; 173 width:450px; 174 174 } 175 175 … … 177 177 { 178 178 179 border:1px solid #666666;180 padding-top:25px;181 padding-bottom:25px;179 border:1px solid #666666; 180 padding-top:25px; 181 padding-bottom:25px; 182 182 } 183 183 184 184 .edit_item_table 185 185 { 186 border-collapse:collapse;187 margin-left: auto;188 margin-right: auto;186 border-collapse:collapse; 187 margin-left: auto; 188 margin-right: auto; 189 189 } 190 190 191 191 .edit_item_table td 192 192 { 193 padding:3px;193 padding:3px; 194 194 } 195 195 196 196 .form_label 197 197 { 198 width:125px;199 font-weight:bold;200 font-size:13px;201 text-align:right;198 width:125px; 199 font-weight:bold; 200 font-size:13px; 201 text-align:right; 202 202 } 203 203 204 204 .form_input_text 205 205 { 206 width:250px;206 width:250px; 207 207 } 208 208 209 209 .form_input_area 210 210 { 211 width:250px;212 height:125px;211 width:250px; 212 height:125px; 213 213 } 214 214 215 215 .form_colspan 216 216 { 217 text-align:center;217 text-align:center; 218 218 } 219 219 220 220 .form_colspan input 221 221 { 222 margin-left:15px;222 margin-left:15px; 223 223 } 224 224 … … 226 226 .loading 227 227 { 228 text-align:center;229 } 228 text-align:center; 229 } -
trunk/administration/templates/base/css/modules.css
r15201 r15211 24 24 div.modules-plank { 25 25 margin: 5px 0px; 26 padding: 5px;27 28 position: relative;29 30 border: 1px solid #cccccc;31 background-color: #eeeeee; 26 padding: 5px; 27 28 position: relative; 29 30 border: 1px solid #cccccc; 31 background-color: #eeeeee; 32 32 } 33 33 span.modules-plank-title {} 34 div.modules-plank-switch { 35 top: 5px;36 right: 6px;37 width: 13px;38 height: 13px;34 div.modules-plank-switch { 35 top: 5px; 36 right: 6px; 37 width: 13px; 38 height: 13px; 39 39 40 position: absolute;40 position: absolute; 41 41 42 background-image:url(../images/modules_toggle.png);43 background-repeat: no-repeat;44 background-position: 0px 0px;42 background-image:url(../images/modules_toggle.png); 43 background-repeat: no-repeat; 44 background-position: 0px 0px; 45 45 46 font-size: 11px;47 font-weight: bold;48 cursor: pointer;46 font-size: 11px; 47 font-weight: bold; 48 cursor: pointer; 49 49 } 50 50 div.modules-plank-switch-opened { … … 52 52 } 53 53 div.modules-plank-content { 54 display: none;54 display: none; 55 55 } 56 56 span.modules-plank-success { -
trunk/administration/templates/base/css/pageBuilder.css
r15201 r15211 2 2 3 3 .block_cont { 4 background-color: #ffffff;5 background-image: none;6 width: auto;4 background-color: #ffffff; 5 background-image: none; 6 width: auto; 7 7 padding: 5px; 8 border: 1px solid #cccccc;8 border: 1px solid #cccccc; 9 9 } 10 10 div.block_head { … … 13 13 div.block_cont, 14 14 div.block_cont_nd { 15 margin-bottom: 10px;15 margin-bottom: 10px; 16 16 margin-top: 5px; 17 17 } 18 18 19 19 .block_cont#activeAreaWrapper { 20 margin-bottom: 0px;21 border-bottom: none;20 margin-bottom: 0px; 21 border-bottom: none; 22 22 } 23 23 24 24 .block_cont#activeAreaWrapper .buildArea { 25 border-bottom: none;25 border-bottom: none; 26 26 } 27 27 28 28 /*--- Builder styles ---*/ 29 29 #buildZoneWrapper { 30 width: 782px;30 width: 782px; 31 31 } 32 32 33 33 34 34 #buildAreasWrapper { 35 margin: 15px;36 position:relative;35 margin: 15px; 36 position:relative; 37 37 } 38 38 39 39 #pageWidthValue, 40 40 #pageWidthValue1 { 41 height: 16px;42 43 position: relative;44 float: left;45 46 font-size: 12px;47 line-height: 16px;41 height: 16px; 42 43 position: relative; 44 float: left; 45 46 font-size: 12px; 47 line-height: 16px; 48 48 } 49 49 50 50 #pageWidthSlider, 51 51 #pageWidthSlider1 { 52 float: right;53 position: relative;54 width: 700px;55 height: 16px;56 background-image: url(../images/width_slider.png);52 float: right; 53 position: relative; 54 width: 700px; 55 height: 16px; 56 background-image: url(../images/width_slider.png); 57 57 } 58 58 … … 61 61 #pageWidthSlider1 a.ui-slider-handle { 62 62 top: -2px; 63 width: 12px;64 height: 20px;63 width: 12px; 64 height: 20px; 65 65 border: none; 66 66 background-image: url(../images/slider-handle1.gif); … … 68 68 69 69 .buildArea { 70 /*padding: 8px;*/70 /*padding: 8px;*/ 71 71 } 72 72 … … 75 75 76 76 .buildColumn { 77 float:left;78 /*position: relative;*/77 float:left; 78 /*position: relative;*/ 79 79 } 80 80 81 81 .buildColumnCont { 82 border: 1px solid #ccc;83 background-color: #fff;84 padding: 3px;85 margin: 5px;86 text-align: center;87 overflow: hidden;82 border: 1px solid #ccc; 83 background-color: #fff; 84 padding: 3px; 85 margin: 5px; 86 text-align: center; 87 overflow: hidden; 88 88 } 89 89 90 90 .buildColumnHeader { 91 background-color: #ccc;92 padding: 3px;93 font-size: 13px;94 margin-bottom: 5px;95 cursor: move;96 white-space: nowrap;97 overflow: hidden;98 position: relative;91 background-color: #ccc; 92 padding: 3px; 93 font-size: 13px; 94 margin-bottom: 5px; 95 cursor: move; 96 white-space: nowrap; 97 overflow: hidden; 98 position: relative; 99 99 } 100 100 101 101 .buildColumnHeader a { 102 cursor: pointer; /*for macs*/102 cursor: pointer; /*for macs*/ 103 103 } 104 104 105 105 .buildBlock { 106 margin: 0px auto 2px auto;107 width: 142px;108 height: 22px;109 text-align: center;110 cursor: move;111 padding-top: 6px;112 background-repeat: no-repeat;113 background-image: url( ../images/block_header.gif );114 text-transform: capitalize;115 font-size: 11px; 106 margin: 0px auto 2px auto; 107 width: 142px; 108 height: 22px; 109 text-align: center; 110 cursor: move; 111 padding-top: 6px; 112 background-repeat: no-repeat; 113 background-image: url( ../images/block_header.gif ); 114 text-transform: capitalize; 115 font-size: 11px; 116 116 } 117 117 … … 123 123 124 124 .buildBlock a { 125 cursor: pointer; /*for macs*/125 cursor: pointer; /*for macs*/ 126 126 } 127 127 128 128 .buildBlock .blockAlert { 129 cursor:help;130 height:16px;131 width:16px;132 vertical-align: middle;133 margin-left: 3px;129 cursor:help; 130 height:16px; 131 width:16px; 132 vertical-align: middle; 133 margin-left: 3px; 134 134 } 135 135 136 136 #samplesBlocksArea .buildBlock, 137 137 #inactiveBlocksArea .buildBlock { 138 margin: 2px;139 float: left;138 margin: 2px; 139 float: left; 140 140 } 141 141 142 142 .buildHover { 143 /*background-color: #f5f5f5;*/144 border: 1px dashed #999999;143 /*background-color: #f5f5f5;*/ 144 border: 1px dashed #999999; 145 145 float: left; 146 146 } 147 147 148 148 .buildBlockFake { 149 height: 5px;150 font-size: 1px;149 height: 5px; 150 font-size: 1px; 151 151 } 152 152 153 153 #columnsSlider { 154 height: 14px;155 position: relative;156 background-image: url(../images/col_slider_bg.gif);157 border-left: 1px solid #808080;158 border-right: 1px solid #808080;159 border-bottom: 1px solid #808080;160 margin-bottom: 10px;154 height: 14px; 155 position: relative; 156 background-image: url(../images/col_slider_bg.gif); 157 border-left: 1px solid #808080; 158 border-right: 1px solid #808080; 159 border-bottom: 1px solid #808080; 160 margin-bottom: 10px; 161 161 } 162 162 163 163 #columnsSlider a { 164 top: -5px;165 width: 12px;166 height: 23px;164 top: -5px; 165 width: 12px; 166 height: 23px; 167 167 border: none; 168 background-image: url(../images/slider-handle.gif);168 background-image: url(../images/slider-handle.gif); 169 169 } 170 170 171 171 #pageControls { 172 position: absolute;173 top: -10px;174 right: 0px;175 font-size: 13px;176 font-weight: bold;172 position: absolute; 173 top: -10px; 174 right: 0px; 175 font-size: 13px; 176 font-weight: bold; 177 177 } 178 178 179 179 #pageControls a { 180 margin-left: 6px;180 margin-left: 6px; 181 181 } 182 182 … … 184 184 #pageControls a:link, 185 185 #pageControls a:visited { 186 text-decoration: none;186 text-decoration: none; 187 187 } 188 188 189 189 #pageControls a:hover, 190 190 #pageControls a:active { 191 text-decoration: underline;191 text-decoration: underline; 192 192 } 193 193 194 194 #linkDelete { 195 display: block;196 position: absolute;197 right: 3px;198 top: 3px;199 display: block;200 text-decoration: none;195 display: block; 196 position: absolute; 197 right: 3px; 198 top: 3px; 199 display: block; 200 text-decoration: none; 201 201 } 202 202 … … 205 205 #linkDelete:active, 206 206 #linkDelete:hover { 207 text-decoration: none;207 text-decoration: none; 208 208 } 209 209 … … 214 214 position: relative; 215 215 float: left; 216 216 217 217 line-height: 30px; 218 218 } 219 219 div.adm-pb-cp-item-right { 220 margin: 2px 10px 0px 0px; 221 220 margin: 2px 10px 0px 0px; 221 222 222 float: right; 223 223 224 line-height: normal; 224 line-height: normal; 225 225 } 226 226 227 227 /*--- Edit Form styles ---*/ 228 #editFormCont { 229 width:482px;230 } 231 232 228 #editFormCont { 229 width:482px; 230 } 231 232 -
trunk/administration/templates/base/css/predefined_values.css
r15201 r15211 2 2 3 3 #listEdit { 4 border-top:1px solid #999999;5 border-left:1px solid #999999;4 border-top:1px solid #999999; 5 border-left:1px solid #999999; 6 6 } 7 7 8 8 #listEdit tr { 9 margin:0px;10 padding:0px;9 margin:0px; 10 padding:0px; 11 11 } 12 12 13 13 #listEdit td, 14 14 #listEdit th { 15 padding:2px;16 vertical-align:middle;17 border-right:1px solid #999999;18 border-bottom:1px solid #999999;15 padding:2px; 16 vertical-align:middle; 17 border-right:1px solid #999999; 18 border-bottom:1px solid #999999; 19 19 } 20 20 21 21 #listEdit th { 22 22 padding:2px; 23 text-align:center;24 font-weight:bold;25 background-color:#eeeeee;23 text-align:center; 24 font-weight:bold; 25 background-color:#eeeeee; 26 26 } 27 27 28 28 #listEdit tr.even { 29 background-color:#ffffff;29 background-color:#ffffff; 30 30 } 31 31 32 32 #listEdit tr.odd { 33 background-color:#dddddd;33 background-color:#dddddd; 34 34 } 35 35 36 36 #listEdit td .value_input { 37 width:70px;37 width:70px; 38 38 } 39 39 40 40 .tableLabel { 41 border-bottom:1px dashed #000000;42 cursor:help;41 border-bottom:1px dashed #000000; 42 cursor:help; 43 43 } 44 44 45 45 img.row_control { 46 width:16px;47 height:16px;48 cursor:pointer;49 margin-right: 3px;46 width:16px; 47 height:16px; 48 cursor:pointer; 49 margin-right: 3px; 50 50 } -
trunk/administration/templates/base/css/profiles.css
r15201 r15211 2 2 3 3 iframe#adm-mp-members-iframe { 4 width: 0px;5 height: 0px;6 margin: 0px;7 padding: 0px;4 width: 0px; 5 height: 0px; 6 margin: 0px; 7 padding: 0px; 8 8 9 border: 0px;9 border: 0px; 10 10 } 11 11 form#adm-mp-members-form { … … 15 15 /*--- Tags Styles ---*/ 16 16 div.tags_wrapper { 17 text-align: center; 17 text-align: center; 18 18 } 19 19 span.one_tag{ 20 20 padding: 0px 4px; 21 line-height: 30px;21 line-height: 30px; 22 22 } 23 23 … … 26 26 width: 210px; 27 27 height: 30px; 28 28 29 29 position: relative; 30 30 float: left; 31 31 32 32 background-image: url(../images/icons/pm_qlinks_item.png); 33 33 background-position: 0px 7px; 34 34 background-repeat: no-repeat; 35 35 36 36 line-height: 30px; 37 37 text-indent: 20px; … … 45 45 position: relative; 46 46 float: left; 47 47 48 48 line-height: 30px; 49 49 } 50 50 div.adm-mp-order-item-right { 51 51 padding: 0px 10px 0px 0px; 52 52 53 53 float: right; 54 54 } … … 91 91 position: absolute; 92 92 z-index: 2; 93 93 94 94 background-color: #ffcccc; 95 95 } … … 99 99 } 100 100 *+html div.adm-mp-ms-check input.form_input_checkbox { 101 margin: 0px; 101 margin: 0px; 102 102 } 103 103 div.adm-mp-ms-username { … … 117 117 padding: 5px; 118 118 119 position: relative; 119 position: relative; 120 120 } 121 121 div.adm-mp-ms-thumbnail { -
trunk/administration/templates/base/dashboard_content_info.html
r14102 r15211 2 2 <!-- 3 3 $(document).ready(function() { 4 $.get(5 '<bx_url_root />get_rss_feed.php?ID=boonex_version&member=0', 6 {},7 function(sData) {8 var sVerCur = '__current_version__';9 var sVerNew = $(sData).find('dolphin').html(); 4 $.get( 5 '<bx_url_root />get_rss_feed.php?ID=boonex_version&member=0', 6 {}, 7 function(sData) { 8 var sVerCur = '__current_version__'; 9 var sVerNew = $(sData).find('dolphin').html(); 10 10 11 if(sVerNew != 'undefined' && sVerNew != '' && sVerNew != sVerCur)12 $('#adm-dic-update').html('<a href="http://www.boonex.com/dolphin/download/"><bx_text:_adm_txt_dashboard_update_to /> ' + sVerNew + '</a>');13 },14 'text'15 );16 });11 if(sVerNew != 'undefined' && sVerNew != '' && sVerNew != sVerCur) 12 $('#adm-dic-update').html('<a href="http://www.boonex.com/dolphin/download/"><bx_text:_adm_txt_dashboard_update_to /> ' + sVerNew + '</a>'); 13 }, 14 'text' 15 ); 16 }); 17 17 --> 18 18 </script> … … 20 20 <tr> 21 21 <td class="left"> 22 __cell_11__22 __cell_11__ 23 23 </td> 24 24 <td class="right"> 25 <span class="__cell_12_class__">__cell_12__</span>26 </td>25 <span class="__cell_12_class__">__cell_12__</span> 26 </td> 27 27 </tr> 28 28 <tr> -
trunk/administration/templates/base/default.html
r15201 r15211 1 <bx_include_auto:_sub_header.html /> 1 <bx_include_auto:_sub_header.html /> 2 2 __page_main_code__ 3 3 __promo_code__ -
trunk/administration/templates/base/design_box_1.html
r15201 r15211 1 1 <!-- Design Box [ Start ] here --> 2 2 <div class="bx-db-container bx-def-border bx-def-color-bg-block bx-def-margin-bottom"> 3 <div class="bx-db-header bx-def-border-bottom">3 <div class="bx-db-header bx-def-border-bottom"> 4 4 <div class="bx-db-title bx-def-padding-sec-left">__title__</div> 5 5 <div class="bx-db-menu"> … … 15 15 </bx_repeat:actions> 16 16 </div> 17 </div>18 <div class="bx-db-content">__content__</div>19 __bottom_items__17 </div> 18 <div class="bx-db-content">__content__</div> 19 __bottom_items__ 20 20 </div> 21 21 <!-- Design Box [ End ] here --> -
trunk/administration/templates/base/fields.html
r15201 r15211 5 5 <div id="edit_form_cont"></div> 6 6 <div id="main_container"> 7 <div id="tabs_container">8 <div id="m1">9 <div class="build_container"><bx_text:_adm_fields_loading /></div>10 </div>11 <div id="edit-tab" style="display:none">7 <div id="tabs_container"> 8 <div id="m1"> 9 <div class="build_container"><bx_text:_adm_fields_loading /></div> 10 </div> 11 <div id="edit-tab" style="display:none"> 12 12 <div class="adm-db-control-panel" id="mode_switcher_1"> 13 <ul>14 <li><a href="#m2"><bx_text:_adm_fields_owner /></a></li>15 <li><a href="#m3"><bx_text:_adm_fields_admin /></a></li>16 </ul>13 <ul> 14 <li><a href="#m2"><bx_text:_adm_fields_owner /></a></li> 15 <li><a href="#m3"><bx_text:_adm_fields_admin /></a></li> 16 </ul> 17 17 </div> 18 <div id="m2">19 <div class="build_container"></div>20 </div>21 <div id="m3">22 <div class="build_container"></div>23 </div>24 </div>25 <div id="view-tab" style="display:none">18 <div id="m2"> 19 <div class="build_container"></div> 20 </div> 21 <div id="m3"> 22 <div class="build_container"></div> 23 </div> 24 </div> 25 <div id="view-tab" style="display:none"> 26 26 <div class="adm-db-control-panel" id="mode_switcher_2"> 27 <ul>28 <li><a href="#m5"><bx_text:_adm_fields_admin /></a></li>29 <li><a href="#m6"><bx_text:_adm_fields_member /></a></li>30 <li><a href="#m8"><bx_text:_adm_fields_visitor /></a></li>31 </ul>27 <ul> 28 <li><a href="#m5"><bx_text:_adm_fields_admin /></a></li> 29 <li><a href="#m6"><bx_text:_adm_fields_member /></a></li> 30 <li><a href="#m8"><bx_text:_adm_fields_visitor /></a></li> 31 </ul> 32 32 </div> 33 <div id="m5">34 <div class="build_container"></div>35 </div>36 <div id="m6">37 <div class="build_container"></div>38 </div> 39 <div id="m8">40 <div class="build_container"></div>41 </div>42 </div>43 <div id="search-tab" style="display:none">33 <div id="m5"> 34 <div class="build_container"></div> 35 </div> 36 <div id="m6"> 37 <div class="build_container"></div> 38 </div> 39 <div id="m8"> 40 <div class="build_container"></div> 41 </div> 42 </div> 43 <div id="search-tab" style="display:none"> 44 44 <div class="adm-db-control-panel" id="mode_switcher_3"> 45 <ul>46 <li><a href="#m9"><bx_text:_adm_fields_simple_search /></a></li>47 <li><a href="#m10"><bx_text:_adm_fields_quick_search /></a></li>48 <li><a href="#m11"><bx_text:_adm_fields_advanced_search /></a></li>49 </ul>45 <ul> 46 <li><a href="#m9"><bx_text:_adm_fields_simple_search /></a></li> 47 <li><a href="#m10"><bx_text:_adm_fields_quick_search /></a></li> 48 <li><a href="#m11"><bx_text:_adm_fields_advanced_search /></a></li> 49 </ul> 50 50 </div> 51 <div id="m9">52 <div class="build_container"></div>53 </div>54 <div id="m10">55 <div class="build_container"></div>56 </div>57 <div id="m11">58 <div class="build_container"></div>59 </div>60 </div> 61 </div>51 <div id="m9"> 52 <div class="build_container"></div> 53 </div> 54 <div id="m10"> 55 <div class="build_container"></div> 56 </div> 57 <div id="m11"> 58 <div class="build_container"></div> 59 </div> 60 </div> 61 </div> 62 62 </div> 63 63 <script language="javascript" type="text/javascript"> 64 64 <!-- 65 oPFM = new BxDolPFM(); 66 oPFM.config.areas = 11;67 oPFM.config.parserUrl = 'fields.parse.php';65 oPFM = new BxDolPFM(); 66 oPFM.config.areas = 11; 67 oPFM.config.parserUrl = 'fields.parse.php'; 68 68 69 $(document).ready(function() { 70 $('#mode_switcher_1').tabs(); 71 $('#mode_switcher_2').tabs(); 72 $('#mode_switcher_3').tabs(); 73 oPFM.init(); 74 }); 75 76 function changeType(oLink){ 77 var sType = oLink.id.replace('adm-fb-ctl-', ''); 69 $(document).ready(function() { 70 $('#mode_switcher_1').tabs(); 71 $('#mode_switcher_2').tabs(); 72 $('#mode_switcher_3').tabs(); 73 oPFM.init(); 74 }); 78 75 79 $(oLink).parent('.notActive').hide().siblings('.notActive:hidden').show().siblings('.active').hide().siblings('#' + $(oLink).attr('id') + '-act').show(); 76 function changeType(oLink){ 77 var sType = oLink.id.replace('adm-fb-ctl-', ''); 80 78 81 $('#tabs_container > :visible').bx_anim('hide', 'fade', 'slow', function() { 79 $(oLink).parent('.notActive').hide().siblings('.notActive:hidden').show().siblings('.active').hide().siblings('#' + $(oLink).attr('id') + '-act').show(); 80 81 $('#tabs_container > :visible').bx_anim('hide', 'fade', 'slow', function() { 82 82 $('#tabs_container > #' + sType).show(); 83 }); 84 }83 }); 84 } 85 85 --> 86 86 </script> -
trunk/administration/templates/base/hosting_promo.html
r15201 r15211 2 2 3 3 <style> 4 .adm-hosting-promo {5 position:relative;6 }7 .adm-hosting-promo > img {8 position:absolute;9 top:0px;10 left:0px;11 width:60px;12 height:60px;13 background-repeat:no-repeat;14 background-position:center center;15 }16 .adm-hosting-promo > div {17 padding:10px 10px 10px 60px;18 }19 .adm-hosting-promo > div > a {20 display:block;21 font-size:14px;22 font-weight:bold;23 }4 .adm-hosting-promo { 5 position:relative; 6 } 7 .adm-hosting-promo > img { 8 position:absolute; 9 top:0px; 10 left:0px; 11 width:60px; 12 height:60px; 13 background-repeat:no-repeat; 14 background-position:center center; 15 } 16 .adm-hosting-promo > div { 17 padding:10px 10px 10px 60px; 18 } 19 .adm-hosting-promo > div > a { 20 display:block; 21 font-size:14px; 22 font-weight:bold; 23 } 24 24 </style> 25 25 <div class="adm-hosting-promo"> 26 <img src="<bx_image_url:spacer.gif />" style="background-image:url(<bx_icon_url:hosting_promo.png />);" />27 <div>28 <a target="_blank" href="http://www.boonex.com/hosting/"><bx_text:_adm_txt_hosting_title /></a>29 <bx_text:_adm_txt_hosting_text />30 </div>26 <img src="<bx_image_url:spacer.gif />" style="background-image:url(<bx_icon_url:hosting_promo.png />);" /> 27 <div> 28 <a target="_blank" href="http://www.boonex.com/hosting/"><bx_text:_adm_txt_hosting_title /></a> 29 <bx_text:_adm_txt_hosting_text /> 30 </div> 31 31 </div> -
trunk/administration/templates/base/langs_form_create.html
r15201 r15211 2 2 3 3 <div id="adm-langs-cnt-create" style="display:__display__;"> 4 <div class="adm-db-content-wrapper">__form__</div>4 <div class="adm-db-content-wrapper">__form__</div> 5 5 </div> -
trunk/administration/templates/base/langs_form_import.html
r15201 r15211 2 2 3 3 <div id="adm-langs-cnt-import" style="display:__display__;"> 4 <div class="adm-db-content-wrapper">__form__</div>4 <div class="adm-db-content-wrapper">__form__</div> 5 5 </div> -
trunk/administration/templates/base/langs_key.html
r15201 r15211 3 3 <div id="adm-langs-__type__-key" style="display:none;"> 4 4 <table class="popup_form_wrapper"> 5 <tr>6 <td class="corner"><img src="<bx_image_url:op_cor_tl.png />" alt="" /></td>7 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td>8 <td class="corner"><img src="<bx_image_url:op_cor_tr.png />" alt="" /></td>9 </tr>10 <tr>11 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td>12 <td class="container">13 <div class="adm-design-box">14 <div class="adm-db-head">5 <tr> 6 <td class="corner"><img src="<bx_image_url:op_cor_tl.png />" alt="" /></td> 7 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 8 <td class="corner"><img src="<bx_image_url:op_cor_tr.png />" alt="" /></td> 9 </tr> 10 <tr> 11 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 12 <td class="container"> 13 <div class="adm-design-box"> 14 <div class="adm-db-head"> 15 15 <bx_text:_adm_box_cpt_lang_key /> 16 16 <div class="dbTopMenu"> … … 21 21 </div> 22 22 </div> 23 </div>24 <div class="adm-db-content">23 </div> 24 <div class="adm-db-content"> 25 25 <div class="adm-db-content-wrapper"> 26 26 <div id="adm-langs-__type__-key-content"> … … 29 29 </div> 30 30 </div> 31 </div> 32 </div> 31 </div> 32 </div> 33 33 </td> 34 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td>35 </tr>36 <tr>37 <td class="corner"><img src="<bx_image_url:op_cor_bl.png />" alt="" /></td>38 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td>39 <td class="corner"><img src="<bx_image_url:op_cor_br.png />" onload="if( navigator.appName == 'Microsoft Internet Explorer' && window.version && version >= 5.5 && version < 7 ) png_fix();" alt="" /></td>40 </tr>41 </table>34 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 35 </tr> 36 <tr> 37 <td class="corner"><img src="<bx_image_url:op_cor_bl.png />" alt="" /></td> 38 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 39 <td class="corner"><img src="<bx_image_url:op_cor_br.png />" onload="if( navigator.appName == 'Microsoft Internet Explorer' && window.version && version >= 5.5 && version < 7 ) png_fix();" alt="" /></td> 40 </tr> 41 </table> 42 42 </div> -
trunk/administration/templates/base/login.html
r10490 r15211 1 1 <div class="admin_login_wrapper"> 2 <img class="admin_login_icon" src="<bx_image_url:admin_login_icon.png />" />3 <div class="admin_login_form_wrapper">4 <form class="admin_login_form" action="__action_url__" method="post" onsubmit="javascript: validateLoginForm(this); return false;">5 <input type="hidden" name="relocate" value="__relocate_url__" />2 <img class="admin_login_icon" src="<bx_image_url:admin_login_icon.png />" /> 3 <div class="admin_login_form_wrapper"> 4 <form class="admin_login_form" action="__action_url__" method="post" onsubmit="javascript: validateLoginForm(this); return false;"> 5 <input type="hidden" name="relocate" value="__relocate_url__" /> 6 6 <table cellspacing="20" cellpadding="0" class="admin_login_table"> 7 7 <tr> … … 24 24 25 25 <div class="admin_login_footers"> 26 <div class="left_banner">27 <img src="<bx_image_url:admin_login_admin_logo.png />" alt="Dolphin 7 Admin" />26 <div class="left_banner"> 27 <img src="<bx_image_url:admin_login_admin_logo.png />" alt="Dolphin 7 Admin" /> 28 28 </div> 29 29 <div class="right_banner"> 30 <img src="../media/images/small_logo.png" alt="BoonEx - Community Software Experts" />30 <img src="../media/images/small_logo.png" alt="BoonEx - Community Software Experts" /> 31 31 </div> 32 32 </div> -
trunk/administration/templates/base/main_menu.html
r15201 r15211 12 12 <bx_if:item-link> 13 13 <a href="__link__">__title__</a> 14 </bx_if:item-link> 14 </bx_if:item-link> 15 15 </div> 16 16 <bx_if:submenu> -
trunk/administration/templates/base/manage_subscribers.html
r15201 r15211 2 2 3 3 <form id="adm-ms-form" name="adm-ms-form" action="" method="post"> 4 <div class="adm-ms-items"> 4 <div class="adm-ms-items"> 5 5 <bx_repeat:items> 6 6 <div class="adm-ms-item"> … … 10 10 <div class="adm-ms-name">__name__</div> 11 11 <div class="adm-ms-email">__email__</div> 12 <div class="clear_both"> </div>12 <div class="clear_both"> </div> 13 13 </div> 14 14 </bx_repeat:items> 15 15 16 16 </div> 17 17 __paginate__ -
trunk/administration/templates/base/menu_compose.html
r15201 r15211 3 3 <div class="adm-db-content-wrapper"> 4 4 __extra_js__ 5 <div id="edit_form_cont"></div> 6 <div id="menu_app_wrapper"></div>7 <div class="pseudo_wrapper"> 8 <div class="pseudo_head"><bx_text:_adm_mbuilder_active_items /></div>9 <div id="pseudo1">10 <img src="<bx_image_url:loading.gif />" />11 </div>12 <div class="pseudo_head" style="padding-top:7px;"><bx_text:_adm_mbuilder_all_items /></div>13 <div id="pseudo2">14 <img src="<bx_image_url:loading.gif />" />15 </div>16 </div>17 <div class="pseudo_head" style="padding-top:7px;"><bx_text:_adm_mbuilder_legend /></div>18 <div class="legend">19 <table border="0">20 <tr><td><img src="<bx_image_url:system_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_system /></td></tr>21 <tr><td><img src="<bx_image_url:top_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_top /></td></tr>22 <tr><td><img src="<bx_image_url:custom_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_custom /></td></tr>23 <tr><td><img src="<bx_image_url:inact_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_inact /></td></tr>24 </table>25 </div>5 <div id="edit_form_cont"></div> 6 <div id="menu_app_wrapper"></div> 7 <div class="pseudo_wrapper"> 8 <div class="pseudo_head"><bx_text:_adm_mbuilder_active_items /></div> 9 <div id="pseudo1"> 10 <img src="<bx_image_url:loading.gif />" /> 11 </div> 12 <div class="pseudo_head" style="padding-top:7px;"><bx_text:_adm_mbuilder_all_items /></div> 13 <div id="pseudo2"> 14 <img src="<bx_image_url:loading.gif />" /> 15 </div> 16 </div> 17 <div class="pseudo_head" style="padding-top:7px;"><bx_text:_adm_mbuilder_legend /></div> 18 <div class="legend"> 19 <table border="0"> 20 <tr><td><img src="<bx_image_url:system_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_system /></td></tr> 21 <tr><td><img src="<bx_image_url:top_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_top /></td></tr> 22 <tr><td><img src="<bx_image_url:custom_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_custom /></td></tr> 23 <tr><td><img src="<bx_image_url:inact_item_bg.gif />" /></td><td><bx_text:_adm_mbuilder_legend_inact /></td></tr> 24 </table> 25 </div> 26 26 </div> -
trunk/administration/templates/base/mlevels_action.html
r15201 r15211 3 3 <div id="adm-mlevels-action" style="display:none;"> 4 4 <table class="popup_form_wrapper"> 5 <tr>6 <td class="corner"><img src="<bx_image_url:op_cor_tl.png />" alt="" /></td>7 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td>8 <td class="corner"><img src="<bx_image_url:op_cor_tr.png />" alt="" /></td>9 </tr>10 <tr>11 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td>12 <td class="container">13 <div class="adm-design-box">14 <div class="adm-db-head">5 <tr> 6 <td class="corner"><img src="<bx_image_url:op_cor_tl.png />" alt="" /></td> 7 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 8 <td class="corner"><img src="<bx_image_url:op_cor_tr.png />" alt="" /></td> 9 </tr> 10 <tr> 11 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 12 <td class="container"> 13 <div class="adm-design-box"> 14 <div class="adm-db-head"> 15 15 <bx_text:_adm_box_cpt_mlevel_action /> 16 16 <div class="dbTopMenu"> … … 21 21 </div> 22 22 </div> 23 </div>24 <div class="adm-db-content">23 </div> 24 <div class="adm-db-content"> 25 25 <div class="adm-db-content-wrapper"> 26 26 <div id="adm-mlevels-action-content"> … … 29 29 </div> 30 30 </div> 31 </div> 32 </div> 31 </div> 32 </div> 33 33 </td> 34 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td>35 </tr>36 <tr>37 <td class="corner"><img src="<bx_image_url:op_cor_bl.png />" alt="" /></td>38 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td>39 <td class="corner"><img src="<bx_image_url:op_cor_br.png />" onload="if( navigator.appName == 'Microsoft Internet Explorer' && window.version && version >= 5.5 && version < 7 ) png_fix();" alt="" /></td>40 </tr>41 </table>34 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 35 </tr> 36 <tr> 37 <td class="corner"><img src="<bx_image_url:op_cor_bl.png />" alt="" /></td> 38 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 39 <td class="corner"><img src="<bx_image_url:op_cor_br.png />" onload="if( navigator.appName == 'Microsoft Internet Explorer' && window.version && version >= 5.5 && version < 7 ) png_fix();" alt="" /></td> 40 </tr> 41 </table> 42 42 </div> -
trunk/administration/templates/base/mlevels_actions.html
r15201 r15211 7 7 <bx_repeat:items> 8 8 <div class="adm-mlevels-item __class__"> 9 <input type="checkbox" class="form_input_checkbox" id="adm-mlevels-__action_id__" name="actions[]" value="__action_id__" /> 9 <input type="checkbox" class="form_input_checkbox" id="adm-mlevels-__action_id__" name="actions[]" value="__action_id__" /> 10 10 <bx_if:enabled> 11 11 <a href="javascript:void(0)" onclick="javascript:onEditAction(__level_id__, __action_id__)">__title__</a> -
trunk/administration/templates/base/mlevels_list.html
r15201 r15211 4 4 <div class="adm-mlevels-items"> 5 5 <bx_repeat:items> 6 <div class="adm-mlevels-item __class__"> 6 <div class="adm-mlevels-item __class__"> 7 7 <input type="checkbox" class="form_input_checkbox" id="adm-mlevels-__id__" name="levels[]" value="__id__" <bx_if:system>disabled="disabled"</bx_if:system> /> 8 8 <bx_if:enabled> -
trunk/administration/templates/base/modules_results.html
r15201 r15211 10 10 <bx_if:operation_result_failed> 11 11 <span class="modules-plank-failed"><bx_text:_adm_txt_modules_process_failed /></span> 12 </bx_if:operation_result_failed> 12 </bx_if:operation_result_failed> 13 13 <div class="modules-plank-switch" onclick="$(this).toggleClass('modules-plank-switch-opened').next().toggle()"></div> 14 14 <div class="modules-plank-content">__message__</div> -
trunk/administration/templates/base/mp_controls.html
r15201 r15211 3 3 <div id="adm-mp-control" class="adm-db-content-wrapper"> 4 4 <bx_include_auto:mp_ctl_type_qlinks.html /> 5 <bx_include_auto:mp_ctl_type_browse.html />5 <bx_include_auto:mp_ctl_type_browse.html /> 6 6 <bx_include_auto:mp_ctl_type_calendar.html /> 7 7 <bx_include_auto:mp_ctl_type_tags.html /> -
trunk/administration/templates/base/mp_members.html
r15201 r15211 4 4 <form id="adm-mp-members-form" enctype="multipart/form-data" method="post" action="__action_url__" class="form_advanced" target="adm-mp-members-iframe"> 5 5 <input type="hidden" name="adm-mp-members-ctl-type" value="__ctl_type__" /> 6 <input type="hidden" name="adm-mp-members-view-type" value="__view_type__" /> 6 <input type="hidden" name="adm-mp-members-view-type" value="__view_type__" /> 7 7 <div class="adm-db-control-panel"> 8 8 <div class="adm-mp-order-item"> … … 13 13 <option value="DateReg DESC"><bx_text:_adm_txt_mp_order_last_join /></option> 14 14 <option value="DateLastNav DESC"><bx_text:_adm_txt_mp_order_last_activity /></option> 15 </select> 15 </select> 16 16 </div> 17 17 <div class="adm-mp-order-item-right"> … … 20 20 <div class="clear_both"> </div> 21 21 </div> 22 22 23 23 <div class="adm-mp-members-wrapper" id="adm-mp-members-simple" style="__style_simple__">__content_simple__</div> 24 24 <div class="adm-mp-members-wrapper" id="adm-mp-members-extended" style="__style_extended__">__content_extended__</div> -
trunk/administration/templates/base/mp_members_extended.html
r15201 r15211 3 3 <div class="adm-mp-members-extended"> 4 4 <bx_repeat:items> 5 <div class="adm-mp-member-extended"> 5 <div class="adm-mp-member-extended"> 6 6 <div class="adm-mp-ms-check"> 7 7 <input type="checkbox" class="form_input_checkbox" id="adm-mp-__id__" name="members[]" value="__id__" /> … … 9 9 <div class="adm-mp-ms-thumbnail">__thumbnail__</div> 10 10 <div class="adm-mp-ms-info"> 11 <div class="adm-mp-ms-nick">11 <div class="adm-mp-ms-nick"> 12 12 <a href="__edit_link__" class="__edit_class__">__username__</a>: 13 13 __headline__ 14 14 </div> 15 <div class="adm-mp-ms-age">16 <img src="__sex_link__" />17 __age__18 <bx_if:flag>15 <div class="adm-mp-ms-age"> 16 <img src="__sex_link__" /> 17 __age__ 18 <bx_if:flag> 19 19 <img src="__flag_link__" alt="flag" /> 20 </bx_if:flag>21 __city__,22 __country__23 </div>24 <div class="adm-mp-ms-desc">__description__</div>25 </div>26 <div class="clear_both"> </div>20 </bx_if:flag> 21 __city__, 22 __country__ 23 </div> 24 <div class="adm-mp-ms-desc">__description__</div> 25 </div> 26 <div class="clear_both"> </div> 27 27 </div> 28 </bx_repeat:items> 28 </bx_repeat:items> 29 29 </div> 30 30 __paginate__ -
trunk/administration/templates/base/mp_members_geeky.html
r15201 r15211 9 9 <th><bx_text:_adm_txt_mp_mlevel /></th> 10 10 <th><bx_text:_adm_txt_mp_registration /></th> 11 <th><bx_text:_adm_txt_mp_last_login /></th> 11 <th><bx_text:_adm_txt_mp_last_login /></th> 12 12 </tr> 13 13 <bx_repeat:items> … … 18 18 <td width="100px">__ml_name__</td> 19 19 <td width="105px">__registration__</td> 20 <td width="105px">__last_login__</td> 20 <td width="105px">__last_login__</td> 21 21 </tr> 22 22 </bx_repeat:items> -
trunk/administration/templates/base/notifies_filter.html
r15201 r15211 2 2 3 3 <script type="text/javascript" language="JavaScript"> 4 <!--5 function setControlsState() {6 var state_disabled = ($('.form_queue_form select[name=age_start]').attr('disabled') == true) ? '' : 'disabled';4 <!-- 5 function setControlsState() { 6 var state_disabled = ($('.form_queue_form select[name=age_start]').attr('disabled') == true) ? '' : 'disabled'; 7 7 8 $(".form_queue_form input[name='sex[]']").attr('disabled', state_disabled);9 $('.form_queue_form select[name=age_start]').attr('disabled', state_disabled);10 $('.form_queue_form select[name=age_end]').attr('disabled', state_disabled);11 $('.form_queue_form select[name=country]').attr('disabled', state_disabled);12 $('.form_queue_form select[name=membership]').attr('disabled', state_disabled);13 }14 -->8 $(".form_queue_form input[name='sex[]']").attr('disabled', state_disabled); 9 $('.form_queue_form select[name=age_start]').attr('disabled', state_disabled); 10 $('.form_queue_form select[name=age_end]').attr('disabled', state_disabled); 11 $('.form_queue_form select[name=country]').attr('disabled', state_disabled); 12 $('.form_queue_form select[name=membership]').attr('disabled', state_disabled); 13 } 14 --> 15 15 </script> 16 16 <center></center> -
trunk/administration/templates/base/page_10.html
r15201 r15211 1 1 <!-- TODO: remake to regular template file + some standard page index --> 2 <bx_include_auto:_sub_header.html /> 2 <bx_include_auto:_sub_header.html /> 3 3 __page_code_controls__ 4 4 __page_code_members__ -
trunk/administration/templates/base/page_13.html
r15201 r15211 4 4 __page_code_new_message__ 5 5 __page_code_preview_message__ 6 __page_code_all_messages__ 7 __page_code_queue_message__ 6 __page_code_all_messages__ 7 __page_code_queue_message__ 8 8 <bx_include_auto:_sub_footer.html /> -
trunk/administration/templates/base/page_3.html
r15201 r15211 3 3 <!-- Design Box [ Start ] here --> 4 4 <div class="adm-design-box"> 5 <div class="adm-db-head">__page_header_text__</div>6 <div class="adm-db-content">5 <div class="adm-db-head">__page_header_text__</div> 6 <div class="adm-db-content"> 7 7 <div class="adm-settings-wrapper"> 8 8 __page_result_code__ … … 12 12 </div> 13 13 <!-- Design Box [ End ] here --> 14 __promo_code__14 __promo_code__ 15 15 <bx_include_auto:_sub_footer.html /> -
trunk/administration/templates/base/page_4.html
r15201 r15211 2 2 <bx_include_auto:_sub_header.html /> 3 3 <!-- Design Box [ Start ] here --> 4 __page_code_settings__ 4 __page_code_settings__ 5 5 __page_code_logo__ 6 6 __page_code_promo__ -
trunk/administration/templates/base/page_6.html
r15201 r15211 1 1 <!-- TODO: remake to regular template file + some standard page index --> 2 <bx_include_auto:_sub_header.html /> 2 <bx_include_auto:_sub_header.html /> 3 3 __page_code_settings__ 4 4 __page_code_create__ -
trunk/administration/templates/base/page_7.html
r15201 r15211 1 1 <!-- TODO: remake to regular template file + some standard page index --> 2 <bx_include_auto:_sub_header.html /> 2 <bx_include_auto:_sub_header.html /> 3 3 __page_code_results__ 4 4 __page_code_uploader__ … … 6 6 __page_code_not_installed__ 7 7 __page_code_updates__ 8 __page_code_market_feed__8 __page_code_market_feed__ 9 9 <bx_include_auto:_sub_footer.html /> -
trunk/administration/templates/base/page_8.html
r15201 r15211 1 1 <!-- TODO: remake to regular template file + some standard page index --> 2 <bx_include_auto:_sub_header.html /> 2 <bx_include_auto:_sub_header.html /> 3 3 __page_code_settings__ 4 4 __page_code_templates__ -
trunk/administration/templates/base/pbuilder_content.html
r15201 r15211 2 2 3 3 <div id="buildZoneWrapper"> 4 __selector__5 <bx_if:page>6 <div id="buildAreasWrapper">7 <div class="block_head"><bx_text:_adm_txt_pb_page_width /></div>8 <div class="block_cont_nd">9 <div id="pageWidthValue"></div>10 <div id="pageWidthSlider"></div>11 <div class="clear_both"></div>12 </div>13 <div class="block_head"><bx_text:_adm_txt_pb_active_blocks /></div>14 <div class="block_cont" id="activeAreaWrapper">15 <div id="pageControls">4 __selector__ 5 <bx_if:page> 6 <div id="buildAreasWrapper"> 7 <div class="block_head"><bx_text:_adm_txt_pb_page_width /></div> 8 <div class="block_cont_nd"> 9 <div id="pageWidthValue"></div> 10 <div id="pageWidthSlider"></div> 11 <div class="clear_both"></div> 12 </div> 13 <div class="block_head"><bx_text:_adm_txt_pb_active_blocks /></div> 14 <div class="block_cont" id="activeAreaWrapper"> 15 <div id="pageControls"> 16 16 <bx_if:delete_link> 17 17 <a href="javascript:void(0)" onclick="oPB.deleteCustomPage()"><bx_text:_Delete /></a> … … 20 20 <a href="__site_url__page/__page_name__" target="_blank"><bx_text:_adm_txt_pb_view_page /></a> 21 21 </bx_if:view_link> 22 </div>23 24 <div id="activeBlocksArea" class="buildArea">25 <bx_text:_adm_txt_pb_loading />26 </div>27 </div>28 29 <div id="columnsSlider"></div>30 31 <div class="block_head"><bx_text:_adm_txt_pb_inactive_blocks /></div>32 <div class="block_cont">33 <div id="inactiveBlocksArea" class="buildArea">34 <bx_text:_adm_txt_pb_loading />35 </div>36 </div>37 38 <div class="block_head"><bx_text:_adm_txt_pb_samples /></div>39 <div class="block_cont">40 <div id="samplesBlocksArea" class="buildArea">41 <bx_text:_adm_txt_pb_loading />42 </div>43 </div>44 45 <div class="block_head"><bx_text:_adm_txt_pb_other_pages_width /></div>46 <div class="block_cont_nd">47 <div id="pageWidthValue1"></div>48 <div id="pageWidthSlider1"></div>49 <div class="clear_both"></div>50 </div>51 </div>52 53 <script language="javascript" type="text/javascript">54 <!--22 </div> 23 24 <div id="activeBlocksArea" class="buildArea"> 25 <bx_text:_adm_txt_pb_loading /> 26 </div> 27 </div> 28 29 <div id="columnsSlider"></div> 30 31 <div class="block_head"><bx_text:_adm_txt_pb_inactive_blocks /></div> 32 <div class="block_cont"> 33 <div id="inactiveBlocksArea" class="buildArea"> 34 <bx_text:_adm_txt_pb_loading /> 35 </div> 36 </div> 37 38 <div class="block_head"><bx_text:_adm_txt_pb_samples /></div> 39 <div class="block_cont"> 40 <div id="samplesBlocksArea" class="buildArea"> 41 <bx_text:_adm_txt_pb_loading /> 42 </div> 43 </div> 44 45 <div class="block_head"><bx_text:_adm_txt_pb_other_pages_width /></div> 46 <div class="block_cont_nd"> 47 <div id="pageWidthValue1"></div> 48 <div id="pageWidthSlider1"></div> 49 <div class="clear_both"></div> 50 </div> 51 </div> 52 53 <script language="javascript" type="text/javascript"> 54 <!-- 55 55 $(document).ready(function(){ 56 56 oPB = new BxDolPageBuilder({ … … 66 66 }); 67 67 --> 68 </script>68 </script> 69 69 </bx_if:page> 70 70 </div> -
trunk/administration/templates/base/popup_form_wrapper.html
r15201 r15211 2 2 3 3 <table class="popup_form_wrapper"> 4 <tr>5 <td class="corner"><img src="<bx_image_url:op_cor_tl.png />" alt="" /></td>6 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td>7 <td class="corner"><img src="<bx_image_url:op_cor_tr.png />" alt="" /></td>8 </tr>9 <tr>10 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td>11 <td class="container">12 <div class="adm-design-box">13 <div class="adm-db-head">14 __caption__4 <tr> 5 <td class="corner"><img src="<bx_image_url:op_cor_tl.png />" alt="" /></td> 6 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 7 <td class="corner"><img src="<bx_image_url:op_cor_tr.png />" alt="" /></td> 8 </tr> 9 <tr> 10 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 11 <td class="container"> 12 <div class="adm-design-box"> 13 <div class="adm-db-head"> 14 __caption__ 15 15 <div class="dbTopMenu"> 16 16 <div class="adm-db-close" style="background-image:url(<bx_image_url:close.gif />)"> … … 20 20 </div> 21 21 </div> 22 </div>23 <div class="adm-db-content">22 </div> 23 <div class="adm-db-content"> 24 24 <div class="adm-db-content-wrapper"> 25 25 <div id="adm-mlevels-action-content"> … … 27 27 </div> 28 28 </div> 29 </div> 30 </div> 29 </div> 30 </div> 31 31 32 </td>33 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td>34 </tr>35 <tr>36 <td class="corner"><img src="<bx_image_url:op_cor_bl.png />" alt="" /></td>37 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td>38 <td class="corner"><img src="<bx_image_url:op_cor_br.png />" onload="if( navigator.appName == 'Microsoft Internet Explorer' && window.version && version >= 5.5 && version < 7 ) png_fix();" alt="" /></td>39 </tr>32 </td> 33 <td class="side"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 34 </tr> 35 <tr> 36 <td class="corner"><img src="<bx_image_url:op_cor_bl.png />" alt="" /></td> 37 <td class="side_ver"><img src="<bx_image_url:spacer.gif />" alt="" /></td> 38 <td class="corner"><img src="<bx_image_url:op_cor_br.png />" onload="if( navigator.appName == 'Microsoft Internet Explorer' && window.version && version >= 5.5 && version < 7 ) png_fix();" alt="" /></td> 39 </tr> 40 40 </table> -
trunk/administration/templates/base/promo.html
r15201 r15211 18 18 function togglePromo(oRadio) { 19 19 var aSwitcher = {text: 'image', image: 'text'}; 20 20 21 21 $('#promo-cnt-' + aSwitcher[$(oRadio).val()]).bx_anim('hide', 'fade', 'slow', function(){ 22 22 $('#promo-cnt-' + $(oRadio).val()).bx_anim('show', 'fade', 'slow'); 23 23 }); 24 } 24 } 25 25 --> 26 26 </script> -
trunk/administration/templates/base/promo_images.html
r15201 r15211 2 2 3 3 <bx_repeat:images> 4 <a href="javascript:void(0);" onmouseover="javascript:onOver('__title__');" onmousemove="javascript:moveFloatDesc(event);" onmouseout="javascript:hideFloatDesc();">__title__</a> (<a href="__delete_url__"><bx_text:_adm_txt_settings_delete /></a>)<br />4 <a href="javascript:void(0);" onmouseover="javascript:onOver('__title__');" onmousemove="javascript:moveFloatDesc(event);" onmouseout="javascript:hideFloatDesc();">__title__</a> (<a href="__delete_url__"><bx_text:_adm_txt_settings_delete /></a>)<br /> 5 5 </bx_repeat:images> 6 6 <script type="text/javascript" language="javascript"> -
trunk/administration/templates/base/register.html
r15201 r15211 1 1 2 2 <div class="admin_login_wrapper"> 3 <div class="admin_license_form_wrapper">4 <form class="admin_login_form" method="post">5 <input type="hidden" name="ID" value="__id__" />6 <input type="hidden" name="Password" value="__password__" />3 <div class="admin_license_form_wrapper"> 4 <form class="admin_login_form" method="post"> 5 <input type="hidden" name="ID" value="__id__" /> 6 <input type="hidden" name="Password" value="__password__" /> 7 7 <table cellspacing="20" cellpadding="0" class="admin_login_table"> 8 8 <tr> … … 21 21 </tr> 22 22 <tr> 23 <td> 23 <td> 24 24 </td> 25 25 <td> 26 <input type="submit" id="admin_login_form_submit" value="Register"/>26 <input type="submit" id="admin_login_form_submit" value="Register"/> 27 27 </td> 28 28 </tr> 29 <tr>30 <td colspan="2" style="font-size:14px; padding-top:35px;">31 If money is tight, or you don't feel like supporting BoonEx, or just want to test-drive Dolphin you can 32 <a href="http://www.boonex.com/community/licenses/">generate a free license at BoonEx Unity</a> or <a href="__relocate_url__">continue using an unregistered copy</a>. In that case, links 29 <tr> 30 <td colspan="2" style="font-size:14px; padding-top:35px;"> 31 If money is tight, or you don't feel like supporting BoonEx, or just want to test-drive Dolphin you can 32 <a href="http://www.boonex.com/community/licenses/">generate a free license at BoonEx Unity</a> or <a href="__relocate_url__">continue using an unregistered copy</a>. In that case, links 33 33 to BoonEx ads and promo blocks will remain on your site and admin panel. 34 </td>35 </tr>34 </td> 35 </tr> 36 36 </table> 37 37 </form>
Note: See TracChangeset
for help on using the changeset viewer.