Index: branches/unlabeled/unlabeled-1.10.2/core/units/categories/cache_updater.php =================================================================== diff -u -r7636 -r7755 --- branches/unlabeled/unlabeled-1.10.2/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 7636) +++ branches/unlabeled/unlabeled-1.10.2/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 7755) @@ -313,7 +313,7 @@ { $fields_hash = Array ( 'ParentPath' => '|'.implode('|', $data['parent_path']).'|', - 'NamedParentPath' => implode('/', $data['named_path'] ), + 'NamedParentPath' => $data['system'] ? $data['file_name'] : implode('/', $data['named_path'] ), 'CachedCategoryTemplate' => $data['category_template'], 'CachedDescendantCatsQty' => $data['children_count'], ); @@ -343,7 +343,9 @@ } $data['parent_path'][] = $category_id; - $data['named_path'][] = $record['Filename']; + $data['named_path'][] = preg_replace('/^Content\\//', '', $record['Filename']); + $data['system'] = $record['IsSystem']; + $data['file_name'] = $record['Filename']; // it is one of the modules root category $root_prefix = isset($this->root_prefixes[$category_id]) ? $this->root_prefixes[$category_id] : false; Index: branches/unlabeled/unlabeled-1.2.2/admin/editor/cmseditor/editor/dialog/fck_find.html =================================================================== diff -u -r7698 -r7755 --- branches/unlabeled/unlabeled-1.2.2/admin/editor/cmseditor/editor/dialog/fck_find.html (.../fck_find.html) (revision 7698) +++ branches/unlabeled/unlabeled-1.2.2/admin/editor/cmseditor/editor/dialog/fck_find.html (.../fck_find.html) (revision 7755) @@ -133,14 +133,14 @@ } - + Index: branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/themes_helper.php =================================================================== diff -u -r7698 -r7755 --- branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/themes_helper.php (.../themes_helper.php) (revision 7698) +++ branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/themes_helper.php (.../themes_helper.php) (revision 7755) @@ -1,32 +1,32 @@ themesFolder = FULL_PATH.'/themes'; } - + /** * Updates file system changes to database for selected theme * * @param string $theme_name - * + * * @return mixed returns ID of created/used theme or false, if none created */ function refreshTheme($theme_name) @@ -35,23 +35,23 @@ // requested theme was not found on hdd return false; } - + $id_field = $this->Application->getUnitOption('theme', 'IDField'); $table_name = $this->Application->getUnitOption('theme', 'TableName'); - + $sql = 'SELECT '.$id_field.' FROM '.$table_name.' WHERE Name = '.$this->Conn->qstr($theme_name); $theme_id = $this->Conn->GetOne($sql); - + $this->themeFiles = Array (); if ($theme_id) { // reset found mark for every themes file (if theme is not new) $sql = 'UPDATE '.TABLE_PREFIX.'ThemeFiles SET FileFound = 0 WHERE ThemeId = '.$theme_id; $this->Conn->Query($sql); - + // get all theme files from db $sql = 'SELECT FileId, CONCAT(FilePath, "/", FileName) AS FullPath FROM '.TABLE_PREFIX.'ThemeFiles @@ -71,18 +71,18 @@ $this->Conn->doInsert($fields_hash, $table_name); $theme_id = $this->Conn->getInsertID(); } - + $theme_path = $this->themesFolder.'/'.$theme_name; $this->FindThemeFiles('', $theme_path, $theme_id); // search from base theme directory - + // delete file records from db, that were not found on hdd $sql = 'DELETE FROM '.TABLE_PREFIX.'ThemeFiles WHERE ThemeId = '.$theme_id.' AND FileFound = 0'; $this->Conn->Query($sql); - + return $theme_id; } - + /** * Searches for new templates (missing in db) in spefied folder * @@ -93,22 +93,38 @@ function FindThemeFiles($folder_path, $theme_path, $theme_id) { $fh = opendir($theme_path.$folder_path.'/'); - + + if (file_exists($theme_path.$folder_path.'/'.'.smsignore')) { + $ignore = file($theme_path.$folder_path.'/'.'.smsignore'); + } + else { + $ignore = array(); + } + while (($filename = readdir($fh))) { if ($filename == '.' || $filename == '..') continue; - + $full_path = $theme_path.$folder_path.'/'.$filename; if (is_dir($full_path)) { $this->FindThemeFiles($folder_path.'/'.$filename, $theme_path, $theme_id); } elseif (substr($filename, -4) == '.tpl') { $file_path = $folder_path.'/'.$filename; - + + $auto_structure = 1; + foreach ($ignore as $pattern) + { + if (preg_match('/'.str_replace('/', '\\/',$pattern).'/', $filename)) { + $auto_structure = 2; + break; + } + } + $file_id = isset($this->themeFiles[$file_path]) ? $this->themeFiles[$file_path] : false; if ($file_id) { // file was found in db & on hdd -> mark as existing $sql = 'UPDATE '.TABLE_PREFIX.'ThemeFiles - SET FileFound = 1 + SET FileFound = 1, FileType = '.$auto_structure.' WHERE FileId = '.$file_id; $this->Conn->Query($sql); } @@ -119,41 +135,41 @@ 'FileName' => $filename, 'FilePath' => $folder_path, 'Description' => '', - 'FileType' => 0, // 1 - built-in, 1 - custom (not in use right now) + 'FileType' => $auto_structure, // 1 - built-in, 0 - custom (not in use right now), 2 - skipped in structure 'FileFound' => 1, ); $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'ThemeFiles'); $this->themeFiles[$file_path] = $this->Conn->getInsertID(); } // echo 'FilePath: ['.$folder_path.']; FileName: ['.$filename.']; IsNew: ['.($file_id > 0 ? 'NO' : 'YES').']
'; } - + } } - + /** * Updates file system changes to database for all themes (including new ones) * */ function refreshThemes() { $themes_found = Array(); - + $fh = opendir($this->themesFolder.'/'); while (($filename = readdir($fh))) { if ($filename == '.' || $filename == '..' || $filename == 'CVS') continue; - + if (is_dir($this->themesFolder.'/'.$filename)) { $theme_id = $this->refreshTheme($filename); if ($theme_id) { $themes_found[] = $theme_id; } } } - + $id_field = $this->Application->getUnitOption('theme', 'IDField'); $table_name = $this->Application->getUnitOption('theme', 'TableName'); - + // if none themes found -> delete all from db OR delete all except of found themes $sql = 'SELECT '.$id_field.' FROM '.$table_name; @@ -162,8 +178,9 @@ } $theme_ids = $this->Conn->GetCol($sql); $this->deleteThemes($theme_ids); + } - + /** * Deletes themes with ids passed from db * @@ -174,14 +191,14 @@ if (!$theme_ids) { return ; } - + $id_field = $this->Application->getUnitOption('theme', 'IDField'); $table_name = $this->Application->getUnitOption('theme', 'TableName'); - + $sql = 'DELETE FROM '.$table_name.' WHERE '.$id_field.' IN ('.implode(',', $theme_ids).')'; $this->Conn->Query($sql); - + $sql = 'DELETE FROM '.TABLE_PREFIX.'ThemeFiles WHERE '.$id_field.' IN ('.implode(',', $theme_ids).')'; $this->Conn->Query($sql); Index: branches/unlabeled/unlabeled-1.2.2/admin/editor/cmseditor/editor/dialog/fck_select.html =================================================================== diff -u -r7698 -r7755 --- branches/unlabeled/unlabeled-1.2.2/admin/editor/cmseditor/editor/dialog/fck_select.html (.../fck_select.html) (revision 7698) +++ branches/unlabeled/unlabeled-1.2.2/admin/editor/cmseditor/editor/dialog/fck_select.html (.../fck_select.html) (revision 7755) @@ -141,29 +141,29 @@ - - + + - - - - +
  - + - + - - @@ -113,7 +113,7 @@ - Index: branches/unlabeled/unlabeled-1.6.2/core/install.php =================================================================== diff -u -r7528 -r7755 --- branches/unlabeled/unlabeled-1.6.2/core/install.php (.../install.php) (revision 7528) +++ branches/unlabeled/unlabeled-1.6.2/core/install.php (.../install.php) (revision 7755) @@ -12,13 +12,13 @@ * */ define('UPGRADES_FILE', FULL_PATH.'/%sinstall/upgrades.sql'); - + /** * Format of version identificator in upgrade files * */ define('VERSION_MARK', '# ===== v ([\d]+\.[\d]+\.[\d]+) ====='); - + // print_pre($_POST); $install_engine = new kInstallator(); @@ -97,7 +97,7 @@ * @var Array */ var $skipLoginSteps = Array ('root_password', 'choose_modules', 'finish', -1); - + /** * Steps, on which kApplication should not be initialized, because of missing correct db table structure * @@ -151,7 +151,7 @@ // can't check login on steps where no application present anyways :) $this->skipLoginSteps = array_unique(array_merge($this->skipLoginSteps, $this->skipApplicationSteps)); - + $this->SelectPreset(); if (!$this->currentStep) { @@ -166,7 +166,7 @@ reset($this->steps[$this->stepsPreset]); $this->currentStep = current($this->steps[$this->stepsPreset]); } - + /** * Selects preset to proceed based on various criteria * @@ -192,7 +192,7 @@ $this->stepsPreset = $preset; } - + function GetVar($name) { return isset($_REQUEST[$name]) ? $_REQUEST[$name] : false; @@ -214,7 +214,7 @@ $this->SetFirstStep(); } } - + switch ($this->currentStep) { case 'check_paths': foreach ($this->writeableFolders as $folder_path) { @@ -261,18 +261,18 @@ if (!$modules) { $this->currentStep = $this->GetNextStep(); } - break; - + break; + case 'install_setup': $next_preset = $this->Application->GetVar('next_preset'); if ($next_preset !== false && $this->Application->GetVar('login') == 'root') { // option was choosen, then verify password & login user $login_event = new kEvent('u.current:OnLogin'); $this->Application->HandleEvent($login_event); - + if ($login_event->status == erSUCCESS) { // login succeeded - + if (!isset($this->steps[$next_preset])) { $this->errorMessage = 'Preset "'.$next_preset.'" not yet implemented'; } @@ -284,7 +284,7 @@ // login failed $user =& $this->Application->recallObject('u.current'); /* @var $user UsersItem */ - + $this->errorMessage = $user->GetErrorMsg('ValidateLogin').'. If you don\'t know your username or password, contact Intechnic Support'; } } @@ -368,7 +368,7 @@ // import base data into database $this->RunSQL('/core/install/install_schema.sql'); $this->RunSQL('/core/install/install_data.sql'); - + // set module "Core" version after install (based on upgrade scripts) $this->SetModuleVersion('Core'); break; @@ -400,18 +400,15 @@ $install_file = MODULES_PATH.'/'.$module.'/install.php'; if (file_exists($install_file)) { include_once($install_file); - + // set module version after install (based on upgrade scripts) $this->SetModuleVersion($module); } } } // scan themes - $themes_helper =& $this->Application->recallObject('ThemesHelper'); - /* @var $themes_helper kThemesHelper */ + $this->Application->HandleEvent($themes_event, 'adm:OnRebuildThemes'); - $themes_helper->refreshThemes(); - $this->Conn->Query('UPDATE '.TABLE_PREFIX.'Theme SET Enabled=1, PrimaryTheme =1 LIMIT 1'); // update categories cache @@ -420,40 +417,40 @@ $updater->OneStepRun(); break; - + case 'upgrade_modules': // get installed modules from db and compare their versions to upgrade script $modules = $this->Application->GetVar('modules'); if ($modules) { $upgrade_data = $this->GetUpgradableModules(); - + foreach ($modules as $module_name) { $module_info = $upgrade_data[$module_name]; $upgrades_file = sprintf(UPGRADES_FILE, $module_info['Path']); - + $sqls = file_get_contents($upgrades_file); $version_mark = preg_replace('/(\(.*?\))/', $module_info['FromVersion'], VERSION_MARK); - + $start_pos = strpos($sqls, $version_mark); $sqls = substr($sqls, $start_pos); $this->RunSQLText($sqls); - + // after upgrade sqls are executed update version $this->SetModuleVersion($module_name, $module_info['ToVersion']); } } else { $this->errorMessage = 'Please select module(-s) to upgrade'; } - break; - + break; + case 'finish': // delete cache $sql = 'DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName IN ("config_files","configs_parsed","sections_parsed")'; $this->Conn->Query($sql); - - // set installation finished mark + + // set installation finished mark if ($this->Application->ConfigValue('InstallFinished') === false) { $fields_hash = Array ( 'VariableName' => 'InstallFinished', @@ -491,16 +488,16 @@ if ($version === false) { $version = $this->GetMaxModuleVersion($module_name); } - + $table_prefix = $this->systemConfig['Database']['TablePrefix']; - + $sql = 'UPDATE '.$table_prefix.'Modules SET Version = "'.$version.'" WHERE Name = "'.$module_name.'"'; $this->Conn->Query($sql); } - - + + /** * Sets new configuration variable value * @@ -561,14 +558,14 @@ // no upgrade file return '4.0.1'; } - + $sqls = file_get_contents($upgrades_file); $versions_found = preg_match_all('/'.VERSION_MARK.'/s', $sqls, $regs); if (!$versions_found) { // upgrades file doesn't contain version definitions return '4.0.1'; } - + return end($regs[1]); } @@ -722,7 +719,7 @@ // replace something additionally, e.g. module root category $sqls = str_replace($replace_from, $replace_to, $sqls); } - + $sqls = str_replace("\r\n", "\n", $sqls); // convert to linux line endings $sqls = preg_replace("/#(.*?)\n/", '', $sqls); // remove all comments $sqls = explode(";\n", $sqls); @@ -740,7 +737,7 @@ } } } - + function ImportLanguage($lang_file) { $lang_file = FULL_PATH.$lang_file.'.lang'; @@ -791,12 +788,12 @@ function ConvertModuleVersion($version) { $parts = explode('.', $version); - + $bin = ''; foreach ($parts as $part) { $bin .= str_pad(decbin($part), 8, '0', STR_PAD_LEFT); } - + return bindec($bin); } @@ -807,21 +804,21 @@ function GetUpgradableModules() { $ret = Array (); - + foreach ($this->Application->ModuleInfo as $module_name => $module_info) { $upgrades_file = sprintf(UPGRADES_FILE, $module_info['Path']); if (!file_exists($upgrades_file)) { // no upgrade file continue; } - + $sqls = file_get_contents($upgrades_file); $versions_found = preg_match_all('/'.VERSION_MARK.'/s', $sqls, $regs); if (!$versions_found) { // upgrades file doesn't contain version definitions continue; } - + $to_version = end($regs[1]); $this_version = $this->ConvertModuleVersion($module_info['Version']); if ($this->ConvertModuleVersion($to_version) > $this_version) { @@ -832,19 +829,19 @@ break; } } - + $version_info = Array ( 'FromVersion' => $from_version, 'ToVersion' => $to_version, ); - + $ret[$module_name] = array_merge_recursive2($module_info, $version_info); } } - + return $ret; } - + /** * Returns content to show for current step * Index: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/grid_scroller.js =================================================================== diff -u -r7725 -r7755 --- branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/grid_scroller.js (.../grid_scroller.js) (revision 7725) +++ branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/grid_scroller.js (.../grid_scroller.js) (revision 7755) @@ -157,7 +157,6 @@ // Profile('Up to col widths',1); if (!this.UpdateColWidths()) return; - if (this.Width == 'auto') { this.Resize( this.GetAutoSize() ); } Index: branches/unlabeled/unlabeled-1.4.2/core/admin_templates/js/script.js =================================================================== diff -u -r7725 -r7755 --- branches/unlabeled/unlabeled-1.4.2/core/admin_templates/js/script.js (.../script.js) (revision 7725) +++ branches/unlabeled/unlabeled-1.4.2/core/admin_templates/js/script.js (.../script.js) (revision 7755) @@ -1112,7 +1112,12 @@ } - function addEvent(el, evname, func) { + function addEvent(el, evname, func, traditional) { + if (traditional) { + eval('el.on'+evname+'='+func); + return; + } + if (is.ie) { el.attachEvent("on" + evname, func); } else { @@ -1354,12 +1359,13 @@ return [curleft,curtop]; } -function addLoadEvent(func) { - var oldonload = window.onload; - if (typeof window.onload != 'function') { - window.onload = func; +function addLoadEvent(func, wnd) { + if (!wnd) wnd = window + var oldonload = wnd.onload; + if (typeof wnd.onload != 'function') { + wnd.onload = func; } else { - window.onload = function() { + wnd.onload = function() { if (oldonload) { oldonload(); } Index: branches/unlabeled/unlabeled-1.49.2/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php =================================================================== diff -u -r7655 -r7755 --- branches/unlabeled/unlabeled-1.49.2/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php (.../commands.php) (revision 7655) +++ branches/unlabeled/unlabeled-1.49.2/admin/editor/cmseditor/editor/filemanager/browser/default/connectors/php/commands.php (.../commands.php) (revision 7755) @@ -32,28 +32,25 @@ $aFolders[] = $sFile; //echo '' ; } - + if (count($aFolders) > 0) { natcasesort($aFolders); foreach($aFolders AS $k=>$v) { echo '' ; - } + } } - - + + closedir( $oCurrentFolder ) ; // Close the "Folders" node. echo "" ; } -function ValidateSID() +function ValidateAdminSid() { - if (isset($Config['K4Mode'])) - return true; - else { $conn = GetADODbConnection(); $session_time = GetConfigValue('ses_timeout')+0; - $sid = $_COOKIE['admin_sid']; + $sid = ($_COOKIE['admin_sid'])?$_COOKIE['admin_sid']:$_COOKIE['sid']; $sql = "SELECT count( sd.sid ) FROM session_data AS sd LEFT JOIN sessions AS s ON s.sid = sd.sid @@ -62,13 +59,36 @@ AND sd.sid = '".$sid."' AND s.expire + '".$session_time."' > unix_timestamp()"; if ($conn->GetOne($sql) > 0) { - return true; - } else { - echo "SESSION Validation FALSE"; + return true; +} +function ValidateUserSid() +{ + $conn = GetADODbConnection(); + $session_time = GetConfigValue('ses_timeout')+0; + $sid = $_COOKIE['sid']; + $sql = "SELECT count( sd.sid ) + FROM sessions + sid = '".$sid."' + AND expire + '".$session_time."' > unix_timestamp()"; } + if ($conn->GetOne($sql) > 0) + return true; +} +function ValidateSID() +{ global $Config; + if (isset($Config['K4Mode'])) + return true; + else { + if ($Config['validate_type'] == 'user') + return ValidateUserSid(); + elseif ($Config['validate_type'] == 'admin') + return ValidateAdminSid(); + else + echo "SESSION Validation FALSE"; + } return false; -} +} function GetCmsTree() { @@ -92,14 +112,21 @@ if ($application->isModuleEnabled('Proj-CMS')) { $lang = $application->GetVar('m_lang'); - $query = 'SELECT CategoryId, NamedParentPath, l'.$lang.'_Title AS Title FROM '.TABLE_PREFIX.'Category ORDER By l'.$lang.'_Title'; - $pages = $application->Conn->Query($query); + $st =& $application->recallObject('st.-dummy'); + $st_options = $application->getUnitOption('st'.'.ParentId', 'Fields'); + $pages = $st_options['options']; + $page_ids = array_keys($pages); + $tpls = $application->Conn->GetCol('SELECT NamedParentPath, CategoryId FROM '.TABLE_PREFIX.'Category WHERE CategoryId IN ('.join(',', $page_ids).')', 'CategoryId'); +// $query = 'SELECT CategoryId, NamedParentPath, l'.$lang.'_Name AS Title FROM '.TABLE_PREFIX.'Category ORDER By l'.$lang.'_Title'; +// $pages = $application->Conn->Query($query); + $res = ''; - foreach ($pages as $page) { - $page_path = preg_replace('/^content\//', '', strtolower($page['NamedParentPath']).'.html'); - $title = $page['Title'].' ('.$page_path.')'; - $res .= ''; + foreach ($pages as $id => $title) { + $page_path = preg_replace('/^content\//', '', strtolower($tpls[$id]).'.html'); + $title = $title.' ('.$page_path.')'; + $real_url = $application->HREF($tpls[$id], '', null, 'index.php'); + $res .= ''; } } else { @@ -127,7 +154,6 @@ if ($rs && !$rs->EOF) { $default_lang_prefix = $rs->fields['value']; - $lang_prefix = GetLangFromSid(); } $query = "SELECT value FROM config WHERE name = 'cms_direct_mode'"; $rs = $conn->Execute($query); @@ -160,11 +186,12 @@ if (!$system_tpl_ids) $system_tpl_ids = '0'; if ( $cms_mode == 1 ) { + //$lang_prefix = $this->Application->GetVar('lang_prefix'); $query = " SELECT st.*, - IF(lb.".$lang_prefix."_content='' OR lb.".$lang_prefix."_content IS NULL, + IF(lb.".$default_lang_prefix."_content='' OR lb.".$default_lang_prefix."_content IS NULL, st.st_path, - lb.".$lang_prefix."_content + lb.".$default_lang_prefix."_content ) AS page_title FROM structure_templates AS st @@ -191,8 +218,7 @@ working_blocks AS wb ON (st.st_id = wb.template_id) AND (wb.block_type = 3) - WHERE - st.st_parent_id = ".$st_id." + WHERE st.st_parent_id = ".$st_id." AND st_id != ".$email_templates_folder_id." AND st.st_id NOT IN ($system_tpl_ids) AND st_path != '/cms%' " . $filter . " @@ -211,7 +237,7 @@ $prefix .= '--'; if ($level > 0) $prefix=$prefix.'- '; -/* +/* $page = ereg_replace("&","&",$rs->fields['page_title']); $page = ereg_replace("\"",""",$page); $page = ereg_replace("'","'",$page); @@ -252,12 +278,13 @@ function GetFoldersAndFiles( $resourceType, $currentFolder, $aParams = array('name','asc')) { + global $Config ; // Map the virtual path to the local server path. if (isset($Config['K4Mode'])) $date_format = "m/d/Y h:i A"; - else + else $date_format = GetConfigValue('date_format').' '.GetConfigValue('time_format'); - + $sServerDir = ServerMapFolder( $resourceType, $currentFolder ) ; // Initialize the output buffers for "Folders" and "Files". $aFolders = array(); @@ -280,7 +307,7 @@ { $size = round( $iFileSize / 1024 ); $aFileSizes[] = ($size < 1)? 1:$size;// round( $iFileSize / 1024 ) ; - } else + } else $aFileSizes[] = $iFileSize; $aFiles[] = $sFile; $aFileDate[] = filectime($sServerDir.$sFile); @@ -298,11 +325,11 @@ } foreach($aFolders AS $k=>$v) { $sFolders .= '' ; - } + } } if (count($aFiles) > 0) { - if ($aParams[0] == 'name') - { + if ($aParams[0] == 'name') + { natcasesort($aFiles); if ($aParams[1] == 'desc') { @@ -330,7 +357,7 @@ $sFiles .= '' ; } } - } + } /* while ( $sFile = readdir( $oCurrentFolder ) ) { if ( $sFile != '.' && $sFile != '..' && $sFile != 'CVS') @@ -348,8 +375,8 @@ $sFiles .= '' ; } } -*/ - +*/ + if ($aParams[1] == "desc") { echo $sFiles ; @@ -418,7 +445,7 @@ $sql = "UPDATE live_blocks SET ".$lang_prefix."_content = replace(".$lang_prefix."_content,'".$original_str."','".$new_str."')"; $conn->Execute($sql); } - + } function RenameFile( $resourceType, $currentFolder , $aFilenames = array()) @@ -433,15 +460,15 @@ { $sErrorNumber = '204' ; } else { - if ( ( count($arAllowed) == 0 || in_array( $sExtension, $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( $sExtension, $arDenied ) ) ) + if ( ( count($arAllowed) == 0 || in_array( strtolower($sExtension), $arAllowed ) ) && ( count($arDenied) == 0 || !in_array( strtoupper($sExtension), $arDenied ) ) ) { if (rename($sServerDir.$aFilenames[0],$sServerDir.$aFilenames[1])) { if (isset($Config['K4Mode'])) { // Update CMS Blocks } else UpdateCmsBlocksK3($resourceType,$currentFolder,$aFilenames[0],$aFilenames[1]); $sErrorNumber = "0"; - } else + } else $sErrorNumber = '205' ; } else $sErrorNumber = '203' ; @@ -463,7 +490,7 @@ // Get the uploaded file name. $sFileName = $oFile['name'] ; $sOriginalFileName = $sFileName ; - $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; + $sExtension = strtolower(substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ); global $Config ; $arAllowed = $Config['AllowedExtensions'][$resourceType] ; $arDenied = $Config['DeniedExtensions'][$resourceType] ; @@ -522,19 +549,19 @@ return; $conn = GetADODbConnection(); $aLangs = array(); - $multilang = GetConfigValue('multilingual_mode'); + $multilang = GetConfigValue('multilingual_mode'); $def_lang_prefix = GetConfigValue('default_lang_prefix'); - if ($multilang) + if ($multilang) { $query="SELECT lang_prefix FROM lang ORDER BY lang_id"; $rs = $conn->Execute($query); while ($rs && !$rs->EOF) { $aLangs[] = $rs->fields['lang_prefix']; $rs->MoveNext(); - } - } else + } + } else $aLangs[] = $def_lang_prefix; - $sErrorNumber = 230; + $sErrorNumber = 230; if ($confirm == 1) { DeleteConfirmedFiles($resourceType, $currentFolder, $aFiles); echo '' ; @@ -546,9 +573,9 @@ continue; $deleted_file = $Config['UserFilesPathNoBase'].$resourceType.$currentFolder.addslashes($v); for($i=0; $i 0) { + $add_sql.= " lb1.".$aLangs[$i]."_content LIKE '%".$deleted_file."%' OR"; + + if (strlen($add_sql) > 0) { $add_sql = rtrim($add_sql," OR"); $sql = "SELECT lb1.template_id, lb2.".$def_lang_prefix."_content FROM live_blocks AS lb1 LEFT JOIN live_blocks AS lb2 ON lb2.template_id = lb1.template_id AND lb2.block_num = 20 @@ -560,7 +587,7 @@ $page = @html_entity_decode($page,ENT_NOQUOTES,'UTF-8'); $page = @htmlspecialchars($page); $ret_xml.= '' ; - $rs->MoveNext(); + $rs->MoveNext(); } } } @@ -571,15 +598,8 @@ echo '' ; } } -} -function GetLangFromSid() { - $sid = $_COOKIE['admin_sid']; - $conn = GetADODbConnection(); - $sql = "SELECT value FROM session_data WHERE name = 'old_translation_language' AND sid = $sid"; - $translation_language = $conn->GetOne($sql); - return $translation_language; } ?> Index: branches/unlabeled/unlabeled-1.12.2/core/units/categories/categories_item.php =================================================================== diff -u -r7640 -r7755 --- branches/unlabeled/unlabeled-1.12.2/core/units/categories/categories_item.php (.../categories_item.php) (revision 7640) +++ branches/unlabeled/unlabeled-1.12.2/core/units/categories/categories_item.php (.../categories_item.php) (revision 7755) @@ -75,7 +75,8 @@ function checkFilename() { - if( !$this->GetDBField('AutomaticFilename') ) + // System templates allow any characters in filename, because they may and will contain "/" + if( !$this->GetDBField('AutomaticFilename') && !$this->GetDBField('IsSystem')) { $filename = $this->GetDBField('Filename'); $this->SetDBField('Filename', $this->stripDisallowed($filename) ); Index: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/grid.js =================================================================== diff -u -r7648 -r7755 --- branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/grid.js (.../grid.js) (revision 7648) +++ branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/grid.js (.../grid.js) (revision 7755) @@ -114,6 +114,16 @@ this.GridItem.DblClick(ev); } } + + if ( this.Grid.MouseOverClass ) { + addEvent(this.HTMLelement, 'mouseover', function(ev) { this.GridItem.MouseOver(ev)}, true); // true for traditional event model + addEvent(this.HTMLelement, 'mouseout', function(ev) { this.GridItem.MouseOut(ev)}, true); + if ( this.LeftElement ) { + addEvent(this.LeftElement, 'mouseover', function(ev) { this.GridItem.MouseOver(ev)}, true); + addEvent(this.LeftElement, 'mouseout', function(ev) { this.GridItem.MouseOut(ev)}, true); + } + } + } GridItem.prototype.DisableClicking = function () @@ -232,6 +242,21 @@ this.Grid.Edit(); } +GridItem.prototype.MouseOver = function (ev) +{ + this.HTMLelement.className = this.Grid.MouseOverClass; + if ( this.LeftElement ) { + this.LeftElement.className = this.Grid.MouseOverClass; + } +} +GridItem.prototype.MouseOut = function (ev) +{ + this.HTMLelement.className = this.selected ? this.class_on : this.class_off; + if ( this.LeftElement ) { + this.LeftElement.className = this.selected ? this.class_on : this.class_off; + } +} + GridItem.prototype.Toggle = function () { if (this.selected) this.UnSelect() @@ -263,6 +288,7 @@ this.AlternativeGrids = new Array(); this.DependantButtons = new Array(); this.RadioMode = false; + this.MouseOverClass = false; // K3-style sticky selection, selection an item does not unselect currently selected // even w/o Ctrl key pressed Index: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/tree.js =================================================================== diff -u -r7648 -r7755 --- branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/tree.js (.../tree.js) (revision 7648) +++ branches/unlabeled/unlabeled-1.3.2/core/admin_templates/js/tree.js (.../tree.js) (revision 7755) @@ -48,6 +48,8 @@ for (var i=0; i < this.Level; i++) { img = document.createElement('img'); + img.style.width = '16px'; + img.style.height = '22px'; img.src = TREE_ICONS_PATH+'/ftv2blank.gif'; img.style.verticalAlign = 'middle'; td.appendChild(img); @@ -62,6 +64,8 @@ TreeItem.prototype.appendNodeImage = function(td) { img = document.createElement('img'); + img.style.width = '16px'; + img.style.height = '22px'; img.src = this.getNodeImage(); img.style.verticalAlign = 'middle'; td.appendChild(img); @@ -70,6 +74,8 @@ TreeItem.prototype.appendIcon = function (td) { img = document.createElement('img'); + img.style.width = '24px'; + img.style.height = '22px'; if (this.Icon.indexOf('http://') != -1) { img.src = this.Icon; } @@ -408,6 +414,8 @@ TreeFolder.prototype.appendNodeImage = function(td, is_last) { img = document.createElement('img'); + img.style.width = '16px'; + img.style.height = '22px'; img.src = this.getNodeImage(is_last); img.style.cursor = 'hand'; img.style.cursor = 'pointer'; Index: branches/unlabeled/unlabeled-1.27.2/core/units/categories/categories_event_handler.php =================================================================== diff -u -r7744 -r7755 --- branches/unlabeled/unlabeled-1.27.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 7744) +++ branches/unlabeled/unlabeled-1.27.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 7755) @@ -349,7 +349,7 @@ if ($id == 0) { if ($temp_object->isLoaded()) { - // new category -> update chache (not loaded when "Home" category) + // new category -> update cache (not loaded when "Home" category) $this->Application->StoreVar('PermCache_UpdateRequired', 1); } return ; @@ -359,7 +359,7 @@ $live_object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('live_table' => true, 'skip_autoload' => true)); $live_object->Load($id); - $cached_fields = Array('Name', 'Filename', 'CategoryTemplate', 'ParentId'); + $cached_fields = Array('Name', 'Filename', 'CategoryTemplate', 'ParentId', 'Priority'); foreach ($cached_fields as $cached_field) { if ($live_object->GetDBField($cached_field) != $temp_object->GetDBField($cached_field)) { Index: branches/unlabeled/unlabeled-1.5.2/core/admin_templates/js/toolbar.js =================================================================== diff -u -r7656 -r7755 --- branches/unlabeled/unlabeled-1.5.2/core/admin_templates/js/toolbar.js (.../toolbar.js) (revision 7656) +++ branches/unlabeled/unlabeled-1.5.2/core/admin_templates/js/toolbar.js (.../toolbar.js) (revision 7755) @@ -63,7 +63,7 @@ ToolBarButton.prototype.GetHTML = function() { var add_style = this.ToolBar.ButtonStyle ? 'style="'+this.ToolBar.ButtonStyle+'"' : ''; var o = '
' - o += ''; + o += ''; if (this.ToolBar.UseLabels) o += '
'+this.Label; o += '
' return o; @@ -81,6 +81,12 @@ this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false; this.Container.btn = this; img.btn = this; + + this.MouseOverImg = new Image(); + this.MouseOverImg.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f2.gif'; + this.MouseOutImg = new Image(); + this.MouseOutImg.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif'; + this.SetOnMouseOver(); this.SetOnMouseOut(); this.SetOnClick(); @@ -132,14 +138,14 @@ ToolBarButton.prototype.SetOnMouseOver = function() { this.Container.onmouseover = function() { - this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '_f2.gif'; + this.btn.imgObject.src = this.btn.MouseOverImg.src; this.className = 'toolbar-button-over'; }; } ToolBarButton.prototype.SetOnMouseOut = function() { this.Container.onmouseout = function() { - this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif'; + this.btn.imgObject.src = this.btn.MouseOutImg.src; this.className = 'toolbar-button'; }; } @@ -188,7 +194,12 @@ ToolBarButton.prototype.Disable = function() { if ( !this.Enabled ) return; - this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f3.gif'; + + if (typeof(this.DisabledImg) == 'undefined') { + this.DisabledImg = new Image(); + this.DisabledImg.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f3.gif'; + } + this.imgObject.src = this.DisabledImg.src; this.Container.onmouseover = null; this.Container.onmouseout = null; this.Container.onclick = null; @@ -199,7 +210,7 @@ ToolBarButton.prototype.Enable = function() { if (this.Enabled) return; - this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif'; + this.imgObject.src = this.MouseOutImg.src; this.SetOnMouseOver(); this.SetOnMouseOut(); this.SetOnClick(); Index: branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php =================================================================== diff -u -r7750 -r7755 --- branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7750) +++ branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7755) @@ -713,9 +713,6 @@ if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) { $t = $cms_handler->GetDesignTemplate(); } - /*else { - $cms_handler->SetCatByTemplate(); - }*/ } Index: branches/unlabeled/unlabeled-1.5.2/core/units/admin/admin_events_handler.php =================================================================== diff -u -r7656 -r7755 --- branches/unlabeled/unlabeled-1.5.2/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 7656) +++ branches/unlabeled/unlabeled-1.5.2/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 7755) @@ -29,7 +29,7 @@ function OnResetConfigsCache(&$event) { - $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files" OR VarName = "configs_parsed"'); + $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files" OR VarName = "configs_parsed" OR VarName = "sections_parsed"'); } /** Index: branches/unlabeled/unlabeled-1.18.2/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js =================================================================== diff -u -r6800 -r7755 --- branches/unlabeled/unlabeled-1.18.2/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js (.../fck_link.js) (revision 6800) +++ branches/unlabeled/unlabeled-1.18.2/admin/editor/cmseditor/editor/dialog/fck_link/fck_link.js (.../fck_link.js) (revision 7755) @@ -377,6 +377,13 @@ { var sCmsPage = oNodes[i].attributes.getNamedItem('path').value ; var sCmsId = oNodes[i].attributes.getNamedItem('st_id').value ; + + var real_url = false; + if (sCmsPage == '@@'+sCmsId+'@@') { + real_url = oNodes[i].attributes.getNamedItem('real_url').value ; + links_path[i] = real_url; + } + var sTitle = oNodes[i].attributes.getNamedItem('title').value ; ServerPath = oNodes[i].attributes.getNamedItem('serverpath').value; if (LinkTypeID()) { @@ -403,7 +410,12 @@ if (tmpUrl.match(sCmsPage+'$')) { GetE('cmbImternalPagName').options[i].selected=1; //alert(tmpUrl+GetAdmin()); - window.frames["frmInternal"].document.location.href = tmpUrl+GetAdmin(); + if (real_url) { + window.frames["frmInternal"].document.location.href = real_url; + } + else { + window.frames["frmInternal"].document.location.href = tmpUrl+GetAdmin(); + } } } } @@ -442,7 +454,7 @@ function ChangeInternalUrl(url,obj) { // alert('ChangeInternalUrl '+ServerPath + url+GetAdmin()); - if(LinkTypeID()) { + if( LinkTypeID() || url.match(/@@[0-9]+@@/) ) { // alert('by Link ID') for (var i=0; i < obj.options.length; i++) { if (obj.options[i].value == url) { Index: branches/unlabeled/unlabeled-1.4.2/admin/editor/cmseditor/editor/dialog/fck_document.html =================================================================== diff -u -r7652 -r7755 --- branches/unlabeled/unlabeled-1.4.2/admin/editor/cmseditor/editor/dialog/fck_document.html (.../fck_document.html) (revision 7652) +++ branches/unlabeled/unlabeled-1.4.2/admin/editor/cmseditor/editor/dialog/fck_document.html (.../fck_document.html) (revision 7755) @@ -25,7 +25,7 @@
+
   - +
@@ -46,7 +46,7 @@
View In:
   - @@ -115,7 +115,7 @@    - +
Value
+
-
   -    +