Index: branches/5.1.x/core/units/selectors/selectors_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 12127) +++ branches/5.1.x/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'selectors', 'ItemClass' => Array('class'=>'SelectorsItem','file'=>'selectors_item.php','build_event'=>'OnItemBuild'), 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), @@ -142,6 +144,4 @@ ), ), ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/kernel/utility/http_query.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 12657) @@ -1,6 +1,6 @@ Get = $this->AddVars($_GET); + if (array_key_exists('sid', $_GET)) { + $this->_sidInQueryString = true; + } + $vars = $this->processQueryString( $this->Get(ENV_VAR_NAME) ); + + if (array_key_exists('sid', $vars)) { + // used by Session::GetPassedSIDValue + $this->Get['sid'] = $vars['sid']; + } + $this->AddParams($vars); break; @@ -221,15 +240,13 @@ // $this->convertPostEvents(); // if ($this->Application->RewriteURLs()) { if ($this->Application->RewriteURLs() || $this->Get('_mod_rw_url_')) { - if( $this->Application->isDebugMode() ) - { + if (defined('DEBUG_MODE') && $this->Application->isDebugMode()) { $this->Application->Debugger->profileStart('url_parsing'); $this->processRewriteURL(); $description = 'Parsing MOD_REWRITE url (template: '.$this->Get('t').')'; $this->Application->Debugger->profileFinish('url_parsing', $description); } - else - { + else { $this->processRewriteURL(); } } @@ -375,26 +392,19 @@ function extractSIDAndTemplate(&$parts) { $vars = Array (); - if (defined('INPORTAL_ENV') && INPORTAL_ENV) { // SID-TEMPLATE - $sub_parts = array_shift($parts); - list($sid, $t) = explode('-', $sub_parts, 2); + $sub_parts = array_shift($parts); + list ($sid, $t) = explode('-', $sub_parts, 2); + + if ($sid) { // Save Session ID - if ($sid) { - $this->Set('sid', $sid); - $vars['sid'] = $sid; - } + $this->Set('sid', $sid); + $vars['sid'] = $sid; } - else { // SID:TEMPLATE - // Save Session ID - $sid = array_shift($parts); - if ($sid) $vars['sid'] = $sid; - $t = array_shift($parts); - } - // Save Template Name $vars['t'] = $this->getDefaultTemplate($t); + return $vars; } @@ -493,7 +503,7 @@ */ function getTemplateName($t) { - if (isset($this->Get['t']) && $this->Get['t']) { + if (array_key_exists('t', $this->Get) && $this->Get['t']) { // template name is passed directly in url (GET method) $t = $this->Get['t']; } @@ -503,13 +513,6 @@ $t = $this->Get('t'); } - if (is_numeric($t)) { - $sql = 'SELECT CONCAT(FilePath, \'/\', FileName) - FROM '.TABLE_PREFIX.'ThemeFiles - WHERE FileId = '.$t; - $t = $this->Conn->GetOne($sql); - } - return preg_replace('/\.tpl$/', '', $t); } @@ -571,27 +574,33 @@ */ function getRedirectParams($access_error = false) { + $vars = $this->Get; $unset_vars = Array (ENV_VAR_NAME, 'rewrite', '_mod_rw_url_', 'Action'); - $ret = $this->Get; + if (!$this->_sidInQueryString) { + $unset_vars[] = 'sid'; + } + + // remove system variables foreach ($unset_vars as $var_name) { - if( isset($ret[$var_name]) ) { - unset( $ret[$var_name] ); + if (array_key_exists($var_name, $vars)) { + unset($vars[$var_name]); } } if ($access_error) { - $ret = $this->_removePassThroughVariables($ret); + $vars = $this->_removePassThroughVariables($vars); if ($this->Application->IsAdmin()) { // place 1 of 2 (also in UsersEventHandler::OnSessionExpire) - $ret['m_cat_id'] = 0; // category means nothing on admin login screen - $ret['m_wid'] = ''; // remove wid, otherwise parent window may add wid to its name breaking all the frameset (for targets) - $ret['pass'] = 'm'; // don't pass any other (except "m") prefixes to admin login template + $vars['m_cat_id'] = 0; // category means nothing on admin login screen + $vars['m_wid'] = ''; // remove wid, otherwise parent window may add wid to its name breaking all the frameset (for targets) + $vars['pass'] = 'm'; // don't pass any other (except "m") prefixes to admin login template } } - return $ret; + // transform arrays + return $this->_transformArrays($vars); } /** @@ -617,6 +626,23 @@ return $url_params; } + function _transformArrays($array, $level_prefix = '') + { + $ret = Array (); + foreach ($array as $var_name => $var_value) { + $new_var_name = $level_prefix ? $level_prefix . '[' . $var_name . ']' : $var_name; + + if (is_array($var_value)) { + $ret = array_merge($ret, $this->_transformArrays($var_value, $new_var_name)); + } + else { + $ret[$new_var_name] = $var_value; + } + } + + return $ret; + } + function writeRequestLog($filename) { $folder_path = dirname(FULL_PATH.'/'.$filename); @@ -653,6 +679,4 @@ } } -} - -?> \ No newline at end of file +} \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_related_search.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_e-mail.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/install/incs/install.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/install/incs/install.tpl (.../install.tpl) (revision 12127) +++ branches/5.1.x/core/install/incs/install.tpl (.../install.tpl) (revision 12657) @@ -1,12 +1,14 @@ + In-Portal Installation - + + @@ -18,12 +20,11 @@ - - + - +
In-PortalIn-PortalIn-Portal   blocks
In-Portal Version toolkit->GetMaxModuleVersion('Core'); ?>: English US
In-Portal: English US
blocks2

@@ -58,30 +59,57 @@ GetStepNumber().' - '.$this->GetStepInfo('step_title'); ?> + - - - - - - - -
- - Save
-
-
- Cancel
-
 
- + buttonVisible('any')) { + ?> + + + + + + + +
+ +
+ + + - - - + errorMessage) && $this->errorMessage) { + ?> + + + + + + @@ -143,7 +180,7 @@ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_affiliate_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/general/libchart/classes/view/chart/BarChart.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/chart/BarChart.php (.../BarChart.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/chart/BarChart.php (.../BarChart.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * Base abstract class for rendering both horizontal and vertical bar charts. * @@ -170,5 +172,4 @@ return $pointList; } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_language_var.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/blue_bar_help.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/languages/languages_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Application->SetVar('skip_last_template', 1); } + elseif (MOD_REWRITE) { + $mod_rewrite_helper =& $this->Application->recallObject('ModRewriteHelper'); + /* @var $mod_rewrite_helper kModRewriteHelper */ + $mod_rewrite_helper->removePages(); + } + //$this->Application->LinkVar('language', 'm_lang'); } @@ -416,6 +424,7 @@ $q = 'CREATE TABLE ' . $tmp_name . ' SELECT source.Phrase, + source.PhraseKey, source.Translation, source.PhraseType, NULL As PhraseId, @@ -432,6 +441,4 @@ $this->Conn->Query('DROP TABLE ' . $tmp_name); } - } - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/reviews/reviews_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/reviews/reviews_event_handler.php (.../reviews_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/reviews/reviews_event_handler.php (.../reviews_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Application->GetTopmostPrefix($event->Prefix, true); // this will return LINK for l, ARTICLE for n, TOPIC for bb, PRODUCT for p - $item_prefix = $this->Application->getUnitOption($main_prefix, 'PermItemPrefix'); - return $item_prefix; + return $this->Application->getUnitOption($main_prefix, 'PermItemPrefix'); } /** @@ -326,21 +327,67 @@ $spam_helper->InitHelper($parent_info['ParentId'], 'Review', $review_settings); $spam_helper->AddToSpamControl(); + + $review_status = $object->GetDBField('Status'); + + if ($review_status == STATUS_ACTIVE || $review_status == STATUS_PENDING) { + $email_event = $this->getPermPrefix($event) . '.REVIEW.' . ($review_status == STATUS_ACTIVE ? 'ADD' : 'ADD.PENDING'); + $this->Application->EmailEventUser($email_event, $object->GetDBField('CreatedById')); + $this->Application->EmailEventAdmin($email_event); + } } } - /** * Updates item review counter * * @param kEvent $event */ function OnAfterItemUpdate(&$event) { + parent::OnAfterItemUpdate($event); + $this->updateSubitemCounters($event); + + $object =& $event->getObject(); + /* @var $object kDBItem */ + + if ($this->Application->IsAdmin() && !$object->IsTempTable()) { + // send email on review status change from reviews grid in admin + $review_status = $object->GetDBField('Status'); + $process_status = Array (STATUS_ACTIVE, STATUS_DISABLED); + + if (($review_status != $object->GetOriginalField('Status')) && in_array($review_status, $process_status)) { + $this->_loadMainObject($event); + + $email_event = $this->getPermPrefix($event) . '.REVIEW.' . ($review_status == STATUS_ACTIVE ? 'APPROVE' : 'DENY'); + $this->Application->EmailEventUser($email_event, $object->GetDBField('CreatedById')); + } + } } /** + * Loads main object of review (link, article, etc.) + * + * @param kEvent $event + * @return kCatDBItem + */ + function _loadMainObject(&$event) + { + $object =& $event->getObject(); + /* @var $object kDBItem */ + + $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); + $parent_table_key = $this->Application->getUnitOption($event->Prefix, 'ParentTableKey'); + $foreign_key = $this->Application->getUnitOption($event->Prefix, 'ForeignKey'); + + $main_object =& $this->Application->recallObject($parent_prefix, null, Array ('skip_autoload' => true)); + /* @var $main_object kDBItem */ + + $main_object->Load($object->GetDBField($foreign_key), $parent_table_key); + } + + /** * Updates total review counter, cached rating, votes count * * @param kEvent $event @@ -496,6 +543,4 @@ } return $title_field; } - } - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/fck/fck_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/fck/fck_config.php (.../fck_config.php) (revision 12127) +++ branches/5.1.x/core/units/fck/fck_config.php (.../fck_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'fck', @@ -45,6 +47,4 @@ // 'CustomDataId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), // 'ResourceId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_language_var_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_selector_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/install/step_templates/check_paths.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/install/step_templates/check_paths.tpl (.../check_paths.tpl) (revision 12127) +++ branches/5.1.x/core/install/step_templates/check_paths.tpl (.../check_paths.tpl) (revision 12657) @@ -3,17 +3,24 @@ ?> - + toolkit->getSystemConfig('Misc', 'WriteablePath'); foreach ($this->writeableFolders as $folder_path) { - $file_path = FULL_PATH . str_replace('$1', $writeable_base, $folder_path); - if (file_exists($file_path)) { - $folder_status = !is_writable($file_path) ? 'FAILED' : 'OK'; - echo sprintf($folder_tpl, $file_path, $folder_status); + $file_path = str_replace('$1', $writeable_base, $folder_path); + if (file_exists(FULL_PATH . $file_path)) { + if (!is_writable(FULL_PATH . $file_path)) { + $folder_status = '[FAILED]'; + $error_message = ' (777 required)'; + } + else { + $folder_status = '[OK]'; + $error_message = ''; + } + echo sprintf($folder_tpl, $file_path . $error_message, $folder_status); } } ?> \ No newline at end of file Index: branches/5.1.x/core/units/general/libchart/classes/view/primitive/Padding.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/primitive/Padding.php (.../Padding.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/primitive/Padding.php (.../Padding.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * A padding. * @@ -64,5 +66,4 @@ $this->left = $left; } } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon46_tool_import.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_custom.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/favorites/favorites_eh.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/favorites/favorites_eh.php (.../favorites_eh.php) (revision 12127) +++ branches/5.1.x/core/units/favorites/favorites_eh.php (.../favorites_eh.php) (revision 12657) @@ -1,6 +1,6 @@ Conn->Query($sql); } -} - - -?> \ No newline at end of file +} \ No newline at end of file Index: branches/5.1.x/core/kernel/utility/event.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/event.php (.../event.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/event.php (.../event.php) (revision 12657) @@ -1,6 +1,6 @@ 1) { - array_unshift($args, $this->specificParams); + array_unshift_ref($args, $this->specificParams); + return call_user_func_array('getArrayValue', $args); // getArrayValue($this->specificParams, $name); } return isset($this->specificParams[$name]) ? $this->specificParams[$name] : false; @@ -329,6 +332,4 @@ return $section; } - } - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/sections/site_config_tp.php =================================================================== diff -u -N -r12495 -r12657 --- branches/5.1.x/core/units/sections/site_config_tp.php (.../5.0.x/core/units/sections/site_config_tp.php) (revision 12495) +++ branches/5.1.x/core/units/sections/site_config_tp.php (.../5.1.x/core/units/sections/site_config_tp.php) (revision 12657) @@ -1,6 +1,6 @@ 'nparser', 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), Index: branches/5.1.x/core/admin_templates/groups/groups_list.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/groups/groups_list.tpl (.../groups_list.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/groups/groups_list.tpl (.../groups_list.tpl) (revision 12657) @@ -15,7 +15,7 @@ } var a_toolbar = new ToolBar(); - a_toolbar.AddButton( new ToolBarButton('new_group', '', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { set_hidden_field('remove_specials[g.total]', 1); std_precreate_item('g.total', 'groups/groups_edit') Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_recalculate_order.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_agent.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/agents/agents_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/agents/agents_config.php (.../agents_config.php) (revision 12127) +++ branches/5.1.x/core/units/agents/agents_config.php (.../agents_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'agent', 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -58,11 +60,11 @@ 'agent_list' => Array ( 'prefixes' => Array ('agent_List'), 'format' => "!la_title_Agents!", - 'toolbar_button' => Array ('new_agent', 'edit', 'delete', 'approve', 'decline', 'cancel', 'view', 'dbl-click'), + 'toolbar_buttons' => Array ('new_agent', 'edit', 'delete', 'approve', 'decline', 'cancel', 'view', 'dbl-click'), ), 'agent_edit' => Array ('prefixes' => Array ('agent'), 'format' => "#agent_status# '#agent_titlefield#'", - 'toolbar_button' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), + 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), ), ), @@ -71,7 +73,7 @@ 'Sections' => Array ( 'in-portal:agents' => Array ( 'parent' => 'in-portal:website_setting_folder', - 'icon' => 'agents', + 'icon' => 'conf_agents', 'label' => 'la_title_Agents', 'url' => Array('t' => 'agents/agent_list', 'pass' => 'm'), 'permissions' => Array('view', 'add', 'edit', 'delete'), @@ -134,18 +136,21 @@ 'Grids' => Array ( 'Default' => Array ( - 'Icons' => Array ('default' => 'icon16_agent.gif'), + 'Icons' => Array ( + 'default' => 'icon16_item.png', + 0 => 'icon16_disabled.png', + ), 'Fields' => Array ( - 'AgentId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ), - 'AgentName' => Array ('title' => 'la_col_Name', 'filter_block' => 'grid_like_filter',), - 'AgentType' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter',), - 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter',), - 'Event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter',), - 'RunInterval' => Array ('title' => 'la_col_RunInterval', 'filter_block' => 'grid_range_filter',), - 'RunMode' => Array ('title' => 'la_col_RunMode', 'filter_block' => 'grid_options_filter',), - 'LastRunOn' => Array ('title' => 'la_col_LastRunOn', 'filter_block' => 'grid_date_range_filter',), - 'LastRunStatus' => Array ('title' => 'la_col_LastRunStatus', 'filter_block' => 'grid_options_filter',), - 'NextRunOn' => Array ('title' => 'la_col_NextRunOn', 'filter_block' => 'grid_date_range_filter',), + 'AgentId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ), + 'AgentName' => Array ('title' => 'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'AgentType' => Array ('title' => 'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 60, ), + 'Event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', 'width' => 280, ), +// 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 65, ), + 'RunInterval' => Array ('title' => 'la_col_RunInterval', 'filter_block' => 'grid_range_filter', 'width' => 100, ), + 'RunMode' => Array ('title' => 'la_col_RunMode', 'filter_block' => 'grid_options_filter', 'width' => 85, ), + 'LastRunOn' => Array ('title' => 'la_col_LastRunOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), + 'LastRunStatus' => Array ('title' => 'la_col_LastRunStatus', 'filter_block' => 'grid_options_filter', 'width' => 120, ), + 'NextRunOn' => Array ('title' => 'la_col_NextRunOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), ), ), ), Index: branches/5.1.x/core/units/admin/admin_events_handler.php =================================================================== diff -u -N -r12453 -r12657 --- branches/5.1.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 12453) +++ branches/5.1.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Application->isDebugMode(false) && in_array($event->Name, $system_events)) { - return true; + if (in_array($event->Name, $system_events)) { + // events from "Tools -> System Tools" section are controlled via that section "edit" permission + $perm_value = $this->Application->CheckPermission($event->getSection() . '.edit'); } $tools_events = Array ( @@ -62,15 +67,18 @@ ); if (array_key_exists($event->Name, $tools_events)) { - return $this->Application->CheckPermission($tools_events[$event->Name]); + $perm_value = $this->Application->CheckPermission($tools_events[$event->Name]); } if ($event->Name == 'OnSaveMenuFrameWidth') { - if (!$this->Application->IsAdmin() || !$this->Application->LoggedIn()) { - return false; - } + $perm_value = $this->Application->IsAdmin() && $this->Application->LoggedIn(); + } - return true; + if (isset($perm_value)) { + $perm_helper =& $this->Application->recallObject('PermissionsHelper'); + /* @var $perm_helper kPermissionsHelper */ + + return $perm_helper->finalizePermissionCheck($event, $perm_value); } return parent::CheckPermission($event); @@ -105,34 +113,88 @@ $event->status = erSTOP; } - $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"'); + $sql = 'DELETE FROM ' . TABLE_PREFIX . 'Cache + WHERE VarName = "sections_parsed"'; + $this->Conn->Query($sql); + if (isset($this->Application->Memcached)) { $this->Application->Memcached->delete('master:sections_parsed'); } + + $event->SetRedirectParam('refresh_tree', 1); } function OnResetConfigsCache(&$event) { if ($this->Application->GetVar('ajax') == 'yes') { $event->status = erSTOP; } - $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files" OR VarName = "configs_parsed" OR VarName = "sections_parsed"'); + + $sql = 'DELETE FROM ' . TABLE_PREFIX . 'Cache + WHERE VarName IN("config_files", "configs_parsed", "sections_parsed")'; + $this->Conn->Query($sql); + if (isset($this->Application->Memcached)) { $this->Application->Memcached->delete('master:config_files'); $this->Application->Memcached->delete('master:configs_parsed'); $this->Application->Memcached->delete('master:sections_parsed'); } + + $event->SetRedirectParam('refresh_tree', 1); } function OnCompileTemplates(&$event) { $compiler =& $this->Application->recallObject('NParserCompiler'); /* @var $compiler NParserCompiler */ + $compiler->CompileTemplatesStep(); $event->status = erSTOP; } /** + * Deletes all compiled templates + * + * @param kEvent $event + */ + function OnDeleteCompiledTemplates(&$event) + { + if ($this->Application->GetVar('ajax') == 'yes') { + $event->status = erSTOP; + } + + $base_path = WRITEABLE . DIRECTORY_SEPARATOR . 'cache'; + + // delete debugger reports + $debugger_reports = glob($base_path . '/debug_@*@.txt'); + + foreach ($debugger_reports as $debugger_report) { + unlink($debugger_report); + } + + $this->_deleteCompiledTemplates($base_path); + } + + function _deleteCompiledTemplates($folder, $unlink_folder = false) + { + $sub_folders = glob($folder . '/*', GLOB_ONLYDIR); + + foreach ($sub_folders as $sub_folder) { + $this->_deleteCompiledTemplates($sub_folder, true); + } + + $files = glob($folder . '/*.php'); + + foreach ($files as $file) { + unlink($file); + } + + if ($unlink_folder) { + rmdir($folder); + } + } + + /** * Generates sturcture for specified table * * @param kEvent $event @@ -171,7 +233,7 @@ // 1. prepare config keys $grids = Array ( 'Default' => Array ( - 'Icons' => Array ('default' => 'icon16_custom.gif'), + 'Icons' => Array ('default' => 'icon16_item.png'), 'Fields' => Array (), ) ); @@ -552,7 +614,7 @@ $value = $this->Application->GetVar('Filedata'); if (!$value) return ; - $tmp_path = WRITEABLE.'/tmp/'; + $tmp_path = WRITEABLE . '/tmp/'; $fname = $value['name']; $id = $this->Application->GetVar('id'); if ($id) $fname = $id.'_'.$fname; Index: branches/5.1.x/core/units/general/inp1_parser.php =================================================================== diff -u -N --- branches/5.1.x/core/units/general/inp1_parser.php (revision 12127) +++ branches/5.1.x/core/units/general/inp1_parser.php (revision 0) @@ -1,175 +0,0 @@ -InportalInited) { - $this->InitInPortal(); - } - // in case Parsing was called through InitInPortal -> moudles -> frontaction -> emailevent - // we need to make sure old parser is initialized - $this->InitParser(); - $template_body = $objTemplate->ParseTemplateFromBuffer($tname, $template_body); - return $template_body; - } - - if (!$this->InportalInited) { - //$save_t = $this->Application->GetVar('t'); - $this->InitInPortal(); - $var_list['t'] = $this->cutTPL($var_list['t']); - if($var_list['t'] != $this->Application->GetVar('t')) - { - $get = $_GET; - unset($get['env'], $get['Action'], $get['_mod_rw_url_'], $get['rewrite']); - $this->Application->StoreVar('K4_Template_Referer', $this->Application->GetVar('t') ); - - $this->Application->Redirect($var_list['t'], $get); - } - } - - $var_list['t'] = $this->cutTPL($var_list['t']); - - if ($var_list['t'] != $this->Application->GetVar('t')) { - //$var_list['t'] = rtrim($var_list['t'],'.tpl'); - $t = $var_list['t']; - $this->Application->SetVar('t', $t); - $template_cache =& $this->Application->recallObject('TemplatesCache'); - $template_body = $this->Application->Parser->Parse( $template_cache->GetTemplateBody($t), $t, 0 ); - } - else { - $this->InitParser(); - $template_body = $objTemplate->ParseTemplateFromBuffer($tname, $template_body); - } - return $template_body; - } - - function cutTPL($tname) - { - if( substr($tname,-4) == '.tpl' ) - { - return substr($tname, 0, strlen($tname)-4 ); - } - return $tname; - } - - function InitParser() - { - global $objTemplate, $CurrentTheme, $objThemes, $var_list; - if ($this->InpParsetInited) return true; - - $theme_id = $this->Application->IsAdmin() ? 1 : $this->Application->GetVar('m_theme'); - if ($theme_id) { - $CurrentTheme = $objThemes->GetItem($theme_id); - - $timeout = $CurrentTheme->Get('CacheTimeout'); - - $objTemplate = new clsTemplateList(FULL_PATH.THEMES_PATH.'/'); - } - - $this->InpParsetInited = true; - } - - function InitInPortal() - { - $this->InportalInited = true; - /*global $pathtoroot, $FrontEnd, $indexURL, $rootURL, $secureURL, $var_list, $CurrentTheme, - $objThemes, $objConfig, $m_var_list, $timeout, $objLanguages, - $TemplateRoot, $objTemplate, $html, $objSession, $Errors, $objCatList, $objUsers, - $env, $mod_prefix, $ExtraVars, $timestart, $timeend, $timeout, $sqlcount, $totalsql, - $template_path, $modules_loaded, $mod_root_cats, $objModules, $objItemTypes;*/ - - - global $sec, $usec, $timestart, $pathtoroot, $FrontEnd, $indexURL, $kernel_version, $FormError, - $FormValues, $ItemTables, $KeywordIgnore, $debuglevel, - $LogLevel, $LogFile, $rq_value, $rq_name, $dbg_constMap, $dbg_constValue, $dbg_constName, - $debugger, $g_LogFile, $LogData, $Errors, - $g_DebugMode, $totalsql, $sqlcount, $objConfig, $ItemTypePrefixes, $ItemTagFiles, $objModules, - $objSystemCache, $objBanList, $objItemTypes, $objThemes, $objLanguages, $objImageList, $objFavorites, - $objUsers, $objGroups, $DownloadId, $objPermissions, $objPermCache, $m_var_list, $objCatList, - $objCustomFieldList, $objCustomDataList, $objCountCache, $CRLF, $objMessageList, $objEmailQueue, - $ExtraVars, $adodbConnection, $sql, $rs, $mod_prefix, $modules_loaded, $name, - $template_path, $mod_root_cats, $value, $mod, $ItemTypes, - $ParserFiles, $SessionQueryString, $var_list, $objSession, - $orderByClause, $TemplateRoot, $ip, $UseSession, $Action, $CookieTest, $sessionId, - $var_list_update, $CurrentTheme, $UserID, $objCurrentUser, - $folder_name, $objLinkList, $tag_override, $timeZones, $siteZone, $serverZone, - $lastExpire, $diffZone, $date, $nowDate, $lastExpireDate, $SearchPerformed, - $TotalMessagesSent, $ado, $adminDir, $rootURL, $secureURL, $html, $timeout, - $pathchar, $objTemplate, $objTopicList, $objArticleList, $objPostingList, $objCensorList, - $objSmileys, $objPMList, $SubscribeAddress, $SubscribeError, $SubscribeResult, $application, - $FCKeditorBasePath; - - $pathtoroot = FULL_PATH.'/'; - - if (!file_exists(FULL_PATH.'/config.php')) { - echo "In-Portal is probably not installed, or configuration file is missing.
"; - echo "Please use the installation script to fix the problem.

"; - echo "Go to installation script

"; - flush(); - $this->Application->ApplicationDie(); - } - - //ob_start(); - $FrontEnd = 1; - - $indexURL="../../index.php"; //Set to relative URL from the theme directory - - /* initalize the in-portal system */ - include_once(FULL_PATH."/kernel/startup.php"); - - $rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); - $secureURL = $rootURL; - - if( !$var_list['t'] ) $var_list['t'] = 'index'; - - $this->InitParser(); - - // process referer in session: begin - if (is_object($objSession)) { - $k4_referer = $objSession->GetVariable('K4_Template_Referer'); - if ($k4_referer) { - $_local_t = $k4_referer; - $this->Application->RemoveVar('K4_Template_Referer'); - } - $objSession->SetVariable('Template_Referer', isset($_local_t) ? $_local_t : ''); - } - // process referer in session: end - - if ($this->Application->isDebugMode() && $Action) { - $this->Application->Debugger->setHTMLByIndex(1, 'Front Action: '.$Action.'', 'append'); - } - - LogEntry("Output Complete\n"); - - $timeend = getmicrotime(); - $diff = $timeend - $timestart; - - LogEntry("\nTotal Queries Executed: $sqlcount in $totalsql seconds\n"); - LogEntry("\nPage Execution Time: $diff seconds\n", true); - if ($LogFile) { - fclose($LogFile); - } - } -} - -?> \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_language_var.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/pdf/pdf_text.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/pdf/pdf_text.php (.../pdf_text.php) (revision 12127) +++ branches/5.1.x/core/units/pdf/pdf_text.php (.../pdf_text.php) (revision 12657) @@ -1,6 +1,6 @@ SetData($data, 0); } - + function SetData($data) { $this->Data = $data; } - + function Init() { parent::Init(); $this->SetCSSProperty('display', 'inline'); } - + function ComputeCSSProperties() { parent::ComputeCSSProperties(); // http://manual.prod.intechnic.lv/css21/text.html#q8 - + $whitespace = str_replace('-', '', $this->GetCSSProperty('white-space')); // remove "-" to avoid confusion if ($whitespace == 'normal' || $whitespace == 'nowrap' || $whitespace == 'preline') { $this->Data = preg_replace('/[\n]{1}[\t\\r ]{1}|[\t\\r ]{1}[\n]{1}/', "\n", $this->Data); @@ -57,7 +60,7 @@ $this->Data = preg_replace('/\t/', ' ', $this->Data); $this->Data = preg_replace('/ [ ]+/', ' ', $this->Data); } - + $transform = $this->GetCSSProperty('text-transform'); if ($transform == 'uppercase') { $this->Data = strtoupper($this->Data); @@ -69,46 +72,46 @@ $this->Data = ucwords($this->Data); } } - + function CheckDimensions() { $font_size = $this->GetCSSProperty('font-size'); $this->Helper->PDF->SetFont( $this->GetCSSProperty('font-family'), $font_size, $this->GetCSSProperty('font-weight'), $this->GetCSSProperty('font-style'), $this->GetCSSProperty('font-variant')); $this->Ascent = $this->Helper->PDF->GetAscent(); $this->Descent = -$this->Helper->PDF->GetDescent(); // ((-$font->getDescent() / $units) * $size); $this->Gap = $this->Helper->PDF->GetLineGap(); // (($font->getLineGap() / $units) * $size); - + // proportionally fit ascent & descent into font-size. Wiered why they are greater... if ($this->Ascent + $this->Descent > $font_size) { $this->Ascent = $this->Ascent/($this->Ascent+$this->Descent)*$font_size; $this->Descent = $this->Descent/($this->Ascent+$this->Descent)*$font_size; } - + if ($this->Helper->DimensionsMode == kPDFHelper::DM_SKIP) { return ; } - + if ($this->Node->Name == 'BR') { $this->ContentHeight = $this->Ascent + $this->Descent + $this->Gap; $this->SetCSSProperty('height', $this->ContentHeight); $this->NextLine(''); $this->GetLineBox()->Closed(); - return ; + return ; } - + $whitespace = str_replace('-', '', $this->GetCSSProperty('white-space')); // remove "-" to avoid confusion - + if (!$this->Data) { parent::CheckDimensions(); return; } - + $this->Wrap2($whitespace); - + $this->GetLineBox()->Closed(); parent::CheckDimensions(); } - + function CalcMinMaxContentWidth() { $font_size = $this->GetCSSProperty('font-size'); @@ -126,16 +129,16 @@ $this->MinContentWidth = $min_w; parent::CalcMinMaxContentWidth(); } - + function Wrap2($whitespace) { $start = $this->GetLineBox()->CurX; - + $data = $this->Data; - + if ($this->Parent->FirstChild === $this && ($whitespace == 'normal' || $whitespace == 'nowrap' || $whitespace == 'preline')) { $data = ltrim($data); } - + $words = preg_split('/([ \[\]\+\(\)]{1})/u', $data, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); $words_count = count($words); $i = 0; @@ -146,17 +149,17 @@ $word_w = $this->Helper->PDF->GetStringWidth($words[$i]); if ( (floor($max_width - $start - $elem_w - $word_w) < 0) && ($i > 0 || $start > 0) ) { $line_break = true; - break; + break; } $elem_w += $word_w; $i++; } // remove space at the end of line // @todo Find a way to detect a space at the end of last line, which is NOT wrapped // otherwise right-aligned blocks will have a space at the end of last line - if ( ($i > 0 && $words[$i-1]) == ' ' && $line_break && + if ( ($i > 0 && $words[$i-1]) == ' ' && $line_break && ($whitespace == 'normal' || $whitespace == 'nowrap' || $whitespace == 'preline') - ) { + ) { $i--; $elem_w -= $this->Helper->PDF->GetStringWidth($words[$i]); array_splice($words, $i, 1); @@ -186,13 +189,13 @@ } while ($elem && $elem->GetDisplayLevel() == 'inline'); $elem->Spacers += $spacers; $this->GetLineBox()->CurX = $start + $elem_w; - + if ($i < $words_count) { $this->NextLine(join( $words )); } } } - + function GetFollowingSiblings() { $cur_line = $this->GetLineBox(); @@ -204,15 +207,15 @@ } while ( $elem && !($elem instanceof kPDFLine) ); return $cur_line->RemoveChildren($cur_pos+1); } - + function CreateNextLine() { $cur_line = $this->GetLineBox(); $cur_line->Closed(); if ($this->Node->Name != 'BR') $cur_line->LastLine = false; - return $cur_line->Parent->AddChild( new kPDFLine($cur_line->Parent->Node, $this->Helper), true, $cur_line); + return $cur_line->Parent->AddChild( new kPDFLine($cur_line->Parent->Node, $this->Helper), true, $cur_line); } - + function NextLine($words) { $removed = $this->GetFollowingSiblings(); @@ -221,22 +224,22 @@ $new_elem = $next_line->AddChild( new kPDFTextElement( $words, $this->Node, $this->Helper )); $new_elem->Closed(); } - + foreach ($removed as $elem) { $next_line->AddChild( $elem, false ); //don't init } } - + function DrawAt($page, $x, $y, $spacer_w=0) { $page->SetLineWidth(0.1); - + $y += $this->Ascent; //finding baseline $this->Helper->PDF->SetFont( $this->GetCSSProperty('font-family'), $this->GetCSSProperty('font-size'), $this->GetCSSProperty('font-weight'), $this->GetCSSProperty('font-style'), $this->GetCSSProperty('font-variant')); if ($color = $this->GetCSSProperty('color')) { $page->SetFillColor($color); } - + if (defined('PDF_DEBUG_NO_TEXT')) return ; if ($spacer_w == 0) { $data = preg_replace('/\xA0/u', ' ', $this->Data); @@ -254,5 +257,5 @@ } $this->CurX = $x; } - + } \ No newline at end of file Index: branches/5.1.x/core/units/pdf/pdf_renderer_zend.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/pdf/pdf_renderer_zend.php (.../pdf_renderer_zend.php) (revision 12127) +++ branches/5.1.x/core/units/pdf/pdf_renderer_zend.php (.../pdf_renderer_zend.php) (revision 12657) @@ -1,6 +1,6 @@ PDF = new Zend_Pdf(); $this->PDF->pages[] = ($page1 = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4)); $this->CurPage = $page1; } - + function GetWidth() { return $this->CurPage->getWidth(); } - + function GetHeight() { return $this->CurPage->getHeight(); } - + function SetFont($font, $size) { $mapping = array( @@ -59,62 +61,62 @@ $this->CurFontSize = $size; return $this->CurPage->setFont($this->CurFont, $size); } - + function SetFontSize($size) { $this->SetFont($this->CurFont, $size); } - + function SetFillColor($color) { return $this->CurPage->setFillColor( new Zend_Pdf_Color_HTML($color) ); } - + function SetLineColor($color) { return $this->CurPage->setLineColor( new Zend_Pdf_Color_HTML($color) ); } - - function SetLineWidth($width) + + function SetLineWidth($width) { return $this->CurPage->setLineWidth($width); } - + function DrawLine($x1, $y1, $x2, $y2) { return $this->CurPage->drawLine($x1, $y1, $x2, $y2); } - + function DrawRectangle($x1, $y1, $x2, $y2, $mode) { return $this->CurPage->drawRectangle($x1, $y1, $x2, $y2, $mode); } - + function DrawText($x, $y, $text) { return $this->CurPage->drawText($x, $y, $text); } - + function GetPDFString() { return $this->PDF->render(); } - + function GetAscent() { return ($this->CurFont->getAscent() / $this->CurFont->getUnitsPerEm()) * $this->CurFontSize; } - + function GetDescent() { return ($this->CurFont->getDescent() / $this->CurFont->getUnitsPerEm()) * $this->CurFontSize; } - + function GetLineGap() { return ($this->CurFont->getLineGap() / $this->CurFont->getUnitsPerEm()) * $this->CurFontSize; } - + function GetStringWidth($string) { $drawingString = iconv('UTF-8', 'UTF-16BE//IGNORE', $string); Index: branches/5.1.x/core/units/pdf/pdf_helper.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/pdf/pdf_helper.php (.../pdf_helper.php) (revision 12127) +++ branches/5.1.x/core/units/pdf/pdf_helper.php (.../pdf_helper.php) (revision 12657) @@ -1,6 +1,6 @@ Application->InitParser(); - $xml = $this->Application->Parser->ParseTemplate($template, 1, $template_params); + + $this->Application->Parser->SetParams($template_params); + $xml = $this->Application->Parser->Run($template); + $xml_helper =& $this->Application->recallObject('kXMLHelper'); /* @var $xml_helper kXMLHelper */ @@ -1004,4 +1009,4 @@ $this->SetCSSProperty('padding-bottom', '0'); } -} +} \ No newline at end of file Index: branches/5.1.x/core/kernel/utility/adodb-time.inc.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/adodb-time.inc.php (.../adodb-time.inc.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/adodb-time.inc.php (.../adodb-time.inc.php) (revision 12657) @@ -12,15 +12,12 @@ and originally found at http://www.php.net/manual/en/function.mktime.php ============================================================================= +*/ +defined('FULL_PATH') or die('restricted access!'); -/* Initialization */ +define('ADODB_DATE_VERSION', 0.21); -/* - Version Number -*/ -define('ADODB_DATE_VERSION',0.21); - if (!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS',1); function adodb_date_test_date($y1,$m,$d=13) @@ -758,7 +755,4 @@ if ($ts === false) $ts = time(); $ret = adodb_date($fmtdate, $ts, $is_gmt); return $ret; -} - - -?> \ No newline at end of file +} \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_user_group.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_agents.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_ship_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/captcha/captcha_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/captcha/captcha_config.php (.../captcha_config.php) (revision 12127) +++ branches/5.1.x/core/units/captcha/captcha_config.php (.../captcha_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'captcha', // 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), Index: branches/5.1.x/core/admin_templates/img/icons/icon24_translate.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_currency.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/utility/params.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/params.php (.../params.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/params.php (.../params.php) (revision 12657) @@ -1,6 +1,6 @@ SplitParamsStr($params_str); - } + class Params extends kBase { - /** - * Splits tag params into associative array - * - * @param string $params_str - * @access private - */ - function SplitParamsStr($params_str) - { -// $re = preg_quote('([\${}a-zA-Z0-9_.-#\[\]]+)=(["\']{1,1})(.*?)(? $val){ - $values[$val[1]] = str_replace('\\' . $val[2], $val[2], $val[3]); + function Params($params_str = null) + { + parent::kBase(); + if($params_str != '') $this->SplitParamsStr($params_str); } - $this->AddParams($values); - } - /** - * Sets new parameter value - * - * @param string $name - * @param string $val - * @access public - */ - function Set($name, $val) - { - $this->_Params[$name] = $val; - } + /** + * Splits tag params into associative array + * + * @param string $params_str + * @access private + */ + function SplitParamsStr($params_str) + { + // $re = preg_quote('([\${}a-zA-Z0-9_.-#\[\]]+)=(["\']{1,1})(.*?)(?_Params[$name]); - } + $values = Array(); + foreach ($rets AS $key => $val){ + $values[$val[1]] = str_replace('\\' . $val[2], $val[2], $val[3]); + } + $this->AddParams($values); + } - /** - * Gets parameter value by parameter name - * - * @param string $name Name of variable to retrieve - * @param int $default default value returned in case if varible not present - * @return string - * @access public - */ - function Get($name, $default = false) - { - return isset($this->_Params[$name]) ? $this->_Params[$name] : $default; - } + /** + * Sets new parameter value + * + * @param string $name + * @param string $val + * @access public + */ + function Set($name, $val) + { + $this->_Params[$name] = $val; + } - /** - * Mass parameter setting from hash - * - * @param Array $params - * @access public - */ - function AddParams($params) - { - if (!is_array($params)) return; - /*if (count($this->_Params) == 0) { - $this->_Params = $params; + /** + * Removes parameter + * + * @param string $name + * @access public + */ + function Remove($name) + { + unset($this->_Params[$name]); } - else {*/ - foreach ($params as $name => $val) -// $this->Set(strtolower($name), $val); - $this->Set($name, $val); - //} - } - /** - * Return all paramters as hash - * - * @return Array - * @access public - */ - function GetParams() - { - return $this->_Params; - } -} + /** + * Gets parameter value by parameter name + * + * @param string $name Name of variable to retrieve + * @param int $default default value returned in case if varible not present + * @return string + * @access public + */ + function Get($name, $default = false) + { + return isset($this->_Params[$name]) ? $this->_Params[$name] : $default; + } -class kArray extends kBase { - var $_Array; + /** + * Mass parameter setting from hash + * + * @param Array $params + * @access public + */ + function AddParams($params) + { + if (!is_array($params)) return; + /*if (count($this->_Params) == 0) { + $this->_Params = $params; + } + else {*/ + foreach ($params as $name => $val) + // $this->Set(strtolower($name), $val); + $this->Set($name, $val); + //} + } - /** - * Returns array value with any deep key - * - * @return mixed - * @todo array_unshift doesn't accept parameters by reference, fix it's usage in this method - */ - function GetArrayValue() - { - $args = func_get_args(); - array_unshift_ref($args, $this->_Array); - return call_user_func_array('getArrayValue', $args); + /** + * Return all paramters as hash + * + * @return Array + * @access public + */ + function GetParams() + { + return $this->_Params; + } } - function SetArrayValue() - { - $args = func_get_args(); - $value = array_pop($args); + class kArray extends kBase { + var $_Array; - $arr =& $this->_Array; - for ($i=0; $i_Array); + return call_user_func_array('getArrayValue', $args); } - $arr = $value; - } -} -?> \ No newline at end of file + function SetArrayValue() + { + $args = func_get_args(); + $value = array_pop($args); + + $arr =& $this->_Array; + for ($i=0; $i 'fav', 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -92,6 +94,4 @@ 'ItemTypeId' => Array('type' => 'int','not_null' => 1, 'default' => 0), 'Modified' => Array('type' => 'int','not_null' => 1, 'default' => '#NOW#'), ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_goto_order.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_rescan_themes.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/visits/visits_list.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/visits/visits_list.php (.../visits_list.php) (revision 12127) +++ branches/5.1.x/core/units/visits/visits_list.php (.../visits_list.php) (revision 12657) @@ -1,6 +1,6 @@ GetSelectSQL(true,true); - $sql = $this->getCountSQL($system_sql); - if( $this->GetGroupClause() ) + class VisitsList extends kDBList { + /** + * Counts the total number of records base on the query resulted from {@link kDBList::GetSelectSQL()} + * + * The method modifies the query to substitude SELECT part (fields listing) with COUNT(*). + * Special care should be applied when working with lists based on grouped queries, all aggregate function fields + * like SUM(), AVERAGE() etc. should be added to CountedSQL by using {@link kDBList::SetCountedSQL()} + * + * @access public + * @param string + * @return void + */ + function CountRecs() { - if (!isset($this->OriginalParams['types']) && $this->Special == 'incommerce') { - //$sql = preg_replace('/GROUP BY.*/', '', $sql); - $sql = 'SELECT COUNT(*) FROM '.$this->TableName; - $this->NoFilterCount = (int)$this->Conn->GetOne($sql); + $system_sql = $this->GetSelectSQL(true,true); + $sql = $this->getCountSQL($system_sql); + if( $this->GetGroupClause() ) { + if (!isset($this->OriginalParams['types']) && $this->Special == 'incommerce') { + //$sql = preg_replace('/GROUP BY.*/', '', $sql); + $sql = 'SELECT COUNT(*) FROM '.$this->TableName; + $this->NoFilterCount = (int)$this->Conn->GetOne($sql); + } + else { + $this->NoFilterCount = count( $this->Conn->GetCol($sql) ); + } } else { - $this->NoFilterCount = count( $this->Conn->GetCol($sql) ); + $this->NoFilterCount = (int)$this->Conn->GetOne($sql); } - } - else - { - $this->NoFilterCount = (int)$this->Conn->GetOne($sql); - } - $all_sql = $this->GetSelectSQL(true,false); - if($system_sql == $all_sql) //no need to query the same again - { - $this->RecordsCount = $this->NoFilterCount; - return; - } + $all_sql = $this->GetSelectSQL(true,false); + if($system_sql == $all_sql) { //no need to query the same again + $this->RecordsCount = $this->NoFilterCount; + return; + } - $sql = $this->getCountSQL($all_sql); + $sql = $this->getCountSQL($all_sql); - if( $this->GetGroupClause() ) - { - $this->RecordsCount = count( $this->Conn->GetCol($sql) ); + if( $this->GetGroupClause() ) { + $this->RecordsCount = count( $this->Conn->GetCol($sql) ); + } + else { + $this->RecordsCount = (int)$this->Conn->GetOne($sql); + } + + $this->Counted = true; } - else - { - $this->RecordsCount = (int)$this->Conn->GetOne($sql); - } - - - $this->Counted = true; - } - -} \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/stop_words/stop_word_list.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/stop_words/stop_word_list.tpl (.../stop_word_list.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/stop_words/stop_word_list.tpl (.../stop_word_list.tpl) (revision 12657) @@ -14,7 +14,7 @@ } var a_toolbar = new ToolBar(); - a_toolbar.AddButton( new ToolBarButton('new_item', '', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { std_precreate_item('stop-word', 'stop_words/stop_word_edit'); } ) ); Index: branches/5.1.x/core/units/admin/admin_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/admin/admin_config.php (.../admin_config.php) (revision 12127) +++ branches/5.1.x/core/units/admin/admin_config.php (.../admin_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'adm', 'ItemClass' => Array ('class' => 'kDBItem','file'=>'','build_event'=>'OnItemBuild'), @@ -64,11 +66,11 @@ 'in-portal:service' => Array ( 'parent' => 'in-portal:tools', - 'icon' => 'conf_general', + 'icon' => 'service', 'label' => 'la_tab_Service', 'url' => Array ('t' => 'tools/system_tools', 'pass' => 'm'), - 'permissions' => Array ('view'), - 'priority' => 10, + 'permissions' => Array ('view', 'edit'), + 'priority' => 6, 'type' => stTREE, ), ), @@ -86,7 +88,7 @@ 'cant_open_file' => '!la_error_CantOpenFile!', 'no_matching_columns' => '!la_error_NoMatchingColumns!', ), - 'file_types' => '*.csv', 'files_description' => '!la_CSVFiles!', + 'file_types' => '*.csv', 'files_description' => '!la_hint_CSVFiles!', 'upload_dir' => '/system/import/', // relative to project's home 'multiple' => false, 'direct_links' => false, 'default' => null, Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_form_submission.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/email_queue/email_queue_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/email_queue/email_queue_config.php (.../email_queue_config.php) (revision 12127) +++ branches/5.1.x/core/units/email_queue/email_queue_config.php (.../email_queue_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'email-queue', 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -41,11 +43,11 @@ 'Sections' => Array ( 'in-portal:email_queue' => Array ( 'parent' => 'in-portal:mailing_folder', - 'icon' => 'email_log', + 'icon' => 'mailing_list', 'label' => 'la_tab_EmailQueue', 'url' => Array('t' => 'logs/email_logs/email_queue_list', 'pass' => 'm'), 'permissions' => Array ('view', 'delete'), - 'priority' => 7.2, + 'priority' => 5.2, // ., because this section replaces parent in tree 'type' => stTAB, ), ), @@ -74,16 +76,17 @@ 'Grids' => Array ( 'Default' => Array ( - 'Icons' => Array ('default' => 'icon16_custom.gif'), + 'Icons' => Array ('default' => 'icon16_item.png'), 'Fields' => Array ( - 'EmailQueueId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter',), - 'ToEmail' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', ), - 'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ), - 'MessageHeaders' => Array ('title' => 'la_col_MessageHeaders', 'data_block' => 'grid_headers_td', 'filter_block' => 'grid_like_filter', ), - 'Queued' => Array ('title' => 'la_col_Queued', 'filter_block' => 'grid_date_range_filter', ), - 'SendRetries' => Array ('title' => 'la_col_SendRetries', 'filter_block' => 'grid_range_filter', ), - 'LastSendRetry' => Array ('title' => 'la_col_LastSendRetry', 'filter_block' => 'grid_date_range_filter', ), - 'MailingId' => Array ('title' => 'la_col_MailingList', 'filter_block' => 'grid_range_filter', ), + 'EmailQueueId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ), + 'MailingId' => Array ('title' => 'la_col_MailingList', 'filter_block' => 'grid_range_filter', 'width' => 70, ), + 'ToEmail' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'MessageHeaders' => Array ('title' => 'la_col_MessageHeaders', 'data_block' => 'grid_headers_td', 'filter_block' => 'grid_like_filter', 'width' => 130, ), + 'Queued' => Array ('title' => 'la_col_Queued', 'filter_block' => 'grid_date_range_filter', 'width' => 80, ), + 'SendRetries' => Array ('title' => 'la_col_SendRetries', 'filter_block' => 'grid_range_filter', 'width' => 100, ), + 'LastSendRetry' => Array ('title' => 'la_col_LastSendRetry', 'filter_block' => 'grid_date_range_filter', 'width' => 150, ), + ), ), ), Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_reset_to_pending_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/utility/factory.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/factory.php (.../factory.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/factory.php (.../factory.php) (revision 12657) @@ -1,6 +1,6 @@ Application->isDebugMode() && constOn('DBG_FACTORY')) { + if (defined('DEBUG_MODE') && defined('DBG_FACTORY') && DBG_FACTORY && $this->Application->isDebugMode()) { global $debugger; + $debugger->appendHTML('Creating object: Pseudo class: '.$pseudo_class.' Prefix: '.$name); $debugger->appendTrace(); } @@ -158,7 +161,7 @@ return $false; } - if ($this->Application->isDebugMode() && constOn('DBG_FACTORY')) { + if (defined('DEBUG_MODE') && defined('DBG_FACTORY') && DBG_FACTORY && $this->Application->isDebugMode()) { global $debugger; $debugger->appendHTML('Creating object: Pseudo class: '.$pseudo_class.' Prefix: '.$name); $debugger->appendTrace(); @@ -324,6 +327,5 @@ $dependencies[] = $this->realClasses[$class_name]; } } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/install/site_configs.zip =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_agent_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_theme.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/themes/themes_edit.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/themes/themes_edit.tpl (.../themes_edit.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/themes/themes_edit.tpl (.../themes_edit.tpl) (revision 12657) @@ -1,4 +1,4 @@ - + @@ -58,14 +58,14 @@ - + - +
@@ -91,29 +119,38 @@ GetStepBody(); ?> - -
-

- errorMessage; ?> -

-
-
+

+ errorMessage; ?> +

+
+

- - GetStepNumber() > 1 && $this->GetNextStep() != -1) { - echo ''; + if ($this->buttonVisible('refresh')) { + echo ' '; } - ?> + if ($this->buttonVisible('back')) { + echo ' '; + } + + echo ''; + ?>
%s%s%s
Index: branches/5.1.x/core/units/selectors/selectors_item.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/selectors/selectors_item.php (.../selectors_item.php) (revision 12127) +++ branches/5.1.x/core/units/selectors/selectors_item.php (.../selectors_item.php) (revision 12657) @@ -1,6 +1,6 @@ '); - - class SelectorsItem extends kDBItem - { + + class SelectorsItem extends kDBItem { + /** * Returns compiled selector for inserting into css file * @@ -30,7 +32,7 @@ $ret .= $separator."}\n"; return $ret; } - + function CompileStyleBody($separator) { $ret = ''; @@ -43,14 +45,14 @@ $ret .= "\t$property_name: $property_value;".$separator; } } - + $advanced_css = $this->GetDBField('AdvancedCSS'); if($separator != "\n") $advanced_css = str_replace("\n",$separator,$advanced_css); $ret .= $advanced_css; - + return $ret; } - + /** * Resets all block style attributes to it's base style * @@ -63,5 +65,5 @@ $this->Update(); } } - } -?> \ No newline at end of file + + } \ No newline at end of file Index: branches/5.1.x/core/units/visits/visits_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/visits/visits_event_handler.php (.../visits_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/visits/visits_event_handler.php (.../visits_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Array('self' => true), ); - + $this->permMapping = array_merge($this->permMapping, $permissions); } - + /** * Registers user visit to site * * @param kEvent $event */ function OnRegisterVisit(&$event) { - if ($this->Application->IsAdmin()) { + if ($this->Application->IsAdmin() || !$this->Application->ConfigValue('UseVisitorTracking')) { // admin logins are not registred in visits list return true; } + if ($this->Application->RecallVar('visit_id')) { return true; } - $object =& $event->getObject( Array('skip_autoload'=>true) ); + + $object =& $event->getObject( Array('skip_autoload' => true) ); $object->SetDBField('VisitDate_date', adodb_mktime() ); $object->SetDBField('VisitDate_time', adodb_mktime() ); $object->SetDBField('Referer', getArrayValue($_SERVER, 'HTTP_REFERER') ); $object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR'] ); - if( $object->Create() ) - { + + if ($object->Create()) { $this->Application->StoreVar('visit_id', $object->GetID() ); $this->Application->SetVar('visits_id', $object->GetID() ); } @@ -113,7 +117,7 @@ } } } - + /** * [HOOK] Updates user_id in current visit * @@ -130,6 +134,4 @@ } } - } - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon24_custom.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_language_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/custom_fields/custom_fields_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 12127) +++ branches/5.1.x/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'cf', 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), @@ -122,38 +124,44 @@ ), 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array('default'=>'icon16_custom.gif'), - 'Fields' => Array( - 'CustomFieldId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter' ), - 'FieldName' => Array( 'title'=>'la_prompt_FieldName'), - 'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'cf_grid_data_td' ), - 'DisplayOrder' => Array('title' => 'la_prompt_DisplayOrder', 'filter_block' => 'grid_range_filter' ), -// 'IsSystem' => Array ('title' => 'la_col_IsSystem', 'filter_block' => 'grid_options_filter'), - ), - ), + 'Default' => Array ( + 'Icons' => Array ( + 'default' => 'icon16_item.png', + ), + 'Fields' => Array ( + 'CustomFieldId' => Array ( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ), + 'FieldName' => Array ( 'title'=>'la_prompt_FieldName', 'width' => 250, ), + 'FieldLabel' => Array ( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'cf_grid_data_td', 'width' => 250, ), + 'DisplayOrder' => Array ('title' => 'la_prompt_DisplayOrder', 'filter_block' => 'grid_range_filter', 'width' => 105, ), +// 'IsSystem' => Array ('title' => 'la_col_IsSystem', 'filter_block' => 'grid_options_filter'), + ), + ), - 'SeparateTab' => Array( - 'Icons' => Array('default'=>'icon16_custom.gif'), - 'Selector' => '', - 'Fields' => Array( - 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter'), - 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'), - 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'), - 'Error' => Array( 'title'=>'la_col_Error', 'data_block' => 'custom_error_td', 'filter_block' => 'grid_empty_filter'), - ), - ), + 'SeparateTab' => Array ( + 'Icons' => Array ( + 'default' => 'icon16_item.png', + ), + 'Selector' => '', + 'Fields' => Array ( + 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter', 'width' => 200, ), + 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter', 'width' => 200, ), + 'Error' => Array ( 'title'=>'la_col_Error', 'data_block' => 'custom_error_td', 'filter_block' => 'grid_empty_filter', 'width' => 100, ), + ), + ), - 'SeparateTabOriginal' => Array( - 'Icons' => Array('default'=>'icon16_custom.gif'), - 'Selector' => '', - 'Fields' => Array( - 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td', 'filter_block' => 'grid_like_filter'), - 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'), - 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'), - 'OriginalValue' => Array( 'title'=>'la_col_OriginalValue', 'data_block' => 'grid_original_td', 'filter_block' => 'grid_like_filter'), - ), - ), + 'SeparateTabOriginal' => Array ( + 'Icons' => Array ( + 'default' => 'icon16_item.png', + ), + 'Selector' => '', + 'Fields' => Array ( + 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td', 'filter_block' => 'grid_like_filter'), + 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'), + 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'), + 'OriginalValue' => Array ( 'title'=>'la_col_OriginalValue', 'data_block' => 'grid_original_td', 'filter_block' => 'grid_like_filter'), + ), + ), ), ); \ No newline at end of file Index: branches/5.1.x/core/units/general/custom_fields.php =================================================================== diff -u -N --- branches/5.1.x/core/units/general/custom_fields.php (revision 12127) +++ branches/5.1.x/core/units/general/custom_fields.php (revision 0) @@ -1,157 +0,0 @@ -ParseConfigSQL($values_list, $separator, $parse), $separator); - - if (!$values_list) { - // no options, then return empty array - return Array(); - } - - $optionValuesTmp = explode($separator, $values_list); - $optionValues = Array(); - - if (substr_count($values_list, '=') != count($optionValuesTmp)) { - if ($this->Application->isDebugMode()) { - $this->Application->Debugger->appendTrace(); - } - - trigger_error('Invalid symbol in ValueList field [' . substr($values_list, 0, 100) . ' ...]' , E_USER_NOTICE); - return Array (); - } - - if ($parse) { - // normal way - foreach ($optionValuesTmp as $optionValue) { - list ($key, $val) = explode('=', $optionValue); - - $val = substr($val, 0, 1) == '+' ? substr($val, 1) : $this->Application->Phrase($val); - - $optionValues[$key] = $val; - } - } - else { - // during custom field editing - foreach ($optionValuesTmp as $optionValue) { - list ($key, $val) = explode('=', $optionValue); - - if (substr($key, 0, 3) == 'SQL') { - $val = base64_decode( str_replace('_', '=', substr($val, 1)) ); - } - - $optionValues[$key] = $val; - } - } - - return $optionValues; - } - - /** - * Replace SQL's in valueList with appropriate queried values - * - * @param string $valueString - * @param string $separator - * @return string - * @todo Apply refactoring to embedded vars stuff - */ - function ParseConfigSQL($valueString, $separator = VALUE_LIST_SEPARATOR, $parse_sqls = true) - { - $string = trim( str_replace(Array('', '%3$s'), Array (TABLE_PREFIX, $this->Application->GetVar('m_lang')), $valueString) ); - - preg_match_all("|\{(.*)\}|U", $string, $embedded_vars, PREG_SET_ORDER); - - /* - in ValueList now can use globally available variables. - Usage: {$_POST['variable']|what to output if $_POST['variable'] is set} - e.g. $_POST['variable']='Hello' - Will output: what to output if Hello is set - */ - - if ($embedded_vars) { - for ($i = 0; $i < count($embedded_vars); $i++) { - $embedded_var = $embedded_vars[$i][1]; - $embedded_var_src = $embedded_vars[$i][0]; - - list($var_name, $pattern) = explode('|', $embedded_var); - eval('$var_value = (isset('.$var_name.')?'.$var_name.':false);'); - - if ($var_value !== false) { - $pattern = str_replace($var_name, $var_value, $pattern); - $string = str_replace($embedded_var_src, $pattern, $string); - } - else { - $string = str_replace($embedded_var_src, '', $string); - } - } - } - - if (preg_match_all('/(.*?)<\/SQL>/', $string, $regs)) { - $i = 0; - $sql_count = count($regs[0]); - while ($i < $sql_count) { - if ($parse_sqls) { - $replacement = $this->_queryConfigSQL($regs[2][$i], $regs[1][$i], $separator); - } - else { - $sql = base64_encode(''.$regs[2][$i].''); - $replacement = 'SQL' . $i . '=+' . str_replace('=', '_', $sql); - } - - $string = str_replace(''.$regs[2][$i].'', $replacement, $string); - $i++; - } - - $string = preg_replace('/[' . preg_quote($separator, '/') . ']+/', $separator, $string); // trim trailing separators inside string - } - - return $string; - } - - /** - * Transforms given sql into value list string - * - * @param string $sql - * @param string $plus - * @param string $separator - * @return string - */ - function _queryConfigSQL($sql, $plus = '', $separator = VALUE_LIST_SEPARATOR) - { - $values = $this->Conn->Query($sql); - foreach ($values as $index => $value) { - $values[$index] = $value['OptionValue'] . '=' . $plus . $value['OptionName']; - } - - return implode($separator, $values); - } -} - -?> \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_group.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/utility/debugger/debugger.css =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/debugger/debugger.css (.../debugger.css) (revision 12127) +++ branches/5.1.x/core/kernel/utility/debugger/debugger.css (.../debugger.css) (revision 12657) @@ -86,13 +86,15 @@ border: 1px solid #000000; background-color: #D4D0C8; border-collapse: separate; + border-spacing: 2px; width: auto; } .dbg-toolbar td { font-size: 13px; font-family: Tahoma; padding: 1px 5px 1px 5px; + vertical-align: middle; margin: 3px; } Index: branches/5.1.x/core/admin_templates/img/tab_active_right.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/startup.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/startup.php (.../startup.php) (revision 12127) +++ branches/5.1.x/core/kernel/startup.php (.../startup.php) (revision 12657) @@ -1,6 +1,6 @@ Don\'t forget to clean Cache table afterwards'); - } if (!function_exists('getmicrotime')) { function getmicrotime() { - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); } } + $globals_start = getmicrotime(); include_once(KERNEL_PATH . '/globals.php'); // non OOP functions used through kernel, e.g. print_pre include_once(KERNEL_PATH . '/utility/multibyte.php'); // emulating multi-byte php extension $globals_end = getmicrotime(); - define('INPORTAL_ENV', 1); - $vars = parse_portal_ini(FULL_PATH . '/config.php'); $admin_directory = isset($vars['AdminDirectory']) ? $vars['AdminDirectory'] : '/admin'; - safeDefine('ADMIN_DIRECTORY', $admin_directory); + define('ADMIN_DIRECTORY', $admin_directory); # New path detection method: begin if (defined('REL_PATH')) { @@ -51,8 +49,6 @@ safeDefine('BASE_PATH', $ps); // in case in-portal has defined it before # New path detection method: end - safeDefine('INPORTAL_TAGS', true); - safeDefine('NPARSER', 1); // New Parser is enabled safeDefine('SERVER_NAME', $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $vars['Domain']); $https_mark = getArrayValue($_SERVER, 'HTTPS'); @@ -93,32 +89,32 @@ define('MODULES_PATH', FULL_PATH); - define('EXPORT_BASE_PATH', (defined('WRITEBALE_BASE') ? WRITEBALE_BASE : ADMIN_DIRECTORY) . '/export'); + define('EXPORT_BASE_PATH', WRITEBALE_BASE . '/export'); define('EXPORT_PATH', FULL_PATH . EXPORT_BASE_PATH); define('GW_CLASS_PATH', MODULES_PATH . '/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path define('SYNC_CLASS_PATH', FULL_PATH . '/sync'); // path for 3rd party user syncronization scripts safeDefine('ENV_VAR_NAME','env'); - safeDefine('IMAGES_PATH', (defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . '/images/'); - safeDefine('IMAGES_PENDING_PATH', IMAGES_PATH . 'pending/'); - safeDefine('CUSTOM_UPLOAD_PATH', '/templates/images/custom/'); + define('IMAGES_PATH', WRITEBALE_BASE . '/images/'); + define('IMAGES_PENDING_PATH', IMAGES_PATH . 'pending/'); safeDefine('MAX_UPLOAD_SIZE', min(ini_get('upload_max_filesize'), ini_get('post_max_size'))*1024*1024); safeDefine('EDITOR_PATH', isset($vars['EditorPath']) ? $vars['EditorPath'] : '/core/editor/'); - if( ini_get('safe_mode') ) define('SAFE_MODE', 1); + if (ini_get('safe_mode')) { + // safe mode will be removed at all in PHP6 + define('SAFE_MODE', 1); + } - safeDefine('EXPERIMENTAL_PRE_PARSE', 1); - - if( file_exists(FULL_PATH . '/debug.php') ) - { + if (file_exists(FULL_PATH . '/debug.php')) { include_once(FULL_PATH . '/debug.php'); - if(isset($dbg_options['DEBUG_MODE']) && $dbg_options['DEBUG_MODE']) { + if (array_key_exists('DEBUG_MODE', $dbg_options) && $dbg_options['DEBUG_MODE']) { $debugger_start = getmicrotime(); include_once(KERNEL_PATH . '/utility/debugger.php'); $debugger_end = getmicrotime(); + if (isset($debugger) && constOn('DBG_PROFILE_INCLUDES')) { $debugger->profileStart('inc_globals', KERNEL_PATH . '/globals.php', $globals_start); $debugger->profileFinish('inc_globals', KERNEL_PATH . '/globals.php', $globals_end); @@ -130,7 +126,7 @@ } } } - + safeDefine('SILENT_LOG', 0); $includes = Array( @@ -155,14 +151,10 @@ $debugger->AttachToApplication(); } - if( !function_exists('adodb_mktime') ) include_once(KERNEL_PATH . '/utility/adodb-time.inc.php'); + if( !function_exists('adodb_mktime') ) { + include_once(KERNEL_PATH . '/utility/adodb-time.inc.php'); + } -// include_once(KERNEL_PATH . '/utility/temp_handler.php'); // needed because of static calls from kBase - // up to here - // global constants define ('KG_TO_POUND', 2.20462262); - define ('POUND_TO_KG', 0.45359237); - - -?> \ No newline at end of file + define ('POUND_TO_KG', 0.45359237); \ No newline at end of file Index: branches/5.1.x/core/units/user_groups/user_groups_dbitem.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/user_groups/user_groups_dbitem.php (.../user_groups_dbitem.php) (revision 12127) +++ branches/5.1.x/core/units/user_groups/user_groups_dbitem.php (.../user_groups_dbitem.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/modules/modules_tag_processor.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/modules/modules_tag_processor.php (.../modules_tag_processor.php) (revision 12127) +++ branches/5.1.x/core/units/modules/modules_tag_processor.php (.../modules_tag_processor.php) (revision 12657) @@ -1,6 +1,6 @@ Application->isModuleEnabled($params['name']); } + function _hasPrivileges() + { + return $this->Application->RecallVar('user_id') == -1; + } + function AlreadyInstalled($params) { + if (!$this->_hasPrivileges()) { + // don't show licenses status for non-privileged users + return true; + } + $object =& $this->getObject($params); /* @var $object kDBList */ @@ -32,6 +44,11 @@ function ModuleLicensed($params) { + if (!$this->_hasPrivileges()) { + // don't show licenses status for non-privileged users + return true; + } + $object =& $this->getObject($params); /* @var $object kDBList */ @@ -96,4 +113,5 @@ return $this->Application->HREF('dummy', '_FRONT_END_', $url_params, $module_path . '/install.php'); } - } + + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_summary.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_settings_search.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/user_profile/user_profile_eh.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/user_profile/user_profile_eh.php (.../user_profile_eh.php) (revision 12127) +++ branches/5.1.x/core/units/user_profile/user_profile_eh.php (.../user_profile_eh.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/forms/forms_edit_fields.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/forms/forms_edit_fields.tpl (.../forms_edit_fields.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/forms/forms_edit_fields.tpl (.../forms_edit_fields.tpl) (revision 12657) @@ -39,7 +39,7 @@ a_toolbar.AddButton( new ToolBarSeparator('sep2') ); - a_toolbar.AddButton( new ToolBarButton('new_item', '', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { std_new_item('formflds', 'forms/form_field_edit') } ) ); Index: branches/5.1.x/core/admin_templates/img/icons/icon24_conf_themes.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_form_submission_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_users.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_arrange.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/category_items/category_items_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/category_items/category_items_event_handler.php (.../category_items_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/category_items/category_items_event_handler.php (.../category_items_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/general/libchart/classes/view/primitive/Rectangle.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/primitive/Rectangle.php (.../Rectangle.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/primitive/Rectangle.php (.../Rectangle.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * A rectangle identified by the top-left and the bottom-right corners. * @@ -72,5 +74,4 @@ //echo "(" . $this->x1 . "," . $this->y1 . ") (" . $this->x2 . "," . $this->y2 . ")
"; return $rectangle; } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/spelling_dictionary/spelling_dictionary_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/spelling_dictionary/spelling_dictionary_config.php (.../spelling_dictionary_config.php) (revision 12127) +++ branches/5.1.x/core/units/spelling_dictionary/spelling_dictionary_config.php (.../spelling_dictionary_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'spelling-dictionary', 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -52,6 +54,7 @@ 'PermSection' => Array('main' => 'in-portal:spelling_dictionary'), + /* 'Sections' => Array ( 'in-portal:spelling_dictionary' => Array ( 'parent' => 'in-portal:website_setting_folder', @@ -63,6 +66,7 @@ 'type' => stTREE, ), ), + */ 'ListSQLs' => Array ( '' => ' SELECT %1$s.* %2$s FROM %1$s', Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_group_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_agents.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_settings_general.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_style.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/content/content_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/content/content_config.php (.../content_config.php) (revision 12127) +++ branches/5.1.x/core/units/content/content_config.php (.../content_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'content', 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_style_disabled.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/general/cat_dbitem.php =================================================================== diff -u -N --- branches/5.1.x/core/units/general/cat_dbitem.php (revision 12127) +++ branches/5.1.x/core/units/general/cat_dbitem.php (revision 0) @@ -1,598 +0,0 @@ -CategoryPath = Array(); - } - - /** - * Set's prefix and special - * - * @param string $prefix - * @param string $special - * @access public - */ - function Init($prefix, $special, $event_params = null) - { - parent::Init($prefix, $special, $event_params); - $this->usePendingEditing = $this->Application->getUnitOption($this->Prefix, 'UsePendingEditing'); - } - - function Create($force_id = false, $system_create = false) - { - // TODO: move to OnBeforeItemCreate method - if ($this->Validate()) { - // TODO: such approach will not respect changes from OnBeforeItemCreate event - $this->SetDBField('ResourceId', $this->Application->NextResourceId()); - } - - $this->SetDBField('Modified_date', adodb_mktime() ); - $this->SetDBField('Modified_time', adodb_mktime() ); - - if ($this->mode != 't' && !$this->Application->IsAdmin()) { - $owner_field = $this->Application->getUnitOption($this->Prefix, 'OwnerField'); - if (!$owner_field) { - $owner_field = 'CreatedById'; - } - $this->SetDBField($owner_field, $this->Application->RecallVar('user_id')); - } - - if ($this->useFilenames) { - $this->checkFilename(); - $this->generateFilename(); - } - - $ret = parent::Create($force_id, $system_create); - - if ($ret) { - // TODO: move to OnAfterItemCreate method - $this->assignPrimaryCategory(); - } - return $ret; - } - - function assignPrimaryCategory() - { - $primary_category = $this->GetDBField('CategoryId') > 0 ? $this->GetDBField('CategoryId') : $this->Application->GetVar('m_cat_id'); - $this->assignToCategory($primary_category, true); - } - - function Update($id=null, $system_update=false) - { - $this->VirtualFields['ResourceId'] = Array(); - $this->SetDBField('Modified', adodb_mktime() ); - $this->UpdateFormattersSubFields(array('Modified')); - $this->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); - - if ($this->useFilenames) { - $this->checkFilename(); - $this->generateFilename(); - } - - $ret = parent::Update($id, $system_update); - - if ($ret) { - $filename = $this->useFilenames ? $this->GetDBField('Filename') : ''; - $sql = 'UPDATE '.$this->CategoryItemsTable().' - SET Filename = '.$this->Conn->qstr($filename).' - WHERE ItemResourceId = '.$this->GetDBField('ResourceId'); - $this->Conn->Query($sql); - } - - unset($this->VirtualFields['ResourceId']); - return $ret; - } - - /** - * Returns CategoryItems table based on current item mode (temp/live) - * - * @return string - */ - function CategoryItemsTable() - { - $table = TABLE_PREFIX.'CategoryItems'; - if ($this->Application->IsTempTable($this->TableName)) { - $table = $this->Application->GetTempName($table, 'prefix:'.$this->Prefix); - } - - return $table; - } - - - function checkFilename() - { - if( !$this->GetDBField('AutomaticFilename') ) - { - $filename = $this->GetDBField('Filename'); - $this->SetDBField('Filename', $this->stripDisallowed($filename) ); - } - } - - function Copy($cat_id=null) - { - if (!isset($cat_id)) $cat_id = $this->Application->GetVar('m_cat_id'); - $this->NameCopy($cat_id); - return $this->Create($cat_id); - } - - function NameCopy($master=null, $foreign_key=null) - { - $title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField'); - if (!$title_field) return; - - $new_name = $this->GetDBField($title_field); - $cat_id = $this->Application->GetVar('m_cat_id'); - $original_checked = false; - do { - if ( preg_match('/Copy ([0-9]*) *of (.*)/', $new_name, $regs) ) { - $new_name = 'Copy '.( (int)$regs[1] + 1 ).' of '.$regs[2]; - } - elseif ($original_checked) { - $new_name = 'Copy of '.$new_name; - } - $query = 'SELECT '.$title_field.' FROM '.$this->TableName.' - LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON - ('.TABLE_PREFIX.'CategoryItems.ItemResourceId = '.$this->TableName.'.ResourceId) - WHERE ('.TABLE_PREFIX.'CategoryItems.CategoryId = '.$cat_id.') AND '. - $title_field.' = '.$this->Conn->qstr($new_name); - $res = $this->Conn->GetOne($query); - $original_checked = true; - } while ($res !== false); - $this->SetDBField($title_field, $new_name); - - // this is needed, because Create will create items in its own CategoryId (if it's set), - // but we need to create it in target Paste category @see{kCatDBItem::Create} and its primary_category detection - $this->SetDBField('CategoryId', $cat_id); - } - - /** - * Changes item primary category to given/current category - * - * @param int $category_id - */ - function MoveToCat($category_id = null) - { -// $this->NameCopy(); - if (!isset($category_id)) { - $category_id = $this->Application->GetVar('m_cat_id'); - } - - $table_name = TABLE_PREFIX . 'CategoryItems'; - if ($this->IsTempTable()) { - $table_name = $this->Application->GetTempName($table_name, 'prefix:' . $this->Prefix); - } - - // check if the item already exists in destination category - $sql = 'SELECT PrimaryCat - FROM ' . $table_name . ' - WHERE (CategoryId = ' . $category_id . ') AND (ItemResourceId = ' . $this->GetDBField('ResourceId') . ')'; - $is_primary = $this->Conn->GetOne($sql); - - // if it's not found is_primary will be FALSE, if it's found but not primary it will be int 0 - $exists = $is_primary !== false; - - if ($exists) { - // if the item already exists in destination category - if ($is_primary) { - // do nothing when we paste to primary - return ; - } - - // if it's not primary - delete it from destination category, as we will move it from current primary below - $sql = 'DELETE FROM ' . $table_name . ' - WHERE (CategoryId = ' . $category_id . ') AND (ItemResourceId = ' . $this->GetDBField('ResourceId') . ')'; - $this->Conn->Query($sql); - } - - // change category id in existing primary category record - $sql = 'UPDATE ' . $table_name . ' - SET CategoryId = ' . $category_id . ' - WHERE (ItemResourceId = ' . $this->GetDBField('ResourceId') . ') AND (PrimaryCat = 1)'; - $this->Conn->Query($sql); - - $this->Update(); - } - - /** - * When item is deleted, then also delete it from all categories - * - * @param int $id - * @return bool - */ - function Delete($id = null) - { - if( isset($id) ) { - $this->setID($id); - } - - $this->Load($this->GetID()); - - $ret = parent::Delete(); - - if ($ret) { - // TODO: move to OnAfterItemDelete method - $query = ' DELETE FROM ' . $this->CategoryItemsTable() . ' - WHERE ItemResourceId = ' . $this->GetDBField('ResourceId'); - $this->Conn->Query($query); - } - - return $ret; - } - - /** - * Deletes item from categories - * - * @param Array $delete_category_ids - * @author Alex - */ - function DeleteFromCategories($delete_category_ids) - { - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); // because item was loaded before by ResourceId - - $ci_table = $this->Application->getUnitOption($this->Prefix.'-ci', 'TableName'); - $resource_id = $this->GetDBField('ResourceId'); - - $item_cats_sql = 'SELECT CategoryId FROM %s WHERE ItemResourceId = %s'; - $delete_category_items_sql = 'DELETE FROM %s WHERE ItemResourceId = %s AND CategoryId IN (%s)'; - - $category_ids = $this->Conn->GetCol( sprintf($item_cats_sql, $ci_table, $resource_id) ); - $cats_left = array_diff($category_ids, $delete_category_ids); - if(!$cats_left) - { - $sql = 'SELECT %s FROM %s WHERE ResourceId = %s'; - $ids = $this->Conn->GetCol( sprintf($sql, $id_field, $this->TableName, $resource_id) ); - - $temp =& $this->Application->recallObject($this->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp->DeleteItems($this->Prefix, $this->Special, $ids); - } - else - { - $this->Conn->Query( sprintf($delete_category_items_sql, $ci_table, $resource_id, implode(',', $delete_category_ids) ) ); - - $sql = 'SELECT CategoryId FROM %s WHERE PrimaryCat = 1 AND ItemResourceId = %s'; - $primary_cat_id = $this->Conn->GetCol( sprintf($sql, $ci_table, $resource_id) ); - if( count($primary_cat_id) == 0 ) - { - $sql = 'UPDATE %s SET PrimaryCat = 1 WHERE (CategoryId = %s) AND (ItemResourceId = %s)'; - $this->Conn->Query( sprintf($sql, $ci_table, reset($cats_left), $resource_id ) ); - } - } - } - - /** - * replace not allowed symbols with "_" chars + remove duplicate "_" chars in result - * - * @param string $string - * @return string - */ - function stripDisallowed($filename) - { - $filenames_helper =& $this->Application->recallObject('FilenamesHelper'); - $table = $this->mode == 't' ? $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems', 'prefix:'.$this->Prefix) : TABLE_PREFIX.'CategoryItems'; - - return $filenames_helper->stripDisallowed($table, 'ItemResourceId', $this->GetDBField('ResourceId'), $filename); - } - - /* commented out because it's called only from stripDisallowed body, which is moved to helper - - function checkAutoFilename($filename) - { - $filenames_helper =& $this->Application->recallObject('FilenamesHelper'); - return $filenames_helper->checkAutoFilename($this->TableName, $this->IDField, $this->GetID(), $filename); - }*/ - - /** - * Generate item's filename based on it's title field value - * - * @return string - */ - function generateFilename() - { - if ( !$this->GetDBField('AutomaticFilename') && $this->GetDBField('Filename') ) return false; - - $title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField'); - if (preg_match('/l([\d]+)_(.*)/', $title_field, $regs)) { - // if title field is multilingual, then use it's name from primary language - $title_field = 'l'.$this->Application->GetDefaultLanguageId().'_'.$regs[2]; - } - $name = $this->stripDisallowed( $this->GetDBField($title_field) ); - - if ( $name != $this->GetDBField('Filename') ) $this->SetDBField('Filename', $name); - } - - /** - * Check if value is set for required field - * - * @param string $field field name - * @param Array $params field options from config - * @return bool - * @access private - */ - function ValidateRequired($field, $params) - { - $res = true; - if (getArrayValue($params, 'required')) { - $res = ( (string) $this->FieldValues[$field] != ''); - } - if (!$res) { - $this->SetError($field, 'required'); - } - return $res; - } - - /** - * Adds item to other category - * - * @param int $category_id - * @param bool $is_primary - */ - function assignToCategory($category_id, $is_primary = false) - { - $table = $this->CategoryItemsTable(); - $key_clause = '(ItemResourceId = '.$this->GetDBField('ResourceId').')'; - - // get all cateories, where item is in - $sql = 'SELECT PrimaryCat, CategoryId FROM '.$table.' WHERE '.$key_clause; - $item_categories = $this->Conn->GetCol($sql, 'CategoryId'); - if (!$item_categories) { - $item_categories = Array(); - $primary_found = false; - } - - // find primary category - foreach ($item_categories as $item_category_id => $primary_found) { - if ($primary_found) { - break; - } - } - - if ($primary_found && ($item_category_id == $category_id) && !$is_primary) { - // want to make primary category as non-primary :( - return true; - } - else if (!$primary_found) { - $is_primary = true; - } - - if ($is_primary && $item_categories) { - // reset primary mark from all other categories - $sql = 'UPDATE '.$table.' SET PrimaryCat = 0 WHERE '.$key_clause; - $this->Conn->Query($sql); - } - - // UPDATE & INSERT instead of REPLACE because CategoryItems table has no primary key defined in database - if (isset($item_categories[$category_id])) { - $sql = 'UPDATE '.$table.' SET PrimaryCat = '.($is_primary ? 1 : 0).' WHERE '.$key_clause.' AND (CategoryId = '.$category_id.')'; - $this->Conn->Query($sql); - } - else { - $fields_hash = Array( - 'CategoryId' => $category_id, - 'ItemResourceId' => $this->GetField('ResourceId'), - 'PrimaryCat' => $is_primary ? 1 : 0, - 'ItemPrefix' => $this->Prefix, - 'Filename' => $this->useFilenames ? $this->GetDBField('Filename') : '', // because some prefixes does not use filenames, - ); - $this->Conn->doInsert($fields_hash, $table); - } - // to ensure filename update after adding to another category - // this is critical since there may be an item with same filename in newly added category! - $this->Update(); - } - - /** - * Removes item from category specified - * - * @param int $category_id - */ - function removeFromCategory($category_id) - { - $sql = 'DELETE FROM '.TABLE_PREFIX.'CategoryItems WHERE (CategoryId = %s) AND (ItemResourceId = %s)'; - $this->Conn->Query( sprintf($sql, $category_id, $this->GetDBField('ResourceId')) ); - } - - /** - * Returns list of columns, that could exist in imported file - * - * @return Array - */ - function getPossibleExportColumns() - { - static $columns = null; - if (!is_array($columns)) { - $columns = array_merge($this->Fields['AvailableColumns']['options'], $this->Fields['ExportColumns']['options']); - } - return $columns; - } - - /** - * Returns item's primary image data - * - * @return Array - */ - function getPrimaryImageData() - { - $sql = 'SELECT * - FROM '.TABLE_PREFIX.'Images - WHERE (ResourceId = '.$this->GetDBField('ResourceId').') AND (DefaultImg = 1)'; - $image_data = $this->Conn->GetRow($sql); - if (!$image_data) { - // 2. no primary image, then get image with name "main" - $sql = 'SELECT * - FROM '.TABLE_PREFIX.'Images - WHERE (ResourceId = '.$this->GetDBField('ResourceId').') AND (Name = "main")'; - $image_data = $this->Conn->GetRow($sql); - } - return $image_data; - } - - function ChangeStatus($new_status) - { - $status_field = array_shift( $this->Application->getUnitOption($this->Prefix,'StatusField') ); - if ($new_status != $this->GetDBField($status_field)) { - // status was changed - $this->sendEmailEvents($new_status); - } - $this->SetDBField($status_field, $new_status); - - return $this->Update(); - } - - function sendEmailEvents($new_status) - { - $perm_prefix = $this->Application->getUnitOption($this->Prefix, 'PermItemPrefix'); - $owner_field = $this->Application->getUnitOption($this->Prefix, 'OwnerField'); - if (!$owner_field) { - $owner_field = 'CreatedById'; - } - - $event_name = $perm_prefix.'.'.($new_status == STATUS_ACTIVE ? 'APPROVE' : 'DENY'); - $this->Application->EmailEventUser($event_name, $this->GetDBField($owner_field)); - } - - /** - * Approves changes made to category item - * - * @return bool - */ - function ApproveChanges() - { - $original_id = $this->GetDBField('OrgId'); - - if (!($this->usePendingEditing && $original_id)) { - // non-pending copy of original link - return $this->ChangeStatus(STATUS_ACTIVE); - } - - if ($this->raiseEvent('OnBeforeDeleteOriginal', null, Array('original_id' => $original_id))) { - // delete original item, because changes made in pending copy (this item) got to be approved in this method - $temp_handler =& $this->Application->recallObject($this->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($this->Prefix, $this->Special, Array($original_id)); - - $this->SetDBField('OrgId', 0); - return $this->ChangeStatus(STATUS_ACTIVE); - } - - return false; - } - - /** - * Decline changes made to category item - * - * @return bool - */ - function DeclineChanges() - { - $original_id = $this->GetDBField('OrgId'); - - if (!($this->usePendingEditing && $original_id)) { - // non-pending copy of original link - return $this->ChangeStatus(STATUS_DISABLED); - } - - // delete this item, because changes made in pending copy (this item) will be declined in this method - $temp_handler =& $this->Application->recallObject($this->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($this->Prefix, $this->Special, Array($this->GetID())); - - // original item is not changed here, because it is already enabled (thrus pending copy is visible to item's owner or admin with permission) - return true; - } - - function RegisterHit() - { - $already_viewed = $this->Application->RecallVar($this->getPrefixSpecial().'_already_viewed'); - $already_viewed = $already_viewed ? unserialize($already_viewed) : Array (); - - $id = $this->GetID(); - if (!in_array($id, $already_viewed)) { - $property_map = $this->Application->getUnitOption($this->Prefix, 'ItemPropertyMappings'); - if (!$property_map) { - return ; - } - $hits_field = $property_map['ClickField']; - $new_hits = $this->GetDBField($hits_field) + 1; - - $sql = 'SELECT MAX('.$hits_field.') - FROM '.$this->TableName.' - WHERE FLOOR('.$hits_field.') = '.$new_hits; - $max_hits = $this->Conn->GetOne($sql); - if ($max_hits) { - $new_hits = $max_hits + 0.000001; - } - - $fields_hash = Array ( - $hits_field => $new_hits, - ); - $this->Conn->doUpdate($fields_hash, $this->TableName, $this->IDField.' = '.$id); - - array_push($already_viewed, $id); - $this->Application->StoreVar($this->getPrefixSpecial().'_already_viewed', serialize($already_viewed)); - } - } - - /** - * Returns part of SQL WHERE clause identifing the record, ex. id = 25 - * - * @access public - * @param string $method Child class may want to know who called GetKeyClause, Load(), Update(), Delete() send its names as method - * @param Array $keys_hash alternative, then item id, keys hash to load item by - * @return void - * @see kDBItem::Load() - * @see kDBItem::Update() - * @see kDBItem::Delete() - */ - function GetKeyClause($method = null, $keys_hash = null) - { - if ($method == 'load') { - // for item with many categories makes primary to load - $ci_table = TABLE_PREFIX.'CategoryItems'; - if ($this->IsTempTable()) { - $ci_table = $this->Application->GetTempName($ci_table, 'prefix:'.$this->Prefix); - } - $keys_hash = Array( - $this->IDField => $this->ID, - '`'.$ci_table.'`.`PrimaryCat`' => 1, - ); - } - return parent::GetKeyClause($method, $keys_hash); - } - -} - -?> \ No newline at end of file Index: branches/5.1.x/core/units/configuration/configuration_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/configuration/configuration_config.php (.../configuration_config.php) (revision 12127) +++ branches/5.1.x/core/units/configuration/configuration_config.php (.../configuration_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'conf', - 'ItemClass' => Array('class'=>'ConfigurationItem','file'=>'configuration.php','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'ConfigurationEventHandler','file'=>'configuration_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'ConfigurationTagProcessor','file'=>'configuration_tag_processor.php','build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'page', - 3 => 'event', - 4 => 'mode', - ), +defined('FULL_PATH') or die('restricted access!'); - 'IDField' => 'VariableId', - 'TitleField' => 'VariableName', + $config = Array ( + 'Prefix' => 'conf', + 'ItemClass' => Array ('class' => 'ConfigurationItem', 'file' => 'configuration.php', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'ConfigurationEventHandler', 'file' => 'configuration_event_handler.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'ConfigurationTagProcessor', 'file' => 'configuration_tag_processor.php', 'build_event' => 'OnBuild'), - 'TitlePresets' => Array( - 'default' => Array('tag_params' => Array('conf' => Array('per_page' => -1))), + 'AutoLoad' => true, - 'config_list_general' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"), - 'config_list_output' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"), - 'config_list_contacts' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"), + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'event', + 4 => 'mode', + ), - 'config_list_categories' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"), - 'config_list_users' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"), + 'IDField' => 'VariableId', + 'TitleField' => 'VariableName', - 'section_label' => Array ('prefixes' => Array ('conf_List'), 'format' => "#section_label#"), - ), + 'TitlePresets' => Array ( + 'default' => Array ('tag_params' => Array ('conf' => Array ('per_page' => -1))), - 'TableName' => TABLE_PREFIX.'ConfigurationValues', + 'config_list_general' => Array ('prefixes' => Array ('conf_List'), 'format' => "!la_updating_config!"), + 'config_list_output' => Array ('prefixes' => Array ('conf_List'), 'format' => "!la_updating_config!"), + 'config_list_contacts' => Array ('prefixes' => Array ('conf_List'), 'format' => "!la_updating_config!"), - 'ListSQLs' => Array('' => ' SELECT %1$s.* %2$s - FROM '.TABLE_PREFIX.'ConfigurationAdmin ca - LEFT JOIN %1$s USING(VariableName)'), + 'config_list_categories' => Array ('prefixes' => Array ('conf_List'), 'format' => "!la_updating_config!"), + 'config_list_users' => Array ('prefixes' => Array ('conf_List'), 'format' => "!la_updating_config!"), - 'ItemSQLs' => Array('' => ' SELECT %1$s.* %2$s - FROM '.TABLE_PREFIX.'ConfigurationAdmin ca - LEFT JOIN %1$s USING(VariableName)'), + 'section_label' => Array ('prefixes' => Array ('conf_List'), 'format' => "#section_label#"), + ), - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('DisplayOrder' => 'asc', 'GroupDisplayOrder' => 'asc'), - ) - ), + 'TableName' => TABLE_PREFIX . 'ConfigurationValues', - 'CalculatedFields' => Array ( - '' => Array ( - 'heading' => 'ca.heading', - 'prompt' => 'ca.prompt', - 'element_type' => 'ca.element_type', - 'ValueList' => 'ca.ValueList', - 'DisplayOrder' => 'ca.DisplayOrder', - 'GroupDisplayOrder' => 'ca.GroupDisplayOrder', - 'Install' => 'ca.Install', - ), - ), + 'ListSQLs' => Array ( + '' => ' SELECT %1$s.* %2$s + FROM ' . TABLE_PREFIX . 'ConfigurationAdmin ca + LEFT JOIN %1$s USING(VariableName)' + ), - 'Fields' => Array( - 'VariableId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'VariableName' => Array('type' => 'string','not_null' => '1','default' => ''), - 'VariableValue' => Array('type'=>'string', 'default' => null), - 'ModuleOwner' => Array('type'=>'string', 'default'=>'In-Portal'), - 'Section' => Array('type'=>'string','not_null' => '1','default'=>''), - ), - 'VirtualFields' => Array( - 'heading' => Array('type' => 'string', 'default' => ''), - 'prompt' => Array('type' => 'string', 'default' => ''), - 'element_type' => Array('type' => 'string', 'not_null' => '1', 'default' => ''), - 'ValueList' => Array('type' => 'string', 'default' => ''), - 'DisplayOrder' => Array('type' => 'double', 'not_null' => '1', 'default' => 0), - 'GroupDisplayOrder' => Array('type' => 'double', 'not_null' => '1', 'default' => 0), - 'Install' => Array('type' => 'int', 'not_null' => '1', 'default' => 1), - 'DirectOptions' => Array('type' => 'string', 'default' => ''), - ), - 'Grids' => Array(), - ); + 'ListSortings' => Array ( + '' => Array ( + 'Sorting' => Array ('DisplayOrder' => 'asc', 'GroupDisplayOrder' => 'asc'), + ) + ), -?> \ No newline at end of file + 'CalculatedFields' => Array ( + '' => Array ( + 'heading' => 'ca.heading', + 'prompt' => 'ca.prompt', + 'element_type' => 'ca.element_type', + 'Validation' => 'ca.Validation', + 'ValueList' => 'ca.ValueList', + 'DisplayOrder' => 'ca.DisplayOrder', + 'GroupDisplayOrder' => 'ca.GroupDisplayOrder', + 'Install' => 'ca.Install', + ), + ), + + 'Fields' => Array ( + 'VariableId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'VariableName' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''), + 'VariableValue' => Array ('type' => 'string', 'default' => null), + 'ModuleOwner' => Array ('type' => 'string', 'default' => 'In-Portal'), + 'Section' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''), + ), + + 'VirtualFields' => Array ( + 'heading' => Array ('type' => 'string', 'default' => ''), + 'prompt' => Array ('type' => 'string', 'default' => ''), + 'element_type' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''), + 'Validation' => Array ('type' => 'string', 'default' => ''), + 'ValueList' => Array ('type' => 'string', 'default' => ''), + 'DisplayOrder' => Array ('type' => 'double', 'not_null' => '1', 'default' => 0), + 'GroupDisplayOrder' => Array ('type' => 'double', 'not_null' => '1', 'default' => 0), + 'Install' => Array ('type' => 'int', 'not_null' => '1', 'default' => 1), + 'DirectOptions' => Array ('type' => 'string', 'default' => ''), + ), + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/categories/categories_edit_related_searches.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/categories/categories_edit_related_searches.tpl (.../categories_edit_related_searches.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/categories/categories_edit_related_searches.tpl (.../categories_edit_related_searches.tpl) (revision 12657) @@ -35,7 +35,7 @@ a_toolbar.AddButton( new ToolBarSeparator('sep2') ); //Relations related: - a_toolbar.AddButton( new ToolBarButton('new_related_search', '', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { std_new_item('c-search', 'categories/related_searches_edit') } ) ); Index: branches/5.1.x/core/units/mailing_lists/mailing_list_eh.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/mailing_lists/mailing_list_eh.php (.../mailing_list_eh.php) (revision 12127) +++ branches/5.1.x/core/units/mailing_lists/mailing_list_eh.php (.../mailing_list_eh.php) (revision 12657) @@ -1,6 +1,6 @@ ::', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { std_precreate_item('lang', 'regional/languages_edit') } ) ); @@ -43,7 +43,7 @@ Index: branches/5.1.x/core/admin_templates/browser/browser_header.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/browser/browser_header.tpl (.../browser_header.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/browser/browser_header.tpl (.../browser_header.tpl) (revision 12657) @@ -1,15 +1,15 @@ - + <inp2:m_GetConfig var="Site_Name"/> - <inp2:m_Phrase label="la_AdministrativeConsole"/> - - - - - - + + + + + + @@ -19,17 +19,14 @@ - + - - - - - - - @@ -54,4 +52,3 @@ > - Index: branches/5.1.x/core/units/selectors/selectors_tag_processor.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/selectors/selectors_tag_processor.php (.../selectors_tag_processor.php) (revision 12127) +++ branches/5.1.x/core/units/selectors/selectors_tag_processor.php (.../selectors_tag_processor.php) (revision 12657) @@ -1,6 +1,6 @@ Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); $style_data = $object->GetDBField( $params['field'] ); - + $ret = $object->CompileStyleBody( getArrayValue($params,'inline') ? STYLE_INLINE : STYLE_PREVIEW ); - + return $ret; } - + /** * Returns input field name to * be placed on form (for correct @@ -40,11 +41,11 @@ $subfield = getArrayValue($params,'subfield'); if($subfield && $subfield != '$subfield') { - $ret .= '['.$subfield.']'; + $ret .= '['.$subfield.']'; } return $ret; } - + function Field($params) { $subfield = getArrayValue($params,'subfield'); @@ -56,11 +57,11 @@ if($subfield && $subfield != '$subfield') { $ret = getArrayValue($ret,$subfield); - return $ret !== false ? $ret : ''; + return $ret !== false ? $ret : ''; } return $ret; } - + function PredefinedOptions($params) { $field = $params['field']; @@ -69,10 +70,10 @@ $value = $object->GetDBField($field); $subfield = getArrayValue($params,'subfield'); if($subfield && $subfield != '$subfield') $value = $value[$subfield]; - + $value_field = getArrayValue($params,'value_field'); if(!$value_field) $value_field = $field; - + $options = $object->GetFieldOptions($value_field); $block_params['name'] = $params['block']; @@ -95,7 +96,5 @@ return $o; } - - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/general/libchart/classes/view/chart/LineChart.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/chart/LineChart.php (.../LineChart.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/chart/LineChart.php (.../LineChart.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * Line chart. * @@ -196,5 +198,4 @@ $this->plot->render($fileName); } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/general/cat_dblist.php =================================================================== diff -u -N --- branches/5.1.x/core/units/general/cat_dblist.php (revision 12127) +++ branches/5.1.x/core/units/general/cat_dblist.php (revision 0) @@ -1,37 +0,0 @@ -Special) - { - case 'showall': - $this->clearFilters(false,true,false,false); - break; - } - return parent::GetWhereClause($for_counting,$system_filters_only); - }*/ - -} - -?> \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_review.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/configuration/configuration_tag_processor.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 12127) +++ branches/5.1.x/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 12657) @@ -1,6 +1,6 @@ SetDBField('VariableValue', $field_values[$list->GetDBField('VariableName')]['VariableValue']); + $list->SetDBField('VariableValue', $field_values[$list->GetID()]['VariableValue']); } $list->SetDBField('DirectOptions', ''); @@ -135,22 +137,27 @@ return $this->Application->ConfigValue($params['name']); } + function IsRequired($params) + { + $object =& $this->getObject($params);; + /* @var $object kDBList */ + + $field_options = $object->GetDBField('Validation'); + $field_options = $field_options ? unserialize($field_options) : Array (); + + return array_key_exists('required', $field_options) && $field_options['required']; + } + function Error($params) { - $object =& $this->Application->recallObject( $this->getPrefixSpecial() ); + $object =& $this->getObject($params); + /* @var $object kDBList */ + $field = $object->GetDBField($params['id_field']); - $errors = $this->Application->GetVar('errormsgs'); - $errors = $errors[$this->getPrefixSpecial()]; + $errors = $this->Application->GetVar('errors_' . $this->getPrefixSpecial(), Array ()); - if (isset($errors[$field])) { - $msg = $this->Application->Phrase($errors[$field]); - } - else { - $msg = ''; - } - - return $msg; + return array_key_exists($field, $errors) ? $errors[$field] : ''; } /** @@ -239,6 +246,4 @@ return is_writable($this->ConfigValue($params)); } -} - -?> \ No newline at end of file +} \ No newline at end of file Index: branches/5.1.x/core/units/user_profile/user_profile_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/user_profile/user_profile_config.php (.../user_profile_config.php) (revision 12127) +++ branches/5.1.x/core/units/user_profile/user_profile_config.php (.../user_profile_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'user-profile', 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -44,6 +46,4 @@ 'VariableName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''), 'VariableValue' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_language_primary.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_theme_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_summary_logs.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/browser/browser_footer.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/browser/browser_footer.tpl (.../browser_footer.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/browser/browser_footer.tpl (.../browser_footer.tpl) (revision 12657) @@ -14,7 +14,7 @@ - +

Index: branches/5.1.x/core/kernel/utility/formatters/password_formatter.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/formatters/password_formatter.php (.../password_formatter.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/formatters/password_formatter.php (.../password_formatter.php) (revision 12657) @@ -1,6 +1,6 @@ $field_name, 'formatter' => 'kPasswordFormatter'); - if (isset($field_options['encryption_method'])) { - $options['encryption_method'] = $field_options['encryption_method']; + if ( isset( $field_options['verify_field'] ) ) { + $add_fields = Array (); + $options = Array ('master_field' => $field_name, 'formatter' => 'kPasswordFormatter'); + + $copy_options = Array ('encryption_method', 'salt', 'required', 'skip_empty'); + foreach ($copy_options as $copy_option) { + if (array_key_exists($copy_option, $field_options)) { + $options[$copy_option] = $field_options[$copy_option]; + } } - if (isset($field_options['salt'])) { - $options['salt'] = $field_options['salt']; - } - if (isset($field_options['required'])) { - $options['required'] = $field_options['required']; - } + $add_fields[ $field_options['verify_field'] ] = $options; $add_fields[$field_name.'_plain'] = Array('type'=>'string', 'error_field'=>$field_name); @@ -57,63 +55,68 @@ { $options = $object->GetFieldOptions($field_name); - $fields = Array('master_field','verify_field'); - $fields_set = true; $flip_count = 0; - while($flip_count < 2) - { - if( getArrayValue($options,$fields[0]) ) - { + $fields_set = true; + $fields = Array ('master_field', 'verify_field'); + + // 1. collect values from both Password and VerifyPassword fields + while ($flip_count < 2) { + if ( getArrayValue($options, $fields[0]) ) { $object->SetDBField($field_name.'_plain', $value); - if( !getArrayValue($object->Fields[ $options[ $fields[0] ] ], $fields[1].'_set') ) - { + + if ( !getArrayValue($object->Fields[ $options[ $fields[0] ] ], $fields[1].'_set') ) { $object->Fields[ $options[ $fields[0] ] ][$fields[1].'_set'] = true; } $password_field = $options[ $fields[0] ]; $verify_field = $field_name; } + $fields = array_reverse($fields); $flip_count++; } $salt = isset($object->Fields[$password_field]['salt']) ? $object->Fields[$password_field]['salt'] : ''; - if( getArrayValue($object->Fields[$password_field], 'verify_field_set') && getArrayValue($object->Fields[$verify_field], 'master_field_set') ) - { - $new_password = $object->GetDBField($password_field.'_plain'); - $verify_password = $object->GetDBField($verify_field.'_plain'); - if($new_password == '' && $verify_password == '') - { - if( $object->GetDBField($password_field) != $this->EncryptPassword('', $salt) ) - { - if ($options['encryption_method'] == 'plain') return $value; + if (getArrayValue($object->Fields[$password_field], 'verify_field_set') && getArrayValue($object->Fields[$verify_field], 'master_field_set')) { + $new_password = $object->GetDBField($password_field . '_plain'); + $verify_password = $object->GetDBField($verify_field . '_plain'); + + if ($new_password == '' && $verify_password == '') { + // both passwords are empty -> keep old password + if ($object->GetDBField($password_field) != $this->EncryptPassword('', $salt)) { + if ($options['encryption_method'] == 'plain') { + return $value; + } + return $this->EncryptPassword($value); } - else - { - $object->Fields[$password_field.'_plain']['required'] = true; - $object->Fields[$verify_field.'_plain']['required'] = true; - return null; + else { + return $value; } } - $min_length = $this->Application->ConfigValue('Min_Password'); - if (mb_strlen($new_password) >= $min_length) { - if ($new_password != $verify_password) { - $object->SetError($password_field, 'passwords_do_not_match', 'lu_passwords_do_not_match'); - $object->SetError($verify_field, 'passwords_do_not_match', 'lu_passwords_do_not_match'); - } + if ($new_password != $verify_password) { + // passwords don't match (no matter what is their length) + $object->SetError($verify_field, 'passwords_do_not_match', 'lu_passwords_do_not_match'); } - else { - $error_msg = '+'.sprintf($this->Application->Phrase('lu_passwords_too_short'), $min_length); // + -> not phrase + + $min_length = $this->Application->ConfigValue('Min_Password'); // for error message too + + if (mb_strlen($new_password) < $min_length) { + $error_msg = '+' . sprintf($this->Application->Phrase('lu_passwords_too_short'), $min_length); // + -> not phrase $object->SetError($password_field, 'passwords_min_length', $error_msg); - $object->SetError($verify_field, 'passwords_min_length', $error_msg); } } - if($value == '') return $object->GetDBField($field_name); - if ($options['encryption_method'] == 'plain') return $value; + if ($value == '') { + return $object->GetDBField($field_name); + } + + if ($options['encryption_method'] == 'plain') { + return $value; + } + return $this->EncryptPassword($value, $salt); } Index: branches/5.1.x/core/units/help/help_config.php =================================================================== diff -u -N --- branches/5.1.x/core/units/help/help_config.php (revision 12127) +++ branches/5.1.x/core/units/help/help_config.php (revision 0) @@ -1,28 +0,0 @@ - 'h', - 'EventHandlerClass' => Array('class'=>'HelpEventHandler','file'=>'help_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'HelpTagProcessor','file'=>'help_tag_processor.php','build_event'=>'OnBuild'), - 'QueryString' => Array( - 1 => 'prefix', - 2 => 'icon', - 3 => 'module', - 4 => 'title_preset', - 5 => 'event', - ), - ); - -?> \ No newline at end of file Index: branches/5.1.x/core/units/help/help_tag_processor.php =================================================================== diff -u -N --- branches/5.1.x/core/units/help/help_tag_processor.php (revision 12127) +++ branches/5.1.x/core/units/help/help_tag_processor.php (revision 0) @@ -1,119 +0,0 @@ -Application->GetVar('h_prefix') ); - $this->Prefix = $rets[0]; - $this->Special = isset($rets[1]) ? $rets[1] : ''; - //$this->Prefix = $this->Application->GetVar('h_prefix'); - - $title_preset_name = replaceModuleSection($this->Application->GetVar('h_title_preset')); - $this->Application->SetVar('h_title_preset', $title_preset_name); - $title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets'); - - $format = $title_presets[$title_preset_name]['format']; - $format = preg_replace('/[ ]*( ([\'"]{1}) | ([\(]{1}) ) \#.*\# (?(2) \1 | \) )[ ]*/Ux', ' ', $format); - $title_presets[$title_preset_name]['format'] = $format; - $this->Application->setUnitOption($this->Prefix,'TitlePresets',$title_presets); - - $params['title_preset'] = $title_preset_name; - return parent::SectionTitle($params); - } - - function getModule() - { - $module = $this->Application->GetVar('h_module'); - if (!$module) { - $module = $this->Application->RecallVar('module'); - } - return $module; - } - - function ShowHelp($params) - { - $module = $this->getModule(); - - $module = explode(':', $module); - $module = $module[0]; - - $title_preset = $this->Application->GetVar('h_title_preset'); - - $module_path = $this->Application->findModule('Name', $module, 'Path'); - $help_file = FULL_PATH.'/'.$module_path.'module_help/'.$title_preset.'.txt'; - - if ($this->Application->isDebugMode() && constOn('DBG_EDIT_HELP')) { - global $debugger; - $ret = 'Help file: '.$debugger->getLocalFile($help_file).'
'; - } - else { - $ret = ''; - } - - $help_data = file_exists($help_file) ? file_get_contents($help_file) : false; - - if( $this->Application->isDebugMode() && constOn('DBG_HELP') ) - { - $this->Application->Factory->includeClassFile('FCKeditor'); - $oFCKeditor = new FCKeditor('HelpContent'); - - $oFCKeditor->BasePath = $this->Application->BaseURL('/admin/editor/cmseditor'); - $oFCKeditor->Width = '100%'; - $oFCKeditor->Height = '300'; - $oFCKeditor->ToolbarSet = 'Advanced'; - $oFCKeditor->Value = $help_data; - - $oFCKeditor->Config = Array( - 'UserFilesPath' => (defined('WRITEABLE') ? WRITEABLE : FULL_PATH.'/kernel') . '/user_files', - 'ProjectPath' => $this->Application->ConfigValue('Site_Path'), - 'CustomConfigurationsPath' => rtrim( $this->Application->BaseURL('/admin/editor/inp_fckconfig.js'), '/'), - ); - - $ret .= $oFCKeditor->CreateHtml(); - } - else - { - $ret .= $help_data ? $help_data : $this->Application->Phrase('la_section_help_file_missing'); - } - - return $ret; - } - - function GetIcon($params) - { - $icon_var = getArrayValue($params,'var_name'); - $icon = replaceModuleSection($this->Application->GetVar($icon_var)); - - if(!$icon) $icon = getArrayValue($params,'default_icon'); - return $icon; - } - - /** - * Returns templates path for module, which is gathered from prefix module - * - * @param Array $params - * @return string - * @author Alex - */ - function ModulePath($params) - { - $module_folder = trim( $this->Application->findModule('Name', $this->getModule(), 'Path'), '/'); - return '../../'.$module_folder.'/admin_templates/'; - } - } - -?> \ No newline at end of file Index: branches/5.1.x/core/units/help/help_event_handler.php =================================================================== diff -u -N --- branches/5.1.x/core/units/help/help_event_handler.php (revision 12127) +++ branches/5.1.x/core/units/help/help_event_handler.php (revision 0) @@ -1,42 +0,0 @@ -Application->GetVar('HelpContent'); - - $module = $this->Application->GetVar('h_module'); - $title_preset = $this->Application->GetVar('h_title_preset'); - - $sql = 'SELECT Path FROM '.TABLE_PREFIX.'Modules WHERE LOWER(Name)='.$this->Conn->qstr( mb_strtolower($module) ); - $module_path = $this->Conn->GetOne($sql); - - $help_file = FULL_PATH.'/'.$module_path.'module_help/'.$title_preset.'.txt'; - $help_data = $this->Application->GetVar('HelpContent'); - - $fp = fopen($help_file,'w'); - fwrite($fp,$help_data); - fclose($fp); - } - } - -?> \ No newline at end of file Index: branches/5.1.x/core/units/email_events/email_events_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Application->getUnitOption($event->Prefix, 'TableName'); $sql = 'UPDATE '.$table_name.' - SET Enabled = 2 + SET FrontEndOnly = 1 WHERE EventId IN ('.$ids.')'; $this->Conn->Query($sql); + + $this->clearSelectedIDs($event); } /** @@ -99,6 +103,11 @@ */ function OnSelectUser(&$event) { + if ($event->Special != 'module') { + parent::OnSelectUser($event); + return ; + } + $items_info = $this->Application->GetVar('u'); if ($items_info) { $user_id = array_shift( array_keys($items_info) ); @@ -152,21 +161,26 @@ return false; } - $enabled = $email_event->GetDBField('Enabled'); - if ($enabled == EVENT_STATUS_DISABLED) { + if ($email_event->GetDBField('Enabled') == STATUS_DISABLED) { return false; } - if ($enabled == EVENT_STATUS_FRONTEND && $this->Application->IsAdmin()) { + + if ($email_event->GetDBField('FrontEndOnly') && $this->Application->IsAdmin()) { return false; } // initial values $to_user_id = $event->getEventParam('EmailEventToUserId'); + if ( !is_numeric($to_user_id) ) { + $to_user_id = -1; // when not specified, then send to "root" + } $from_user_id = $email_event->GetDBField('FromUserId'); if ($email_event->GetDBField('Type') == EVENT_TYPE_ADMIN) { // For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list - $to_user_id = $from_user_id; + if ($to_user_id == -1) { + $to_user_id = $from_user_id; + } $from_user_id = -1; } @@ -190,7 +204,7 @@ /* @var $user UsersItem */ $email = $name = ''; - $result = $user_id > 0 ? $user->Load($user_id) : $user->Clear(); + $result = $user_id > 0 ? $user->Load( (int)$user_id ) : $user->Clear(); if ($user->IsLoaded()) { $email = $user->GetDBField('Email'); $name = trim($user->GetDBField('FirstName').' '.$user->GetDBField('LastName')); @@ -299,23 +313,11 @@ $this->Application->InitParser(); $parser_params = $this->Application->Parser->Params; // backup parser params - // ==== for TemplateParser class only: begin ==== -// $parser_pattern = $this->Application->Parser->Pattern; -// $parser_values = $this->Application->Parser->Values; -// $this->Application->Parser->Pattern = Array(); // fixes bug in TemplateParser::SortParams -// $this->Application->Parser->Values = Array(); // fixes bug in TemplateParser::SortParams - // ==== for TemplateParser class only: end ==== - $this->Application->Parser->SetParams( array_merge_recursive2($parser_params, $direct_params) ); $message = implode('&|&', explode("\n\n", $message, 2)); // preserves double \n in case when tag is located in subject field $message = $this->Application->Parser->Parse($message, 'email_template', 0); - // ==== for TemplateParser class only: begin ==== -// $this->Application->Parser->Pattern = $parser_pattern; -// $this->Application->Parser->Values = $parser_values; - // ==== for TemplateParser class only: end ==== - $this->Application->Parser->SetParams($parser_params); // restore parser params // 2. replace line endings, that are send with data submitted via request @@ -386,6 +388,11 @@ $message_subject = isset($message_headers['Subject']) ? $message_headers['Subject'] : 'Mail message'; $esender->SetSubject($message_subject); + if ($this->Application->isDebugMode()) { + // set special header with event name, so it will be easier to determite what's actually was received + $message_headers['X-Event-Name'] = $email_event_name . ' - ' . ($event->getEventParam('EmailEventType') == 1 ? 'ADMIN' : 'USER'); + } + foreach ($message_headers as $header_name => $header_value) { $esender->SetEncodedHeader($header_name, $header_value); } @@ -419,10 +426,11 @@ function _getSendLanguage($send_params) { - if (!is_array($send_params) && $this->Application->isDebugMode()) { - $this->Application->Debugger->appendTrace(); + if ($send_params && array_key_exists('language_id', $send_params)) { + return $send_params['language_id']; } - return array_key_exists('language_id', $send_params) ? $send_params['language_id'] : $this->Application->GetVar('m_lang'); + + return $this->Application->GetVar('m_lang'); } function _changeLanguage($language_id = null) @@ -511,5 +519,4 @@ echo ($emails_sent / $total_emails) * 100; } } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/users/users_list.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/users/users_list.tpl (.../users_list.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/users/users_list.tpl (.../users_list.tpl) (revision 12657) @@ -15,7 +15,7 @@ } var a_toolbar = new ToolBar(); - a_toolbar.AddButton( new ToolBarButton('new_user', '::', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { set_hidden_field('remove_specials[u.regular]', 1); std_precreate_item('u.regular', 'users/users_edit') Index: branches/5.1.x/core/admin_templates/js/uploader/upload_manager.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/uploader/upload_manager.js (.../upload_manager.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/uploader/upload_manager.js (.../upload_manager.js) (revision 12657) @@ -65,7 +65,15 @@ } } -UploadsManager.iterate = function($method) { +UploadsManager.iterate = function($method, $timeout) { + var $me = this; + + if (isset($timeout)) { + // make delayed iteration (helps with direct innerHTML assignments in IE) + setTimeout(function() { $me.iterate($method); }, $timeout); + return ; + } + for (var i in this._Uploaders) { var args = Array.prototype.slice.call(arguments); // convert to array args.splice(0, 1); // remove method name Index: branches/5.1.x/core/admin_templates/incs/sections_list.css =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/incs/sections_list.css (.../sections_list.css) (revision 12127) +++ branches/5.1.x/core/admin_templates/incs/sections_list.css (.../sections_list.css) (revision 12657) @@ -19,7 +19,7 @@ font-weight: bold; font-size: 12px; color: #ffffff; - background: url(../img/summary/overviewbox_header.gif) top left no-repeat; + background: url('../img/summary/overviewbox_header.gif') top left no-repeat; } .overviewbox_body { @@ -56,13 +56,13 @@ font-weight: bold; font-size: 12px; color: #000000; - background: url(../img/summary/searchbox_header.gif) top left no-repeat; + background: url('../img/summary/searchbox_header.gif') top left no-repeat; } .searchbox_body { border: 1px solid #666767; height: 65px; - background: url(../img/summary/searchbox_bg.gif) top left; + background: url('../img/summary/searchbox_bg.gif') top left; } .search { @@ -93,12 +93,12 @@ font-weight: bold; font-size: 12px; color: #000000; - background: url(../img/summary/usersbox_header.gif) top left no-repeat; + background: url('../img/summary/usersbox_header.gif') top left no-repeat; } .usersbox_body { border: 1px solid #666767; - background: url(../img/summary/usersbox_bg.gif) top left; + background: url('../img/summary/usersbox_bg.gif') top left; } .lTDi { Index: branches/5.1.x/core/admin_templates/skins/skin_edit.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/skins/skin_edit.tpl (.../skin_edit.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/skins/skin_edit.tpl (.../skin_edit.tpl) (revision 12657) @@ -241,10 +241,12 @@ - + + + + + - - + +
Tree Color (TreeColor)Tree Item Color (TreeColor)Tree Item Hover Color (TreeHoverColor)Tree Highlighted Item Color (TreeHighColor)Tree Highlighted Item Hover Color (TreeHighHoverColor)Tree Highlighted Item Background Color (TreeHighBgColor) Tree Background Color (TreeBgColor)Tree Highlighted Color (TreeHighColor)Tree Highlighted Background Color (TreeHighBgColor)
@@ -254,8 +256,8 @@ [TreeBgColor][Value]" - value=""> + name="[TreeHoverColor][Value]" + value=""> [TreeHighHoverColor][Value]" + value=""> + + [TreeHighBgColor][Value]" value=""> + [TreeBgColor][Value]" + value=""> +
Index: branches/5.1.x/core/admin_templates/incs/style_template.css =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/incs/style_template.css (.../style_template.css) (revision 12127) +++ branches/5.1.x/core/admin_templates/incs/style_template.css (.../style_template.css) (revision 12657) @@ -78,15 +78,15 @@ /* Head frame */ table.head-table { - background: url(@@base_url@@/core/admin_templates/img/top_frame/right_background.jpg) top right @@HeadBgColor@@ no-repeat; + background: url('@@base_url@@/core/admin_templates/img/top_frame/right_background.png') top right @@HeadBgColor@@ no-repeat; } -.head-table tr td { +.head-table tr td, .head-table tr td a { color: @@HeadColor@@ } div#extra_toolbar td.button-active { - background: url(@@base_url@@/core/admin_templates/img/top_frame/toolbar_button_background.gif) bottom left repeat-x; + background: url('@@base_url@@/core/admin_templates/img/top_frame/toolbar_button_background.gif') bottom left repeat-x; height: 22px; } @@ -97,7 +97,7 @@ td.kx-block-header, .head-table tr td.kx-block-header{ color: @@HeadBarColor@@; - background: url(@@base_url@@/core/admin_templates/img/top_frame/toolbar_background.gif) repeat-x top left; + background: url('@@base_url@@/core/admin_templates/img/top_frame/toolbar_background.gif') repeat-x top left; /*background-color: @@HeadBarBgColor@@;*/ padding-left: 7px; padding-right: 7px; @@ -129,7 +129,7 @@ font-size: 12px; font-weight: normal; color: #000000; - background: url(@@base_url@@/core/admin_templates/img/button_back.gif) #f9eeae repeat-x; + background: url('@@base_url@@/core/admin_templates/img/button_back.gif') #f9eeae repeat-x; text-decoration: none; } @@ -138,7 +138,7 @@ font-size: 12px; font-weight: normal; color: #676767; - background: url(@@base_url@@/core/admin_templates/img/button_back_disabled.gif) #f9eeae repeat-x; + background: url('@@base_url@@/core/admin_templates/img/button_back_disabled.gif') #f9eeae repeat-x; text-decoration: none; } @@ -178,11 +178,11 @@ } a.scroll-left { - background: transparent url(@@base_url@@/core/admin_templates/img/tabs/left.png) no-repeat scroll 0 0; + background: transparent url('@@base_url@@/core/admin_templates/img/tabs/left.png') no-repeat scroll 0 0; } a.scroll-right { - background: transparent url(@@base_url@@/core/admin_templates/img/tabs/right.png) no-repeat scroll 0 0; + background: transparent url('@@base_url@@/core/admin_templates/img/tabs/right.png') no-repeat scroll 0 0; } a.disabled { @@ -193,6 +193,19 @@ background-position: 0 -18px; } +td.scroll-right-container { + width: 20px; +} + +td.scroll-right-container.disabled, td.scroll-right-container.disabled * { + width: 0px; + margin: 0px; +} + +td.scroll-right-container.disabled br { + display: none; +} + /* Toolbar */ .toolbar { @@ -424,22 +437,22 @@ } .label-cell { - background: #DEE7F6 url(@@base_url@@/core/admin_templates/img/bgr_input_name_line.gif) no-repeat right bottom; + background: #DEE7F6 url('@@base_url@@/core/admin_templates/img/bgr_input_name_line.gif') no-repeat right bottom; font: 12px arial, sans-serif; padding: 4px 20px; - width: 150px; + width: 160px; } .control-mid { width: 13px; border-left: 1px solid #7A95C2; - background: #fff url(@@base_url@@/core/admin_templates/img/bgr_mid.gif) repeat-x left bottom; + background: #fff url('@@base_url@@/core/admin_templates/img/bgr_mid.gif') repeat-x left bottom; } .control-cell { font: 11px arial, sans-serif; padding: 4px 10px 5px 5px; - background: #fff url(@@base_url@@/core/admin_templates/img/bgr_input_line.gif) no-repeat left bottom; + background: #fff url('@@base_url@@/core/admin_templates/img/bgr_input_line.gif') no-repeat left bottom; width: auto; vertical-align: middle; } @@ -528,14 +541,14 @@ width: 100%; border: 1px solid black; height: 20px; - background: #fff url(@@base_url@@/core/admin_templates/img/progress_left.gif); + background: #fff url('@@base_url@@/core/admin_templates/img/progress_left.gif'); } .uploader-done { width: 0%; background-color: green; height: 20px; - background: #4A92CE url(@@base_url@@/core/admin_templates/img/progress_done.gif); + background: #4A92CE url('@@base_url@@/core/admin_templates/img/progress_done.gif'); } @@ -635,15 +648,15 @@ padding: 2px; } +.tree tr td a:hover { + color: @@TreeHoverColor@@; +} + .tree tr.highlighted td a { - background-color: @@TreeHighBgColor@@; color: @@TreeHighColor@@; + background-color: @@TreeHighBgColor@@; } .tree tr.highlighted td a:hover { - color: #fff; -} - -.tree tr td a:hover { - color: #000000; + color: @@TreeHighHoverColor@@; } \ No newline at end of file Index: branches/5.1.x/core/install/prerequisites.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/install/prerequisites.php (.../prerequisites.php) (revision 12127) +++ branches/5.1.x/core/install/prerequisites.php (.../prerequisites.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_attn.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/users/users_item.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/users/users_item.php (.../users_item.php) (revision 12127) +++ branches/5.1.x/core/units/users/users_item.php (.../users_item.php) (revision 12657) @@ -1,6 +1,6 @@ GetDBField('Status') ) - { - case 1: - if ($this->Application->ConfigValue('User_Password_Auto')) { - $this->Application->EmailEventAdmin('USER.VALIDATE', $this->GetID() ); - $this->Application->EmailEventUser('USER.VALIDATE', $this->GetID() ); - } - else { - $this->Application->EmailEventAdmin('USER.ADD', $this->GetID() ); - $this->Application->EmailEventUser('USER.ADD', $this->GetID() ); - } + switch ($this->GetDBField('Status')) { + case STATUS_ACTIVE: + $event_name = $this->Application->ConfigValue('User_Password_Auto') ? 'USER.VALIDATE' : 'USER.ADD'; + $this->Application->EmailEventAdmin($event_name); + $this->Application->EmailEventUser($event_name, $this->GetID()); break; - case 2: - $this->Application->EmailEventAdmin('USER.ADD.PENDING', $this->GetID() ); - $this->Application->EmailEventUser('USER.ADD.PENDING', $this->GetID() ); + case STATUS_PENDING: + $this->Application->EmailEventAdmin('USER.ADD.PENDING'); + $this->Application->EmailEventUser('USER.ADD.PENDING', $this->GetID()); break; } } @@ -136,6 +133,4 @@ $this->SetDBField('LastName', $last_name); } - - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon46_settings_search.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_site.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_conf_themes.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_users.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_visits.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/languages/languages_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/languages/languages_config.php (.../languages_config.php) (revision 12127) +++ branches/5.1.x/core/units/languages/languages_config.php (.../languages_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'lang', 'ItemClass' => Array('class'=>'LanguagesItem','file'=>'languages_item.php','build_event'=>'OnItemBuild'), 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), @@ -84,7 +86,10 @@ 'new_titlefield' => Array('lang'=>''), ), - 'languages_list' => Array( 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks!"), + 'languages_list' => Array( + 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks!", + 'toolbar_buttons' => Array ('new_item', 'edit', 'delete', 'export', 'import', 'setprimary', 'refresh', 'view', 'dbl-click'), + ), 'languages_edit_general' => Array( 'prefixes' => Array('lang'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_General!"), @@ -203,7 +208,7 @@ 'not_null' => 1, 'required' => 1, 'default' => '' ), - 'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), + 'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Disabled', 1 => 'la_Active'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), 'PrimaryLang' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), 'AdminInterfaceLang' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), @@ -232,19 +237,34 @@ 'Grids' => Array( 'Default' => Array ( - 'Icons' => Array ('default' => 'icon16_custom.gif', '0_0' => 'icon16_language_disabled.gif', '1_0' => 'icon16_language.gif', '0_1' => 'icon16_language_disabled.gif', '1_1' => 'icon16_language_primary.gif'), + 'Icons' => Array ( + 'default' => 'icon16_item.png', + '0_0' => 'icon16_disabled.png', + '0_1' => 'icon16_disabled.png', + '1_0' => 'icon16_item.png', + '1_1' => 'icon16_primary.png', + ), 'Fields' => Array( - 'LanguageId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'), - 'PackName' => Array ('title' => 'la_col_PackName', 'filter_block' => 'grid_options_filter'), - 'LocalName' => Array ('title' => 'la_col_LocalName', 'filter_block' => 'grid_options_filter'), - 'Enabled' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'), - 'PrimaryLang' => Array ('title' => 'la_col_IsPrimary', 'filter_block' => 'grid_options_filter'), - 'AdminInterfaceLang' => Array ('title' => 'la_col_AdminInterfaceLang', 'filter_block' => 'grid_options_filter'), + 'LanguageId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ), + 'PackName' => Array ('title' => 'la_col_PackName', 'filter_block' => 'grid_options_filter', 'width' => 150, ),// + 'PrimaryLang' => Array ('title' => 'la_col_IsPrimaryLanguage', 'filter_block' => 'grid_options_filter', 'width' => 150, ), + 'AdminInterfaceLang' => Array ('title' => 'la_col_AdminInterfaceLang', 'filter_block' => 'grid_options_filter', 'width' => 150, ), + 'Charset' => Array ('title' => 'la_col_Charset', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'Priority' => Array ('title' => 'la_col_Priority', 'filter_block' => 'grid_like_filter', 'width' => 60, ), + 'Enabled' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 60, ), + + ), ), /*'LangManagement' => Array ( - 'Icons' => Array ('default' => 'icon16_custom.gif', '0_0' => 'icon16_language_disabled.gif', '1_0' => 'icon16_language.gif', '0_1' => 'icon16_language_disabled.gif', '1_1' => 'icon16_language_primary.gif'), + 'Icons' => Array ( + 'default' => 'icon16_item.png', + '0_0' => 'icon16_disabled.png', + '0_1' => 'icon16_disabled.png', + '1_0' => 'icon16_item.png', + '1_1' => 'icon16_primary.png', + ), 'Fields' => Array ( 'LanguageId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60), 'PackName' => Array ('title' => 'la_col_Language', 'filter_block' => 'grid_options_filter', 'width' => 120), @@ -253,6 +273,4 @@ ), ),*/ ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_clear_all.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_ship_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/reviews/reviews_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 12127) +++ branches/5.1.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'rev', @@ -184,29 +186,37 @@ 'Grids' => Array ( 'Default' => Array ( - 'Icons' => Array ('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'), + 'Icons' => Array ( + 'default' => 'icon16_item.png', + 0 => 'icon16_disabled.png', + 1 => 'icon16_item.png', + 2 => 'icon16_pending.png', + ), 'Fields' => Array ( - 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'), - 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'filter_block' => 'grid_like_filter'), - 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter'), - 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'), - 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'), - 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter'), + 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), + 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'filter_block' => 'grid_like_filter', 'width' => 210, 'first_chars' => 200, ), + 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), + 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter', 'width' => 80, ), ), ), 'ReviewsSection' => Array ( - 'Icons' => Array ('default'=>'icon16_custom.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif',0=>'icon16_review_disabled.gif'), + 'Icons' => Array ( + 'default' => 'icon16_item.png', + 0 => 'icon16_disabled.png', + 1 => 'icon16_item.png', + 2 => 'icon16_pending.png', + ), 'Fields' => Array ( - 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'), - 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_reviewtext_td', 'filter_block' => 'grid_like_filter'), - 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter'), - 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter'), - 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'), - 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter'), + 'ReviewId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), + 'ReviewText' => Array( 'title'=>'la_col_ReviewText', 'data_block' => 'grid_reviewtext_td', 'filter_block' => 'grid_like_filter', 'width' => 210, 'first_chars' => 200, ), + 'ReviewedBy' => Array( 'title'=>'la_col_ReviewedBy', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), + 'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + 'Rating' => Array( 'title'=>'la_col_Rating', 'filter_block' => 'grid_options_filter', 'width' => 80, ), ), ), ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_disabled.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/install/incs/script.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/install/incs/script.js (.../script.js) (revision 12127) +++ branches/5.1.x/core/install/incs/script.js (.../script.js) (revision 12657) @@ -1,8 +1,7 @@ - -function swap_image($img_id, $src) { - document.getElementById($img_id).src = 'incs/img/' + $src; -} - function continue_install() { document.getElementById('install_form').submit(); +} + +function RemoveTranslationLink($label) { + return $label; } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_add_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/install/step_templates/install_setup.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/install/step_templates/install_setup.tpl (.../install_setup.tpl) (revision 12127) +++ branches/5.1.x/core/install/step_templates/install_setup.tpl (.../install_setup.tpl) (revision 12657) @@ -1,19 +1,19 @@ - In order to use the installation tool, please provide your Intechnic account information: + In order to use this installation tool, please identify yourself using the root password! - Username*: + Username *: - Password*: + Password *: @@ -33,11 +33,11 @@ $options = Array ( 'upgrade' => 'Upgrade In-Portal', - 'clean_reinstall' => 'Clean out the In-Portal database and reinstall', - 2 => 'Install to a new database', + 'clean_reinstall' => 'Reinstall In-Portal', + 2 => 'Install In-Portal to a New Database', 'update_license' => 'Update License Information', - 'db_reconfig' => 'Change Database Configuration', - 'fix_paths' => 'Fix Paths', + 'db_reconfig' => 'Update Database Configuration', + 'fix_paths' => 'Update Installation Paths', ); $upgradable_modules = $this->GetUpgradableModules(); Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_modify_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/login.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/login.tpl (.../login.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/login.tpl (.../login.tpl) (revision 12657) @@ -1,7 +1,8 @@ + - + ") -/* The main calendar widget. DIV containing a table. */ - Index: branches/5.1.x/themes/default2009/platform/img/languages_separator.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/ic_addtofav.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/inc/jquery/jquery.pack.js =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/inc/jquery/jquery.pack.js (revision 12127) +++ branches/5.1.x/themes/default2009/platform/inc/jquery/jquery.pack.js (revision 0) @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/top_baner_2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/menu-li-1-level.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/inc/jquery/thickbox/loadingAnimation.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/my_account/my_favorites.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/my_account/my_favorites.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/my_account/my_favorites.tpl (revision 0) @@ -1,46 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - - -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/ic_mytopics46.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/mailing_list/subscribe.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/mailing_list/subscribe.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/mailing_list/subscribe.tpl (revision 0) @@ -1,53 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - -
-
-
-
- - - - - -

- -
- " />  - " onclick="redirect('');" />  - - - -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/not_logged.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/prevlabel.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/categories/suggest_confirm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/categories/suggest_confirm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/categories/suggest_confirm.tpl (revision 0) @@ -1,52 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - -

- "> -
- -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/search/search_results.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/search/search_results.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/search/search_results.tpl (revision 0) @@ -1,48 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/mailing_list/unsubscribe.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/mailing_list/unsubscribe.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/mailing_list/unsubscribe.tpl (revision 0) @@ -1,53 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - -

- -
- " />  - " onclick="redirect('');" />  - - -
-
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/link_icon.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/file_icons/txt.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/next.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/categories/suggest_category.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/categories/suggest_category.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/categories/suggest_category.tpl (revision 0) @@ -1,75 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - - - *

- - - - - - img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />

- -
- - - - - - - - "/> - -
-
- - -
-
- -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/file_icons/ppt.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/icon_pick.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/my_account/my_account.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/my_account/my_account.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/my_account/my_account.tpl (revision 0) @@ -1,78 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- -
-
-
- - - - - - " alt="" />
- - - " class="text-title"> -
- - - -
- - -
-
- -
-
- - - - - - - - - - - - -
-
- - - - - - - - - - -
-
- -
-
-
- -nothing_foundnothing_foundnothing_foundnothing_foundnothing_foundnothing_found \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/no_picture.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/ic_myfriends46.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/delete_button_background.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/file_icons/xls.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/top_menu_select.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/side_boxes_content.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/inc/nlsmenuext_xml.js =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/inc/nlsmenuext_xml.js (revision 12127) +++ branches/5.1.x/themes/default2009/platform/inc/nlsmenuext_xml.js (revision 0) @@ -1,231 +0,0 @@ -/** -* nlsmenuext_xml.js v.1.0 -* Copyright 2005-2007, addobject.com. All Rights Reserved -* Author Jack Hermanto, www.addobject.com -*/ -var $nls_ieXML=["MSXML2.DOMDocument.4.0", "MSXML2.DOMDocument.3.0", "MSXML2.DOMDocument", "Microsoft.XmlDom"]; - -function NlsMenuUtil() {} -var NLSMNUTIL=NlsMenuUtil.prototype; - -function $aonvl(v, c) { if(v)return v; else return c; }; -function $aonevl(v, c) { if(!v || v=="")return c; else return v; }; - -NlsMenuUtil.createFromXML=function(xml) { - var rt=xml.documentElement; - var mgr=new NlsMenuManager(rt.getAttribute("id")); - mgr.flowOverFormElement=$aonevl(rt.getAttribute("flowoverformelement"), false); - mgr.defaultEffect=$aonevl(rt.getAttribute("defaulteffect"), null); - mgr.icPath=$aonvl(rt.getAttribute("icpath"), ""); - mgr.memorizeSel=$aonevl(rt.getAttribute("memorizesel"), false); - - var dm=rt.getElementsByTagName("menubar")[0]; - NlsMenuUtil.createMenu(dm, mgr); - - var mns=rt.getElementsByTagName("menus")[0]; - if(mns){ - for (var i=0;iNo Permissions - -
Platform
-##--> - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - -

- -

-
- -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/backgr.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/footer_blue.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/privacy.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/privacy.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/privacy.tpl (revision 0) @@ -1,107 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - - - - - - - - - - - - -
- [Company Name] is committed to protecting your privacy and it is always our first priority. The following describes our policy regarding your personal, account and billing information. Personal information includes, but is not limited to: your name, company name, Website address, login, address, telephone number, e-mail address, billing information, or any additional pertaining information that personally identifies you, your preferences and/or your purchasing history, and that is not otherwise publicly available. "You" means the visitor of our websites and/or our customer. "We", "us" means [Company Name].

- - [Company Name] can modify this Privacy Policy at any time without prior notice to you by posting revised Terms on our sites. -

-
- 1. Information Shared
- - [Company Name] is the sole owner of the information collected on our network of Websites (list your websites). If you believe that any content on our network have been copied in a way that constitutes copyright infringement, or property rights have been violated, please contact [Email] so we can remove that content.

- - - [Company Name] collects personal identifiable information from our users at several different points on our Websites. The amount and type of information that we collect from you depends on your activities, the services that we provide and your use of our Websites. Below is an explanation of the type of information that we collect. -

-
- 1.1 When you browse our Websites
- -
    -
  • IP address - We collect your IP address to keep track of our Websites traffic and for security purposes when purchasing our products and services. -
  • Browser Type - We collect information about the browser you are using to help optimize our Websites for visitors. -
  • Movement through our Websites - We keep track of pages you visit to help provide you with a more personalized experience.
    -
  • Referral Websites - If you come to our Websites via a link, we collect the location of the link that referred you. -
- - - 2. Uses of Information

-
- 2.1 Purpose of Use
- - We may use your personal and account information to provide products or services that you have requested, to respond to an inquiry you have made (sales or otherwise) and as otherwise described in this policy.

-
- 2.2 Access to Personal and Account Information -
    -
  • We do not sell or share your personal information with vendors, marketers or any third parties outside of [Company Name]. -
  • We restrict access to your personal and account information to only the selected employees of [Company Name]. -
  • These employees need access to relevant information in order to provide you with services that include: customer support, accounting, technical support, etc. -
-

-
- 2.3 Special Offers and Updates
-
    -
  • We may occasionally send you promotional notices. This includes product and service information and special deals. You can sign up to receive these emails from us on our registration page. -
  • Out of respect for your privacy, we present the option not to receive these types of communications. Please see the "Choice and Opt-out." -
  • If you become our customer, we may send you updates on important information about our company, products and services. -
-

-
-
-
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/ic_myprofile46.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/mailing_list/subscribe_ok.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/mailing_list/subscribe_ok.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/mailing_list/subscribe_ok.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - -

- - " onClick="window.location.href=''" />  -
-
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/ic_details.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/file_icons/xml.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/forums_new_post.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/menu_background.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/ic_rateit.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/pagenation_left.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/inc/styles.css =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/inc/styles.css (revision 12127) +++ branches/5.1.x/themes/default2009/platform/inc/styles.css (revision 0) @@ -1,642 +0,0 @@ -/* --- Golbal Usage Styles --- */ -html, body { - margin: 0px; - padding: 0px; - height: 100%; - border: none; - font: 9pt Arial; - color: #000000; -} - -.fullwidth { - width: 100%; -} - -table { - margin: 0px; - padding: 0px; - border-collapse: collapse; -} - -td { - font: 11px Arial, serif; - color: #000000; - margin: 0px; - padding: 0px; -} - - -.hidden-element { - display: none; -} - -.horizontal-separator { - background: url(../img/horizontal_dashed_line.gif) bottom repeat-x; -} - -.vertical-separator { - background: url(../img/vertical_dashed_line.gif) top center repeat-y; -} - -img, img A { - border: 0px; -} - -form { - display: inline; -} - -.top-background { - background: url(../img/top_background.gif) right repeat-y; -} - -.top-baner-cell - { - padding: 10px; - text-align:center; - } - -.menu-background { - background: url(../img/menu_background.gif) top repeat-x #1865AC; - width: 100%; -} - -.top-select-padding { - padding: 0px 15px; -} - -.footer-table td { - background: url(../img/footer_blue.gif) top repeat-x; - height: 26px; - color: #F7EEE4; - font-size: 10px; - padding: 0px 10px; -} - -.footer-table a { - color: #F7EEE4; -} - -/* --- Link Styles --- */ -a { - color: #197ACA; -} - -a:hover { - color: #FF9900; -} - -a.more-link { - font-size: 10px; -} - -a.item-action { - font-size: 9px; - color: #666666; -} - -a.item-action:hover { - color: #000000; -} - -.footer-links { - text-align: right; - padding: 5px 10px; -} - -.footer-links A { - color: #333333; - font-size: 10px; -} - -.footer-links A:hover { - color: #666666; -} - -/* --- Side Box Styles --- */ -.side-box-header { - background: url(../img/side_boxes_background.gif) bottom repeat-x #83AFD6; - height: 29px; - padding: 0px 8px 0px 20px; -} - -.side-box-title { - font-size: 12px; - color: #FFFFFF; -} - -.side-box-title A { - font-size: 12px; - color: #FFFFFF; - text-decoration: underline; -} - -.side-box-title A:hover { - font-size: 12px; - color: #FFDC0E; -} - -.side-box-content { - background: url(../img/side_boxes_content.gif) top repeat-x; - padding: 20px 20px; -} - -/* --- Content Box Styles --- */ -.content-box-header { - background: #F0F5FA; - height: 29px; - padding: 0px 20px; -} - -.content-box-title { - font-size: 15px; - font-family: Arial; - color: #000000; - font-weight: bold; -} - -.content-box-content { - background: #FFFFFF; - padding: 20px 20px 0px 20px; -} - -/* --- Form Control Styles --- */ -.input-text, .input-textarea { - background: url(../img/input_text_background.gif) top repeat-x #FFFFFF; - border: 1px solid #7091B9; - font-family: Arial, Helvetica, sans-serif; - font-size: 11px; -} - -.input-textarea { - overflow: auto; -} - -.input-select { - color: #333333; - font-size: 11px; -} - -.button { - background: url(../img/input_button_background.gif) bottom repeat-x #efefef; - border: 1px solid #688BAC; - padding: 0px; - font-size: 11px; - padding: 0px 5px; -} - -.delete-button { - background: url(../img/delete_button_background.gif) bottom repeat-x #FF6D6D; - color: #FFFFFF; - border: 1px solid #CC0000; - padding: 0px; - font-size: 11px; - padding: 0px 5px; -} - -/* --- Form Field Styles --- */ -.field-name { - padding: 5px 15px; - - color: #2E5679; - font-weight: bold; - font-size: 11px; -} - -.field-required { - color: #FF0000; -} - -.field-hint { - color: #000000; - font-size: 10px; -} - -.field-error { - color: #CC0000; - font-size: 10px; -} - -.field-value { - padding: 6px 5px; -} - -.warning-message td { - padding: 5px; - background: #FFE5E6; - font-size: 16px; -} - -.item-categories td { - padding: 1px; -} -/* --- Login Sidebox Styles --- */ -.login-status, .login-status a { - font-size: 10px; - color: #FFFFFF; -} - -.login-status a:hover { - font-size: 10px; -} - -.remember-login { - color: #000000; - font-size: 9px; -} - -/* --- Navigation Bar Styles --- */ -.navigation-bar { - background: url(../img/side_boxes_background.gif) bottom repeat-x #83AFD6; - height: 29px; - padding: 0px 20px; - font-size: 12px; - color: #FFFFFF; -} - -.navigation-bar A { - color: #FFFFFF; -} - -.navigation-bar A:hover { - color: #FFDC0E; -} - -/* --- Top Right Menu Styles --- */ -.menu-top-active-icon, .menu-top-active-text { - background: url(../img/top_menu_select.gif); -} - -td.top-menu-padding { - height: 37px; - white-space: nowrap; -} - -.menu-top-noactive-icon, .menu-top-active-icon { - padding: 0px 5px 0px 13px; -} - -.menu-top-noactive-text, .menu-top-active-text { - padding: 0px 13px 0px 3px; -} - -a.top-menu-link, a.top-menu-link:hover { - font-size: 11px; - text-decoration: none; -} - -a.top-menu-link { - color: #FFFFFF; -} - -a.top-menu-link:hover { - color: #CCCCCC; -} - -/* --- Tab Styles --- */ -.inactive-tab, .active-tab { - padding:5px 10px; - border: 1px solid #94c0de; -} - -.inactive-tab { - background-color: #eff4fa; -} - -.active-tab { - background-color: #FFFFFF; - border-bottom-color: #FFFFFF; -} - -.tab-bottom-line { - background: url(../img/pixel_blue.gif) bottom repeat-x; -} - -.tab-bottom-content { -border-right:1px solid #94c0de; -border-left:1px solid #94c0de; -border-bottom:1px solid #94c0de; -padding:10px; -} - -.tab-left-padding { - padding-left: 40px; -} - -/* --- Category Listing & My Account Styles --- */ -.directory-icon { - width: 22px; - vertical-align: top; - padding: 5px; -} - -.directory-text { - padding: 5px 20px 5px 5px; - vertical-align: top; -} - -/* --- Item Listing Page & Item Details Page Styles --- */ -.item-listing { - background: url(../img/gradient_background.gif) top repeat-x #FFFFFF; -} - -.item-listing-featured { - background: url(../img/gradient_background_gr.gif) top repeat-x #FFFFFF; -} - -.item-listing-lead { - background: url(../img/gradient_background_red.gif) top repeat-x #FFFFFF; -} - -.item-padding { -padding: 10px 10px 10px 10px; -} - - - -.item-statistics { - font-size: 10px; - color: #666666; -} - -.listing-field-name { - font-weight: bold; -} - -.category-statistics { - font-size: 10px; -} - -.category-header td { - padding: 5px 20px 5px 5px; - vertical-align: top; -} - -.sub-section-header, .sub-section-header td { - background-color: #F4F4F4; - font-weight: bold; - padding: 5px 15px; - font-size: 12px; -} - -.listing-row td { - padding: 5px 8px; -} - -/* --- Pagination Bar Styles --- */ -.current-page { - background: #5B97CB; - color: #FFFFFF; - padding: 1px 2px; -} - -a.page-link { - color: #000000; - text-decoration: none; -} - -/* --- Calendar Styles --- */ -.calendar { - font-family: tahoma,verdana,sans-serif; - color: #000; - font-size: 11px; - border: 1px solid #83B2C5; - width: 225px; - position: relative; - z-index: 1; - display: none; - cursor: default; - -} - -.calendar table { - /*font-family: tahoma,verdana,sans-serif;*/ - color: #000; - font-size: 11px; - background-color: #fefefe; - width: auto; - cursor: default; - border-collapse: separate; - -} - -.calendar table td { - padding: 2px; - text-align: center; -} - -.calendar tbody .disabled { - color: #999; -} - -.calendar tbody .emptyrow { - display: none; - -} - -.calendar tbody .today { - font-weight: bold; - background-color: #eeeeee; - border: 1px solid #aaaaaa !important; -} - -.calendar tbody .emptycell { - visibility: hidden; -} - -.calendar tbody .active { - background-color: red; -} - -.calendar thead .title { - font-weight: bold; -} - -.calendar thead .headrow { - -} - -.calendar thead .active { - background-color: #c4c0b8; - padding: 2px 0px 0px 2px; - -} - -.calendar thead .hilite { - background-color: #e4e0d8; -} - -.calendar tfoot .title { - font-weight: normal; -} - -.combo { position: absolute; display: none; width: 4em; top: 0px; left: 0px; cursor: default; border-top: 1px solid #fff; border-right: 1px solid #000; border-bottom: 1px solid #000; border-left: 1px solid #fff; background: #e4e0d8; font-size: smaller; padding: 1px;} -.combo .label { text-align: center; padding: 1px;} -.combo .active { background: #c4c0b8; padding: 0px; border-top: 1px solid #000; border-right: 1px solid #fff; border-bottom: 1px solid #fff; border-left: 1px solid #000;} -.combo .hilite { background: #048; color: #fea;} - -.dpContainer { - display: inline; -} - -.list-no-squares { - padding: 0px; - list-style-type: none; - margin: 0px; -} - -/* --- Listing Element Styles --- */ -.picture-padding { - padding: 20px 5px 20px 20px; - vertical-align: top; - width: 120px; -} - -.text-padding { - padding: 20px 5px; -} - -.file-list-icon - { - padding: 2px 10px 2px 0px; - vertical-align:top; - } - -.file-list-label - { - padding: 2px 7px 2px 0px; - vertical-align:top; - } - -/* --- Item Raring Styles --- */ -.ratingblock, .ratingblock div { - display: -moz-inline-block; -} - -.voted { - color: #999; -} - -.thanks { - color: #36AA3D; -} - -.static { - color: #5D3126; -} - -.inline-rating { - display:-moz-inline-block; - display:-moz-inline-box; - display:inline-block; - vertical-align: middle; -} - -.star-rating, -.star-rating a:hover, -.star-rating a:active, -.star-rating a:focus, -.star-rating .current-rating{ - background: url('../img/starrating.gif') left -1000px repeat-x; -} -.star-rating { - position:relative; - width:125px; - height:25px; - overflow:hidden; - list-style:none; - margin:0; - padding:0; - background-position: left top; -} - -.star-rating li { - display: inline; -} - -.star-rating a, -.star-rating .current-rating { - position:absolute; - top:0; - left:0; - text-indent:-1000em; - height:25px; - line-height:25px; - outline:none; - overflow:hidden; - border: none; -} - -.star-rating a:hover, -.star-rating a:active, -.star-rating a:focus { - background-position: left bottom; -} -.star-rating a.r1-unit { width:20%;z-index:6; } -.star-rating a.r2-unit { width:40%;z-index:5; } -.star-rating a.r3-unit { width:60%;z-index:4; } -.star-rating a.r4-unit { width:80%; z-index:3; } -.star-rating a.r5-unit { width:100%; z-index:2; } -.star-rating .current-rating { z-index:1; background-position: left center; } - -.small-star { - width:50px; - height:10px; -} -.small-star, .small-star a:hover, .small-star a:active, -.small-star a:focus, .small-star .current-rating { - background-image: url(star_small.gif); - line-height: 10px; - height: 10px; -} - -/* --- Unprocessed Styles --- */ -.text-title { - font-size: 12px; - font-weight: bold; - color: #1769b5; -} - -a.text-title { - font-size: 12px; - font-weight: bold; - color: #1769b5; -} - -a.text-title:hover { - color: #005695; -} - -/* ----- Depricated Styles ----- */ -.error { - color: magenta; -} - -.static { - color: #00CC66; -} - -.image_boder { - border: 1px solid #CDCECD; -} - -.table-border { - border: 1px solid #EAEAEA; -} - -.information-background { - background-color: #F6F6FF; -} - -#sitemap ul { - margin:0 0 10px 10px; - padding:0 0 0 10px; -} - -#sitemap ul li { - color: #0060BB; - list-style-image: none; - list-style-position: outside; - list-style-type: disc; - padding: 5px 0 0; -} \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/ic_mypreferences46.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/file_icons/zip.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/side_link_str.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/ic_mylinks46.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/delete.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/nextlabel.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/more_images.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/side_boxes_background.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/logo_watermark.png =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/prev.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/vertical_dashed_line.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/map_icon.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/input_button_background.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/closelabel.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/globe.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/close.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/ic_myfavorites46.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/s.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/topics_icon.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/categories/suggest_pending_confirm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/categories/suggest_pending_confirm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/categories/suggest_pending_confirm.tpl (revision 0) @@ -1,52 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - -

- "> -
- -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/file_icons/icon_file.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/lbox/loading.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/gradient_background_gr.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/inc/nlsmenu.js =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/inc/nlsmenu.js (revision 12127) +++ branches/5.1.x/themes/default2009/platform/inc/nlsmenu.js (revision 0) @@ -1,860 +0,0 @@ -/** -* nlsmenu.js v.2.0 -* Copyright 2005-2007, addobject.com. All Rights Reserved -* Author Jack Hermanto, www.addobject.com -*/ -var nlsMenu = new Object(); -var nlsMenuMgr = new Object(); -var nlsWinElmt = []; - -var ag0=window.navigator.userAgent; -var nls_isIE = (ag0.indexOf("MSIE") >=0); -var nls_isIE5 = (ag0.indexOf("MSIE 5.0") >=0); -var nls_isSafari = (ag0.indexOf("Safari") >=0); -var nls_isOpera = (ag0.indexOf("Opera") >=0); -if (nls_isOpera) {nls_isIE=false; nls_isIE5=false;}; - -function NlsMenuManager(mgr) { - this.mgrId = mgr; - this.menus = new Object(); - this.menubar = null; - this.timeout = 1000; - this.flowOverFormElement = false; - this.assocMenuMgr = []; - this.defaultEffect=null; - this.icPath=""; - this.memorizeSel=false; - this.rt=new Object(); - - this.tmId = null; - this.setTimeout=function(a, t) { this.tmId = window.setTimeout(a, t); }; - this.clearTimeout=function() { if (this.tmId!=null) { window.clearTimeout(this.tmId); this.tmId=null;}}; - - nlsMenuMgr[mgr] = this; - if(nls_isIE)window.attachEvent("onload", function(){nlsMenuMgr[mgr].init();}); - - return this; -}; - -var NlsMnMgr = NlsMenuManager.prototype; -NlsMnMgr.createMenu = function(mId) { - var m=new NlsMenu(mId) - m.mgr=this; m.mgrId=this.mgrId; m.icPath=this.icPath; - m.useEffect(this.defaultEffect); - if (this.design) { m.$menuItemClick = NlsMenu.$dsItemClick; } - this.menus[mId]=m; - return m; -}; - -NlsMnMgr.createMenubar = function (mbarId) { - if (this.menubar) alert("Menubar already exists!"); - var m=new NlsMenubar(mbarId); - m.mgr=this; m.mgrId=this.mgrId; m.icPath=this.icPath; - if (this.design) { m.$menuItemClick = NlsMenu.$dsItemClick; } - this.menubar=m; - return m; -}; - -NlsMnMgr.renderMenus = function (plc) { - if (plc && plc!="") { - var d=NlsMenu.$GE(plc); var s=""; - for (it in this.menus) { s+=this.menus[it].renderMenu(); } - d.innerHTML=s; - } else { - for (it in this.menus) { document.write(this.menus[it].renderMenu()); } - } -}; - -NlsMnMgr.renderMenubar = function (plc) { - if (this.menubar) { - if (plc && plc!="") { - NlsMenu.$GE(plc).innerHTML=this.menubar.renderMenubar(); - } else { - document.write(this.menubar.renderMenubar()); - } - } - if(this.memorizeSel) this.loadPath(); -}; - -NlsMnMgr.hideMenus = function () { - for (var it in this.menus) {if (this.menus[it].rt.active) this.menus[it].hideMenu();} - if (this.menubar) this.menubar.hideMenu(); -}; - -NlsMnMgr.addAssocMenuMgr = function(frm, mgrId) { - this.assocMenuMgr[this.assocMenuMgr.length] = [frm, mgrId]; -}; - -NlsMnMgr.getMenu= function(mId) { return this.menus[mId]; }; - -NlsMnMgr.init=function() { - if(this.menubar)this.menubar.init(); -} - -function listAllWinElmt() { - nlsWinElmt = []; - var arrWinEl = document.getElementsByTagName("SELECT"); - var elm; var tmp; var x; var y; - for(var i=0; i" + - "" + - ""); - }; - - this.toString=function() {return "NlsMenuSeparator";}; -}; - -function NlsCustomMenuItem(cst) { - this.intKey = ""; - this.cstMenu = (cst?cst:" "); - this.toString=function() {return "NlsCustomMenuItem";}; -}; - -function NlsMenu(mId) { - /*private*/ - this.lsItm=null; - this.mgrId = ""; - this.mgr=null; - this.winElmt=null; - this.container=null; - this.customBorder=null; - this.shadow=new NlsMenuShadow("none", "5px", mId); - this.count=0; - this.isMenubar=false; - this.effect=null; - this.srItems=[]; - - this.rt={ready:true,active:false}; - - /*public*/ - this.mId = mId; - this.items = new Object(); - this.stlprf=""; - this.subMenuIc=null; - this.target="_self"; - this.icPath=""; - this.itemSpc=""; - this.stretchItem=true; - - this.selection=false; - - this.showIcon=false; - this.showSubIcon=true; - - this.absWidth=""; - this.orient="V"; - - this.defItmEff=null; - this.defPos=[0,0]; - - this.maxItemCol=100; - this.zIndex = 100; - - this.wnd = window; - nlsMenu[mId] = this; - return this; -}; - -var NLSMENU=NlsMenu.prototype; - -NLSMENU.addItem = function(key, capt, url, ico, enb, xtra, subId, title) { - var intKey = this.mId+"_"+key; - var it = new NlsMenuItem(key, capt, url, ico, enb, xtra, subId, title); - it.intKey = intKey; - it.mId=this.mId; - this.items[intKey]=it; - this.srItems[this.srItems.length]=it; - if (this.defItmEff!=null && typeof(NlsMenuItemEffect) != "undefined") { it.useItemEffect(this.defItmEff); } - this.count++; - return it; -}; - -NLSMENU.addSeparator = function(separator) { - var intKey = "sep_"+this.count; - var it = (separator ? separator : new NlsMenuSeparator()); - it.stlprf = this.stlprf; - it.intKey = intKey; - this.items[intKey] = it; - this.srItems[this.srItems.length]=it; - this.count++; - return it; -}; - -NLSMENU.addSubmenu = function(key, subId, crsFrame, subFrame, subPos, subPosAdj, subDir) { - var intKey = this.mId+"_"+key; - var it = this.items[intKey]; - it.subMenuId=subId; - it.subFrame=(subFrame?subFrame:null); - it.crsFrame=(crsFrame?crsFrame:false); - it.subPos = (subPos?subPos:[null,null]); - it.subPosAdj = (subPosAdj?subPosAdj:[0,0]); - it.subDir = (subDir?subDir:["right","down"]); - return it; -}; - -NLSMENU.addCustomMenu = function (custom) { - var intKey = "cst_"+this.count; - var it = new NlsCustomMenuItem(custom); - it.intKey = intKey; - this.items[intKey] = it; - this.srItems[this.srItems.length]=it; - this.count++; - return it; -}; - -NLSMENU.getItemById = function (key) { - return this.items[this.mId+"_"+key]; -}; - -NLSMENU.setItemStyle = function (key, stlprf) { - var intKey = this.mId+"_"+key; - var mnItem = this.items[intKey]; - mnItem.stlprf=stlprf; -}; - -NLSMENU.setItemText = function (key, tx) { - var intKey = this.mId+"_"+key; - var mnItem = this.items[intKey]; - mnItem.capt=tx; - var oD=NlsMenu.$GE(intKey+"x2"); - if (oD) oD.innerHTML=tx; -} - -NLSMENU.enableItem = function (key, b) { - var it = this.items[this.mId+"_"+key] ; - it.enable=b; - setMnStyle(NlsMenu.$GE(it.intKey), (b?(it.selected?"S":"N"):"D"), NlsMenu.getPrf(it, this)); - setMnIcon(this, it, "N"); -}; - -NLSMENU.dropShadow = function (pos, offset) { - if (this.shadow) { this.shadow.pos=pos; this.shadow.offset=(offset?offset:"5px"); } else - { this.shadow=new NlsMenuShadow(pos, offset, this.mId); } -}; - -NLSMENU.applyBorder = function (bTop, bBottom, bLeft, bRight) { - if (!bTop && !bBottom && !bLeft && !bRight) { - this.customBorder=null; - } else { - this.customBorder=new NlsMenuBorder(bTop, bBottom, bLeft, bRight); - } -}; - -NLSMENU.useEffect = function (efN) { - if(efN!=null && efN!="") { - this.effect=new NlsMenuEffect(this.mId, efN); - } -}; - -NLSMENU.renderMenu = function() { - var scPath="", sbIc=null; - var allScs = (document.getElementsByTagName ? document.getElementsByTagName("SCRIPT"): document.scripts); - for (var i=0;i=0) { scPath=allScs[i].src.replace(/nlsmenu.js/gi, ""); } - } - if (!this.subMenuIc) { sbIc=[scPath+"img/submenu.gif", scPath+"img/submenuovr.gif"];} - else {sbIc=[this.icPath+this.subMenuIc[0]]; if(this.subMenuIc[1])sbIc[1]=this.icPath+this.subMenuIc[1];} - - var cs=""; - var tmpCnt=0, prf=this.stlprf, it=null, rt=null, menu=null; - for (var i=0; i":""); - smenu+=(""); - smenu+=(this.orient=="V"?"":""); - } else - if (it.toString()=="NlsCustomMenuItem") { - smenu+=(this.orient=="V"?"":""); - smenu+=(""); - smenu+=(this.orient=="V"?"":""); - } else { - prf=NlsMenu.getPrf(it, this); - if (this.orient=="V") { smenu+=""; } - if (this.orient=="H") { if (tmpCnt==0) smenu+=""; tmpCnt++; } - smenu+=""; - - if (this.showIcon) { - smenu+=""; - } - - smenu+=""; - if (this.showSubIcon && it.subMenuId!="") { smenu+=""; } - smenu+="
"+it.render()+"
"+it.cstMenu+"
"; - smenu+=cs+(this.stretchItem?"width='100%'":"")+" height='100%'>
"; - if(it.ico) { - if(it.ico[0]) smenu+=""; - if(it.ico[1]) smenu+=""; - if(it.ico[2]) smenu+=""; - } - smenu+=""+it.capt+""+ (it.subMenuId!=""? "" + (sbIc.length>1?"":"") :"") +"
"; - smenu+=""; - if (this.orient=="V") { smenu+=""; } - if (this.orient=="H" && tmpCnt==this.maxItemCol) { smenu+=""; tmpCnt=0; } - } - } - - if(this.orient=="H" && tmpCnt!=0 ) { - if(this.srItems.length>this.maxItemCol) - while(++tmpCnt<=this.maxItemCol) smenu+=" "; - smenu+=""; - } - smenu += ""; - smenu = cs+"class='"+this.stlprf+"nlsmenu' "+ sAbs + ">"+smenu+""; - - if (this.customBorder!=null) smenu = this.customBorder.applyBorder(smenu, this.stlprf); - smenu = this.shadow.dropShadow(smenu); - - smenu = "
" + smenu; - if (!this.isMenubar && nls_isIE && !nls_isIE5 && this.mgr.flowOverFormElement) { - smenu += ""; - } - smenu+="
"; - - if (arguments[0]=="content") return smenu; - - smenu = "
" + smenu + "
"; - - return smenu; -}; - -NLSMENU.init=function() { - var v=this.rt.vshade; if(!v) v=NlsMenu.$GE("vshade_"+this.mId); - var itm=this.rt.actmn; if(!itm) itm=NlsMenu.$GE("actmn_"+this.mId); - if(v){ - var o=itm.childNodes[0].offsetHeight-parseInt(this.shadow.offset); - if(o>=0) v.style.height=o+"px"; - } - this.rt.actmn=itm; - this.rt.vshade=v; -}; - -function NlsMenuShadow(pos, offset, mId) { - this.pos=pos; - this.offset=offset; - this.mId=mId; - - this.dropShadow = function (smenu) { - var mn = nlsMenu[this.mId]; - var cs=""; - var hshadow = "
"+cs+"width='100%' height='5px' class='"+mn.stlprf+"horzshadow'>
"; - var vshadow = ""+cs+"id='vshade_"+this.mId+"' width='5px' height='100%' class='"+mn.stlprf+"vertshadow'>"; - var menutd = ""+smenu+""; - var cornertd = ""; - var av=[vshadow.replace(/@@PAD/gi,"top"), vshadow.replace(/@@PAD/gi,"bottom")]; - var ah=[hshadow.replace(/@@PAD/gi,"left"), hshadow.replace(/@@PAD/gi,"right")]; - switch (this.pos) { - case "none": - shadow += ""+menutd+""; - break; - case "bottomright" : - shadow += ""+menutd+av[0]+"" + - ""+ah[0]+cornertd+""; - break; - case "bottomleft" : - shadow += ""+av[0]+menutd+"" + - ""+cornertd+ah[1]+""; - break; - case "topleft" : - shadow += ""+cornertd+ah[1]+"" + - ""+av[1]+menutd+""; - break; - case "topright" : - shadow += ""+ah[0]+cornertd+"" + - ""+menutd+av[1]+""; - break; - } - return shadow + "
"; - }; -}; - -NLSMENU.showMenu = function(x1, y1, x2, y2, mnOrient, subDir, subAdj) { - this.mgr.clearTimeout(); - - if(this.menuOnShow(this.mId)==false)return; - - var ctx = NlsMenu.$GE(this.mId); - if (!ctx) { - //create menu if not rendered. - var dv=document.createElement("div"); - dv.innerHTML=this.renderMenu(); - document.body.insertBefore(dv, document.body.childNodes[0]); - ctx = NlsMenu.$GE(this.mId); - }; - ctx.style.visibility="hidden"; - ctx.style.display=""; - if(nls_isIE)this.init(); - - var w=window, d=document.body, de=document.documentElement; - var scrOffX = w.scrollX||d.scrollLeft||de.scrollLeft; - var scrOffY = w.scrollY||d.scrollTop||de.scrollTop; - var cW=w.innerWidth||d.clientWidth; - var cH=w.innerHeight||d.clientHeight; - var mW=ctx.childNodes[0].offsetWidth; - var mH=ctx.childNodes[0].offsetHeight; - var sDir=(subDir?[subDir[0], subDir[1]]:["right", "down"]); - var adjX=(subAdj?subAdj[0]:this.defPos[0]), adjY=(subAdj?subAdj[1]:this.defPos[1]); - - var dmfrm = NlsMenu.$GE(this.mId+"ifrm"); - if (dmfrm) { - var actMn = NlsMenu.$GE("actmn_"+this.mId).children[0]; - dmfrm.width = actMn.offsetWidth; - dmfrm.height = actMn.offsetHeight; - } - var mX=0,mY=0; - if (mnOrient=="V") { - if (sDir[0]=="right") { - if(x2+mW>cW){if(x1>=mW){mX=x1-mW+adjX+scrOffX;sDir[0]="left"}else{mX=cW-mW-1+scrOffX;}}else{mX=x2+scrOffX-adjX;} - } else { - if(x1-mW<0){if(x2+mWcH){if(y2>=mH){mY=y2-mH+scrOffY-adjY;sDir[1]="up"}else{mY=cH-mH-1+scrOffY;}}else{mY=y1+scrOffY+adjY;} - } else { - if(y1-mH<0){if(y1+mHcW){if(x2>=mW){mX=x2-mW+scrOffX-adjX;sDir[0]="left"}else{mX=cW-mW-1+scrOffX;}}else{mX=x1+scrOffX+adjX;} - } else { - if(x2-mW<0){if(x1+mWcH){if(y1>=mH){mY=y1-mH+scrOffY+adjY;sDir[1]="up"}else{mY=cH-mH-1+scrOffY;}}else{mY=y2+scrOffY-adjY;} - } else { - if(y1-mH<0){if(y2+mH=mX1 && oe.eX1<=mX2 && oe.eY1>=mY1 && oe.eY1<=mY2) || - (oe.eX1>=mX1 && oe.eX1<=mX2 && oe.eY2>=mY1 && oe.eY2<=mY2) || - (oe.eX2>=mX1 && oe.eX2<=mX2 && oe.eY1>=mY1 && oe.eY1<=mY2) || - (oe.eX2>=mX1 && oe.eX2<=mX2 && oe.eY2>=mY1 && oe.eY2<=mY2) || - (mX1>=oe.eX1 && mX1<=oe.eX2 && mY1>=oe.eY1 && mY1<=oe.eY2) || - (mX1>=oe.eX1 && mX1<=oe.eX2 && mY2>=oe.eY1 && mY2<=oe.eY2) || - (mX2>=oe.eX1 && mX2<=oe.eX2 && mY1>=oe.eY1 && mY1<=oe.eY2) || - (mX2>=oe.eX1 && mX2<=oe.eX2 && mY2>=oe.eY1 && mY2<=oe.eY2) || - (oe.eX1mX2 && oe.eY1>=mY1 && oe.eY1<=mY2) || - (oe.eX1mX2 && oe.eY2>=mY1 && oe.eY2<=mY2) - ) { - if (oe.e.style.visibility!="hidden") { - oe.e.style.visibility="hidden"; - if (mn.winElmt==null) mn.winElmt=[]; - mn.winElmt[mn.winElmt.length]=oe.e; - } - } - } -}; - -NLSMENU.showMenuAbs = function(x, y) { - var ctx = NlsMenu.$GE(this.mId); - ctx.style.top=y+"px"; ctx.style.left=x+"px"; - ctx.style.display=""; - this.rt.active=true; -}; - -NLSMENU.hideMenu = function() { - var ctx = NlsMenu.$GE(this.mId); - if (!ctx) return; - if (!this.isMenubar) { - this.rt.active=false; - if (this.effect) { - this.effect.start(true); - if ((nls_isIE && this.effect.effName!="aoslide") || nls_isOpera && this.effect.effName!="aoslide") {ctx.style.visibility="hidden";} else { this.effect.onHide=function() {ctx.style.visibility="hidden";}; }; - this.effect.run(); - } else { ctx.style.visibility="hidden"; } - - this.menuOnHide(this.mId); - } else { - this.isMenuOpened = false; - } - - if (this.lsItm!=null) { - var it=this.items[this.lsItm.id]; - if(it.state!=2 && !it.selected) { - setMnStyle(this.lsItm, (it.enable?"N":"D"), NlsMenu.getPrf(it, this)); - setMnIcon(this, it, "N"); - } - this.lsItm=null; - } - if (this.winElmt!=null && this.winElmt.length>0) { - for (i=0;i 0) { - for (var i=0;i1) { - var k=mnItm.intKey; - var c=NlsMenu.$GE("ic_"+k), o=NlsMenu.$GE("icovr_"+k), d=NlsMenu.$GE("icdis_"+k); - - c.style.display=(tf=="N"||(tf=="D" && !d)?"":"none"); - o.style.display=(tf=="O"?"":"none"); - if(d) d.style.display=(tf=="D"?"":"none"); - } - - if (mn.showSubIcon && mnItm.subMenuId!="") { - var ic=NlsMenu.$GE("subicovr_"+mnItm.intKey); - if(ic){ - ic.style.display=(tf=="O"?"":"none"); - ic=NlsMenu.$GE("subic_"+mnItm.intKey); - if(ic)ic.style.display=(tf=="N"||tf=="D"?"":"none"); - } - } -}; - -function setMnStyle(it, s, prefix) { - var suff=(s=="O"?"over":(s=="S"?"sel":"")); - it.className=prefix+"nlsitemcontainer"+suff; - var r = it.childNodes[0].rows[0], rc=null; - for (var i=0; i 0) { - for (var i=0; i 0) { - for (var i=0; i
"); - $('#TB_overlay').click(TB.remove); - } - } else { - // all others - if (document.getElementById('TB_overlay') === null) { - $('body').append("
"); - $('#TB_overlay').click(TB.remove); - } - } - - if (TB.detectMacXFF()) { - $('#TB_overlay').addClass('TB_overlayMacFFBGHack'); // use png overlay so hide flash - } else { - $('#TB_overlay').addClass('TB_overlayBG'); // use background and opacity - } - - if (params.caption === null) { - params.caption = ''; - } - - $('body').append("
"); // add loader to the page - $('#TB_load').show(); // show loader - - var baseURL; - if (params.url.indexOf('?') !== -1) { - // ff there is a query string involved - baseURL = params.url.substr(0, params.url.indexOf('?')); - } else { - baseURL = params.url; - } - - var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; - var url_params = {}; - - if ( baseURL.toLowerCase().match(urlString) ) { - TB.processImages(params, urlString); - } else { - var queryString = params.url.replace(/^[^\?]+\??/,''); - url_params = TB.parseQuery(queryString); - - TB.processDialog(params, url_params); - } - - if (url_params['modal'] != 'true') { - $(document).bind( - 'keyup', - function(e){ - if (e.which == 27){ - // close - TB.remove(); - } - } - ); - } - } catch(e) { - //nothing here - } -} - -// helper functions below -TB.processImages = function (params, urlString) { - // code to show images - var TB_PrevCaption = ''; - var TB_PrevURL = ''; - var TB_PrevHTML = ''; - var TB_NextCaption = ''; - var TB_NextURL = ''; - var TB_NextHTML = ''; - var TB_imageCount = ''; - var TB_FoundURL = false; - - if (params.imageGroup) { - // scan images in group to create Prev/Next links - var TB_TempArray = $('a[rel=' + params.imageGroup + ']').get(); - for (var TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === '')); TB_Counter++) { - var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); - if (!(TB_TempArray[TB_Counter].href == params.url)) { - if (TB_FoundURL) { - TB_NextCaption = TB_TempArray[TB_Counter].title; - TB_NextURL = TB_TempArray[TB_Counter].href; - TB_NextHTML = "  Next >"; - } else { - TB_PrevCaption = TB_TempArray[TB_Counter].title; - TB_PrevURL = TB_TempArray[TB_Counter].href; - TB_PrevHTML = "  < Prev"; - } - } else { - TB_FoundURL = true; - TB_imageCount = 'Image ' + (TB_Counter + 1) + ' of ' + TB_TempArray.length; - } - } - } - - var imgPreloader = new Image(); - $(imgPreloader).bind( - 'load', - function() { - $(this).unbind('load'); - var $image_size = TB.scaleImage.call(TB, this); - - TB.Width = $image_size.width + 30; - TB.Height = $image_size.height + 60; - $('#TB_window').append("" + params.caption + "" + "
" + params.caption + "
" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "
close or Esc Key
"); - $('#TB_closeWindowButton').click(TB.remove); - - if (TB_PrevHTML !== '') { - function goPrev() { - $('#TB_window').remove(); - $('body').append("
"); - TB.show( {caption: TB_PrevCaption, url: TB_PrevURL, imageGroup: params.imageGroup} ); - return false; - } - - $('#TB_prev').click(goPrev); - } - - if (TB_NextHTML !== '') { - function goNext() { - $('#TB_window').remove(); - $('body').append("
"); - TB.show( {caption: TB_NextCaption, url: TB_NextURL, imageGroup: params.imageGroup} ); - return false; - } - - $('#TB_next').click(goNext); - - } - - $(document).bind( - 'keydown', - function(e) { - var keycode = e.which; - - if (keycode == 27) { // close - TB.remove(); - } else if (keycode == 190) { - // display previous image - if (TB_NextHTML != '') { - $(this).unbind('keydown'); - goNext(); - } - } else if (keycode == 188) { - // display next image - if(TB_PrevHTML != ''){ - $(this).unbind('keydown'); - goPrev(); - } - } - } - ); - - // show image after it's loaded - TB.position(); - $('#TB_load').remove(); - $('#TB_ImageOff').click(TB.remove); - $('#TB_window').css('display', 'block'); // for safari using css instead of show - } - ); - - imgPreloader.src = params.url; -} - -TB.scaleImage = function ($image) { - // resizing large images - orginal by Christian Montoya edited by me - var pagesize = TB.getPageSize(); - var x = pagesize[0] - 150; - var y = pagesize[1] - 150; - - var imageWidth = $image.width; - var imageHeight = $image.height; - - if (imageWidth > x) { - imageHeight = imageHeight * (x / imageWidth); - imageWidth = x; - if (imageHeight > y) { - imageWidth = imageWidth * (y / imageHeight); - imageHeight = y; - } - } else if (imageHeight > y) { - imageWidth = imageWidth * (y / imageHeight); - imageHeight = y; - if (imageWidth > x) { - imageHeight = imageHeight * (x / imageWidth); - imageWidth = x; - } - } - - return {width: imageWidth, height: imageHeight}; -} - -TB.processDialog = function (params, url_params) { - // code to show html - - // window size is global - TB.Width = (url_params['width'] * 1) + 30 || 630; // defaults to 630 if no paramaters were added to URL - TB.Height = (url_params['height'] * 1) + 40 || 440; // defaults to 440 if no paramaters were added to URL - - var ajaxContentW = TB.Width - 30; - var ajaxContentH = TB.Height - 45; - - if (params.url.indexOf('TB_iframe') != -1) { - // either iframe or ajax window - urlNoQuery = params.url.split('TB_'); - $('#TB_iframeContent').remove(); - - if (url_params['modal'] != 'true') { - // iframe no modal - $('#TB_window').append("
" + params.caption + "
close or Esc Key
"); - }else{ - // iframe modal - $('#TB_overlay').unbind(); - $('#TB_window').append(""); - } - } else { - // not an iframe, ajax - if ($('#TB_window').css('display') != 'block') { - if (url_params['modal'] != 'true') { - // ajax no modal - $('#TB_window').append("
" + params.caption + "
close or Esc Key
"); - } else { - // ajax modal - $('#TB_overlay').unbind(); - $('#TB_window').append("
"); - } - } else { - // this means the window is already up, we are just loading new content via ajax - $('#TB_ajaxContent')[0].style.width = ajaxContentW + 'px'; - $('#TB_ajaxContent')[0].style.height = ajaxContentH + 'px'; - $('#TB_ajaxContent')[0].scrollTop = 0; - $('#TB_ajaxWindowTitle').html(params.caption); - } - } - - $('#TB_closeWindowButton').click(TB.remove); - - if (params.url.indexOf('TB_inline') != -1) { - $('#TB_ajaxContent').html( $('#' + url_params['inlineId']).html() ); - $('#TB_window').unload( - function () { - // move elements back when you're finished - $('#' + url_params['inlineId']).html( $('#TB_ajaxContent').html() ); - } - ); - - TB.position(); - $('#TB_load').remove(); - $('#TB_window').css('display', 'block'); - } else if (params.url.indexOf('TB_iframe') != -1) { - TB.position(); - - if ($.browser.safari) { - // safari needs help because it will not fire iframe onload - $('#TB_load').remove(); - $('#TB_window').css('display', 'block'); - } - } else { - var $content_url = params.url + '&random=' + (new Date().getTime()); - - if (params.postParams === undefined) { - $.get( - $content_url, - function ($data) { - TB.onDataReceived($data, params); - } - ); - } - else { - $.post( - $content_url, - params.postParams, - function ($data) { - TB.onDataReceived($data, params); - } - ); - } - - /*$('#TB_ajaxContent').load( - params.url += '&random=' + (new Date().getTime()), - params.postParams, - function() { - //to do a post change this load method - TB.position(); - $('#TB_load').remove(); - TB.init('#TB_ajaxContent a.thickbox'); - $('#TB_window').css('display', 'block'); - - if ( $.isFunction(params.showCallback) ) { - params.showCallback(); - } - } - );*/ - } -} - -TB.parseRedirect = function ($data) { - var $match_redirect = new RegExp('^#redirect#(.*)').exec($data); - if ($match_redirect != null) { - // redirect to external template requested - return $match_redirect[1]; - } - - return false; -} - -TB.onDataReceived = function ($data, $params) { - if ( $.isFunction($params.onDataReceived) ) { - $data = $params.onDataReceived($data); - if ($data === false) { - // this callback even could prevent redirect action - // callback requested to stop processing - return ; - } - } - - var $redirect = TB.parseRedirect($data); - if ($redirect !== false) { - window.location.href = $redirect; - return ; - } - - $('#TB_ajaxContent').html($data); - - TB.position(); - $('#TB_load').remove(); - TB.init('#TB_ajaxContent a.thickbox'); - $('#TB_window').css('display', 'block'); - - if ( $.isFunction($params.onAfterShow) ) { - $params.onAfterShow(); - } -} - -TB.showIframe = function () { - $('#TB_load').remove(); - $('#TB_window').css('display', 'block'); -} - -TB.remove = function () { - $('#TB_imageOff').unbind('click'); - $('#TB_closeWindowButton').unbind('click'); - - $('#TB_window').fadeOut( - 'fast', - function(){ - $('#TB_window,#TB_overlay,#TB_HideSelect').trigger('unload').unbind().remove(); - } - ); - - $('#TB_load').remove(); - if (typeof document.body.style.maxHeight == 'undefined') { - // if IE 6 - $('body','html').css( {height: 'auto', width: 'auto'} ); - $('html').css('overflow', ''); - } - - $(document).unbind('keydown').unbind('keyup'); - - return false; -} - -TB.position = function () { - $('#TB_window').css( {marginLeft: '-' + parseInt((TB.Width / 2), 10) + 'px', width: TB.Width + 'px'} ); - - if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { - // take away IE6 - $('#TB_window').css( {marginTop: '-' + parseInt((TB.Height / 2), 10) + 'px'} ); - } -} - -TB.parseQuery = function (query) { - var Params = {}; - if (!query) { - // return empty object - return Params; - } - - var Pairs = query.split(/[;&]/); - - for (var i = 0; i < Pairs.length; i++ ) { - var KeyVal = Pairs[i].split('='); - if (!KeyVal || KeyVal.length != 2) { - continue; - } - - var key = unescape( KeyVal[0] ); - var val = unescape( KeyVal[1] ); - val = val.replace(/\+/g, ' '); - Params[key] = val; - } - - return Params; -} - -TB.getPageSize = function () { - var de = document.documentElement; - var w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; - var h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight; - - return [w, h]; -} - -TB.detectMacXFF = function () { - var userAgent = navigator.userAgent.toLowerCase(); - if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox') != -1) { - return true; - } - - return false; -} - - Index: branches/5.1.x/themes/default2009/platform/terms.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/terms.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/terms.tpl (revision 0) @@ -1,88 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - - - - - - - - - - - -
- The services that [Company Name] provides to you are to the following Terms of Use. You should carefully read the following Terms and Conditions. By using any Website in our Network (list your websites) you agree to be bound to the Terms of Use. [Company Name] can modify these Terms at any time without prior notice to you by posting revised Terms on our sites.

-
- 1. Content
- - [Company Name] provide access to a variety of resources, including developer tools, client information and case studies, communication forums and product information ("content"). Services include any updates, correspondence, enhancements, new features, and/or additions, are subject to Terms of Use.

- -
- 2. Services
- - Our Websites may contain e-mail correspondence, Forums, company news, and business related web pages specifically designed to enable you to communicate with the staff here at [Company Name].

- -
- 2.1 Use of Services
- - Services may contain e-mail correspondence, forums, company news, and business related web pages. The customer or viewer agrees to use the Forum only to post messages and material that are appropriate.

- - * When browsing our Websites or using the Forums, you agree not to upload, post, transmit or make available any Content that is in violation of both U.S. and International Law, Content that is harmful, threatening, abusive, harassing, defamatory, vulgar, obscene, invasive of another's privacy, hateful, or racially, ethnically or otherwise objectionable.
- * [Company Name] is not by any means obligated to monitor the Forum and will not be held responsible for any content posted onto the Forum. [Company Name] does, however, reserve the right to review, edit, modify or delete messages posted and to remove any messages at any time, without notice, for any reason whatsoever.

- -
- 2.2 Restrictions
- - * The Services [Company Name] provides for you are for your personal and non-commercial use only, unless otherwise specified. The Content and Services available on our Websites is copyrighted information owned by [Company Name].
- * You may not: permit other individuals to use the Content and Services except under the terms listed above; duplicate or modify use of the Content and Services.
- * You also may not copy or sell any works or otherwise transfer rights to any of [Company Name]' information, software, products, or Content and Services obtained from our Websites.
- * You promise that you will not use or redistribute the Content and Services for any reason. You have no right to use the Content and Services for productive or commercial use.

-
-
-
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/top_background.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/top_baner_1.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/star_small.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/file_icons/avi.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/login/forgot_password.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/login/forgot_password.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/login/forgot_password.tpl (revision 0) @@ -1,109 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - - -
-
- -
-
- - - - - - - - - - - -

- - - - - - img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
- -
- - - "> - - - - - - "> - - - - - - - "> - - - - - - - - - " /> - ');" value=""> - -
- -
-
- " tabindex="" style="width: 155px;"> -
- -
- -
-
- " tabindex="" style="width: 155px;"> -
-
-
- -
-
-
- - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/input_text_background.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/index.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/index.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/index.tpl (revision 0) @@ -1,58 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - - -
-
- -
-
- - - - - - - -
-
- - - -
-
-
- - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/login/login_pending_disabled.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/login/login_pending_disabled.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/login/login_pending_disabled.tpl (revision 0) @@ -1,51 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - : - - -
-
-
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/banners/banner_top.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/banners/banner_top.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/banners/banner_top.elm.tpl (revision 0) @@ -1,2 +0,0 @@ -img/top_baner_1.gif" width="500" height="70" alt="" />
- \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/header.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/header.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/header.elm.tpl (revision 0) @@ -1,54 +0,0 @@ - - - - - - - - - - -
- ">img/globe.gif" alt="" />img/logo.gif" alt="" />
-
- - - - - - - - - - - - - - -
-
- - : - - -
- -
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/title_bar.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/title_bar.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/title_bar.elm.tpl (revision 0) @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/banners/banner_right.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/banners/banner_right.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/banners/banner_right.elm.tpl (revision 0) @@ -1,14 +0,0 @@ - - - - - - - -
- - Right-side Banner - -
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/forms.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/forms.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/forms.elm.tpl (revision 0) @@ -1,514 +0,0 @@ - - - - - - -
- img/warning_icon.gif" width="21" height="18" alt=""/> - - -
-
-
-
- - -
img/s.gif" width="3" height="1" alt=""/>
-
-
img/s.gif" width="3" height="1" alt=""/>
- -
-
-
- - - - - img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" /> - - - - 140px">  - - -
- -

- - -
- - - - - -
img/s.gif" width="3" height="1" alt=""/>
- - -
-
- - - - - - > - *: - - - - - -   - - - - - - "> - - - - - - - - - - "> - - - - " value="" /> - - - - - - - "> - - - -
-
- " value="" tabindex="" maxlength="" style=""> - - - - -
- - - - -
_input" style="display: none;"> - -
-
- -
- -
- -
- - <inp2:Field name='LocalName' html_escape='1'/> - - - -
-
-
-
- - - - _flag"> - - - <inp2:Field name='LocalName' html_escape='1'/> - - <inp2:Field name='LocalName' html_escape='1'/> - - - - - - - - - - -
- -
-
- - - "> - - - - - - - - - - - - - "> - - - -
-
- " id="" value="" tabindex="" style="" /> - - - - -
- - - "> - - - -
-
- " tabindex="" style=""> - - () - - [upload]" value="" /> - - - -
- - - "> - - - -
-
- - " target="_blank"> - - -
- - - - - -
- " name="" value="0" /> - " onchange="update_checkbox(this, document.getElementById(''));"> - - -
-
- " tabindex="" style=""> - [upload]" value="" />
- " value="" style=""> - - - -
- - - "> - - - -
-
- - "> - - -
- - - - - -
- " name="" value="0" /> - " onchange="update_checkbox(this, document.getElementById(''));"> - - -
-
- " tabindex="" style=""> - [upload]" value="" /> - - - -
- - - " id="" value="" /> - - - - "> - - - -
-
- " id="" value="" tabindex="" size="" style="" datepickerIcon="img/calendar_icon.gif"> () - - " id="" value="" /> - - - -
- - - "> - - - -
-
- " id="" value="" tabindex="" size="" style="">  - () - - " id="" value="" /> - - - -
- - - "> - - - -
-
- " id="" value="" tabindex="" size="" style="" datepickerIcon="core/admin_templates/img/calendar_icon.gif"> - () - -  " id="" value="" tabindex="" size="" style=""> () - - - -
- - - "> - - - -
-
- - - - -
- - - - -
_input" style="display: none;"> - -
-
- -
- -
- -
- - <inp2:Field name='LocalName' html_escape='1'/> - - - -
-
-
-
- - - "> - - - - - - - - - - - - - - - - - - - - - "> - - - -
-
- - - - -
- - - " style="" name="" id="_" value="">  - - - - " style="" name="" id="_" value="">  - - - - "> - - - -
-
- - - - - - - - -
- - - "> - - - -
-
- " alt=""/>
- img/s.gif" width="1" height="5" alt=""/>
- " value="" tabindex="" style=""> - - - -
- - - "> - - - -
-
- " name="" value="" /> - " type="checkbox" id="_cb_" name="_cb_" style="" onchange="update_checkbox(this, document.getElementById(''));"> - - - - -
- - - - - "> - - - - -
-
- - - - " onclick="$ItemCategories.AddCategory('»&nbsp;', $delete_button, );"/>
- -
- - - - - - - - - -
- : -
-
- - - - - - - -
- - - - - - - - - - - "> - - - - - - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/html_head.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/html_head.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/html_head.elm.tpl (revision 0) @@ -1,31 +0,0 @@ - - -" /> - -" /> -" /> - - - - - - - - - - - - - - - - Index: branches/5.1.x/themes/default2009/platform/elements/pagination.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/pagination.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/pagination.elm.tpl (revision 0) @@ -1,52 +0,0 @@ - - img/pagenation_left.gif" width="5" height="5" alt="" />   - - - -  img/pagenation_right.gif" width="5" height="5" alt="" /> - - - - - - - - img/s.gif" width="1" height="1" alt="" /> - - - - - - -
img/s.gif" width="1" height="1" alt="" />
-
- - - - - - - - - -
- :  - - - - - : -
- - - " value="" /> - -
- Index: branches/5.1.x/themes/default2009/platform/elements/footer.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/footer.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/footer.elm.tpl (revision 0) @@ -1,15 +0,0 @@ - - - - - - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/menu.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/menu.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/menu.elm.tpl (revision 0) @@ -1,104 +0,0 @@ - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/navigation_bar.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/navigation_bar.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/navigation_bar.elm.tpl (revision 0) @@ -1,38 +0,0 @@ - - - - img/icon_home.gif" width="9" height="9" alt=""/> "> - - - - - "> - - - - - - "> - - "> - - - - - - "> - - - - - - - - - - - -
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/recommend_site.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/side_boxes/recommend_site.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/recommend_site.elm.tpl (revision 0) @@ -1,16 +0,0 @@ - - - - -
-img/s.gif" alt="" width="1" height="5" border="0" />
- -
-
- -
-
-
- " /> - -
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/search.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/side_boxes/search.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/search.elm.tpl (revision 0) @@ -1,51 +0,0 @@ - - - - -
"> - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - -
- -
- !" /> - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/related_searches.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/side_boxes/related_searches.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/related_searches.elm.tpl (revision 0) @@ -1,15 +0,0 @@ - - - - - - - - "> - - - - - - -
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/nothing_found.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/content_boxes/nothing_found.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/nothing_found.elm.tpl (revision 0) @@ -1,25 +0,0 @@ - - - - - - - - - - -
- img/warning_icon.gif" width="21" height="18" alt=""/> - -
-
-
- - - ! - - ! - -
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/sub_categories.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/content_boxes/sub_categories.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/sub_categories.elm.tpl (revision 0) @@ -1,50 +0,0 @@ - - - - - - - - - - - -
- - " class="image_border" align="right" hspace="5" vspace="0" alt=""/> - - -
- -
- - - - - - () - - - - - - - -
- :  |  : - - : -
- - img/s.gif" width="1" height="4" alt="" />
- img/grey_pix.gif" width="100%" height="1" alt="" />
-
- - - - - -
-
-
- \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/login.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/side_boxes/login.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/login.elm.tpl (revision 0) @@ -1,125 +0,0 @@ - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- img/menu-li-2-level.gif" alt="" width="4" height="4" border="0" />
-
- "> -
- img/s.gif" alt="" width="1" height="7" border="0" />
-
- -
- - - - - -
- -
-
- -
-
-
- - img/s.gif" width="1" height="5" alt=""/>
- -
-
- - img/s.gif" alt="" width="1" height="10" border="0" />
- - - - - - -
- " />
-
- -
- - img/s.gif" alt="" width="5" height="5" border="0" />
- -
-
- - - " class="more-link" > img/side_link_str.gif" width="6" height="5" alt="" />
-
- - " class="more-link" >? img/side_link_str.gif" width="6" height="5" alt="" /> - " /> - - -
- Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/related_items.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/content_boxes/related_items.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/related_items.elm.tpl (revision 0) @@ -1,7 +0,0 @@ - - - -
    - -
- \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/mailing_list.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/side_boxes/mailing_list.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/mailing_list.elm.tpl (revision 0) @@ -1,21 +0,0 @@ - - - - -
-img/s.gif" alt="" width="1" height="5" border="0" />
- -
-
- -
-
- -
- " /> - " /> -   - - - -
Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/no_favorites.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/content_boxes/no_favorites.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/no_favorites.elm.tpl (revision 0) @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/inc/captcha_image.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/inc/captcha_image.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/inc/captcha_image.elm.tpl (revision 0) @@ -1 +0,0 @@ - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/my_account/preferences_tab.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/my_account/preferences_tab.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/my_account/preferences_tab.elm.tpl (revision 0) @@ -1 +0,0 @@ - Index: branches/5.1.x/themes/default2009/platform/designs/popup_design.des.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/designs/popup_design.des.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/designs/popup_design.des.tpl (revision 0) @@ -1,24 +0,0 @@ - - - - - - - - - <inp2:m_GetConfig name="Site_Name"/> - - " /> - - - - -
-
img/s.gif" width="1" height="1" alt="" />
-
- -
- -
- - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/designs/default_design.des.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/designs/default_design.des.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/designs/default_design.des.tpl (revision 0) @@ -1,123 +0,0 @@ - - - - - - - - - - - - - <inp2:m_GetConfig name="Site_Name"/> :: <inp2:m_RenderElement name="page_title" default_element="cms_page_title" no_editing="1"/> - - - - - - - - - -
-
- - - - - - - -
- -
- -
- - img/s.gif" width="1" height="1" alt=""/>
- img/grey_pix.gif" width="100%" height="1" alt=""/>
- img/s.gif" width="1" height="1" alt=""/>
- - - - - - - - - - - - - - - - - - - - - - - REMOVE THIS LINE TO UNCOMMENT ##--> - -
- -
-
- -
-
- -
-
-
- - -
- img/s.gif" width="3" height="1" alt=""/>
-
- -
-
- -
- -
- - - - - - - -
-
-
- - -
-
- img/s.gif" width="3" height="1" alt=""/>
-
-
-
- -
-
-
- - - - - -
- -
-
-
- - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/designs/default_design_ajax.des.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/designs/default_design_ajax.des.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/designs/default_design_ajax.des.tpl (revision 0) @@ -1,4 +0,0 @@ - - - - Index: branches/5.1.x/themes/default2009/platform/elements/users.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/users.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/users.elm.tpl (revision 0) @@ -1,35 +0,0 @@ - - - - - - -
img/s.gif" width="1" height="1" alt="" />
- - - - - "> - - - - - - - - - - - - - - - -
- - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/side_boxes.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/side_boxes.elm.tpl (revision 0) @@ -1,14 +0,0 @@ - - - - - - - - -
-
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/content_boxes.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/content_boxes.elm.tpl (revision 0) @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - -
- img/s.gif" width="1" height="20" alt=""/>
-
- img/s.gif" width="13" height="1" alt=""/>
-
-
-
- img/s.gif" width="13" height="1" alt=""/>
-
- img/s.gif" width="13" height="1" alt=""/>
-
- - - img/s.gif" width="13" height="1" alt=""/>
-
-
- - - - - - - - - - - - - - - - - - -
- img/s.gif" width="1" height="20" alt=""/>
-
- img/s.gif" width="13" height="1" alt=""/>
-
-
-
- img/s.gif" width="13" height="1" alt=""/>
-
- img/s.gif" width="13" height="1" alt=""/>
-
- - - img/s.gif" width="13" height="1" alt=""/>
-
-
- - - - - - - - - - -
- img/s.gif" width="13" height="1" alt=""/>
-
- - - img/s.gif" width="13" height="1" alt=""/>
-
-
- - - - - - img/menu_active_border.gif" width="1" height="37" alt=""/>
- - - ">"/> - - - " class="top-menu-link"> - - - img/menu_active_border.gif" width="1" height="37" alt=""/>
- - - - img/s.gif" width="1" height="37" alt=""/>
- - - ">"/> - - - " class="top-menu-link"> - - - img/s.gif" width="1" height="37" alt=""/>
- -
-
- - - - - img/menu-li-2-level.gif" alt="" width="4" height="4" border="0" />
- - - - "> - - "> - - - -
- - - - - : []
- : -

- - -
- - - img/star_rate.gif" width="10" height="11" alt=""/> - - - - - - - - - - - " title="" alt="" border="0" align="" /> - - - - active-tabinactive-tab"> - "> - -   - - - - - - - - img/file_icons/" alt="" border="0" />
- - - - - -
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/preferences.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/preferences.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/preferences.elm.tpl (revision 0) @@ -1,35 +0,0 @@ - - - - - - " name="" value=""/> - " onchange="update_checkbox(this, document.getElementById(''));"/> - - - - - -
img/s.gif" width="3" height="1" alt=""/>
- - -
-
- - - - - - - - - - - - -
img/s.gif" width="3" height="1" alt=""/>
- - -
-
-
\ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/categories.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/categories.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/categories.elm.tpl (revision 0) @@ -1,126 +0,0 @@ - - - - - - - - - -
- img/directory_icon.gif" width="22" height="17" alt="" />
-
- - (: ) - - - - " class="text-title"> @ ( / ) - - " class="text-title"> ( / ) - - - - - img/icon_new.gif" alt=""/> - img/icon_pick.gif" alt=""/> - -
- img/s.gif" width="1" height="4" alt="" />
- - -
- - -
- - - - - - - - - - - -
  • - - " class="text-title"> @ - - " class="text-title"> - -
  • - -
    - - - - - - - - "> - - - - - " onclick="$ItemCategories.DeleteCategory();"/> - - - - - - - -
  • - " class="sub-category">... -
  • -
    - - -
  • - " class="sub-category">1 -
  • -
    - - -
  • - " class="sub-category"> - - -
      - -
    -
    -
  • -
    - - -
  • - " class="sub-category"> - - -
      - -
    -
    -
  • -
    - - -
  • - " class="sub-category"> (level 2) - - -
      - -
    -
    -
  • -
    - - - Index: branches/5.1.x/themes/default2009/platform/elements/search_results.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/search_results.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/search_results.elm.tpl (revision 0) @@ -1,20 +0,0 @@ - - :
    - img/s.gif" width="1" height="5" alt="">
    - "> - - - - -
    %" bgcolor="">img/s.gif" width="1" height="5" alt="">%" bgcolor="">img/s.gif" width="1" height="5" alt="">
    -
    - - - :
    - img/s.gif" width="1" height="5" alt="">
    - - - - -
    ">img/s.gif" width="1" height="5" alt="">
    -
    \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/designs/general.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/designs/general.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/designs/general.tpl (revision 0) @@ -1,56 +0,0 @@ - - - - - - - - - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - - -
    -
    - - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/designs/form.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/designs/form.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/designs/form.tpl (revision 0) @@ -1,70 +0,0 @@ - - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - -

    - *

    - - - - - - - img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />

    - -

    "> - - - - - - "/> - - " value=""/> - "/> - "/> - -
    -
    -

    - -
    -
    -
    -
    - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/menu_inedit.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/elements/dynamic_forms.elm.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/dynamic_forms.elm.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/dynamic_forms.elm.tpl (revision 0) @@ -1,58 +0,0 @@ - - " /> - - - - - " id="verify_" value="" /> - - - - - - - - - - - - "> - " name="_cb_" class="" onclick="document.getElementById('').value = this.checked ? 1:0"> - - - - - - - - name="" id="_" value="">  - - - - - - - - - - *:   - - - -
    -
    - -
    - - - - - - -
    img/s.gif" width="3" height="1" alt=""/>
    - - -
    -
    \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/page_icon.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/elements/menu_subsections.xml.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/menu_subsections.xml.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/menu_subsections.xml.tpl (revision 0) @@ -1,32 +0,0 @@ - - - - - - - - - " - orient="V" showicon="true" showsubicon="true" stlprf="" - submenuic="['img/arrow_white.gif']"> - - - " url="" enb="true" - - - subid="subpages" - suburl="" - - - >]]> - - - - - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/menu_sections.xml.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/menu_sections.xml.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/menu_sections.xml.tpl (revision 0) @@ -1,19 +0,0 @@ - - - " - url="" - - ico="['']" - - ico="['img/menu_inedit.gif']" - - enb="true" title="" - subid="subpages" - suburl="" >]]> - - \ No newline at end of file Index: branches/5.1.x/themes/default2009/.smsignore =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/.smsignore (revision 12127) +++ branches/5.1.x/themes/default2009/.smsignore (revision 0) @@ -1 +0,0 @@ -phrases_edit\.tpl \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/designs/.smsignore =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/designs/.smsignore (revision 12127) +++ branches/5.1.x/themes/default2009/platform/designs/.smsignore (revision 0) @@ -1 +0,0 @@ -.*\.tpl \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/elements/.smsignore =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/elements/.smsignore (revision 12127) +++ branches/5.1.x/themes/default2009/platform/elements/.smsignore (revision 0) @@ -1 +0,0 @@ -.*\.xml\.tpl \ No newline at end of file Index: branches/5.1.x/themes/default2009/platform/img/language_icons/russian_off.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/language_icons/russian_on.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/language_icons/english_on.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/img/language_icons/english_off.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/themes/default2009/platform/sitemap.tpl =================================================================== diff -u -N --- branches/5.1.x/themes/default2009/platform/sitemap.tpl (revision 12127) +++ branches/5.1.x/themes/default2009/platform/sitemap.tpl (revision 0) @@ -1,57 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - - -
    - -
      - -
    - -
    -
    -
    -
    -
    - - \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_infinity_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/tab_left.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/install/install_schema.sql =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 12127) +++ branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 12657) @@ -48,7 +48,7 @@ heading varchar(255) default NULL, prompt varchar(255) default NULL, element_type varchar(20) NOT NULL default '', - validation varchar(255) default NULL, + Validation text, ValueList text, DisplayOrder double NOT NULL default '0', GroupDisplayOrder double NOT NULL default '0', @@ -107,14 +107,16 @@ Event varchar(40) NOT NULL default '', ReplacementTags text, Enabled int(11) NOT NULL default '1', - FromUserId int(11) NOT NULL default '-1', + FrontEndOnly tinyint(3) unsigned NOT NULL default '0', + FromUserId int(11) default NULL, Module varchar(40) NOT NULL default '', Description varchar(255) NOT NULL default '', - Type int(11) NOT NULL default '0', + `Type` int(11) NOT NULL default '0', PRIMARY KEY (EventId), - KEY Type (Type), + KEY `Type` (`Type`), KEY Enabled (Enabled), - KEY Event (Event) + KEY Event (Event), + KEY FrontEndOnly (FrontEndOnly) ); CREATE TABLE IdGenerator ( @@ -175,18 +177,20 @@ ); CREATE TABLE Phrase ( - Phrase varchar(255) NOT NULL default '', + Phrase varchar(255) NOT NULL DEFAULT '', + PhraseKey varchar(255) NOT NULL, Translation text NOT NULL, - PhraseType int(11) NOT NULL default '0', - PhraseId int(11) NOT NULL auto_increment, - LanguageId int(11) NOT NULL default '0', - LastChanged int(10) unsigned NOT NULL default '0', - LastChangeIP varchar(15) NOT NULL default '', - Module varchar(30) NOT NULL default 'In-Portal', - PRIMARY KEY (PhraseId), + PhraseType int(11) NOT NULL DEFAULT '0', + PhraseId int(11) NOT NULL AUTO_INCREMENT, + LanguageId int(11) NOT NULL DEFAULT '0', + LastChanged int(10) unsigned NOT NULL DEFAULT '0', + LastChangeIP varchar(15) NOT NULL DEFAULT '', + Module varchar(30) NOT NULL DEFAULT 'In-Portal', + PRIMARY KEY (PhraseId), UNIQUE KEY LanguageId_2 (LanguageId,Phrase), KEY LanguageId (LanguageId), - KEY Phrase_Index (Phrase) + KEY Phrase_Index (Phrase), + KEY PhraseKey (PhraseKey) ); CREATE TABLE PhraseCache ( @@ -318,21 +322,21 @@ ); CREATE TABLE UserSession ( - SessionKey int(10) unsigned NOT NULL default '0', - CurrentTempKey int(10) unsigned default NULL, - PrevTempKey int(10) unsigned default NULL, - LastAccessed int(10) unsigned NOT NULL default '0', - PortalUserId int(11) NOT NULL default '-2', - `Language` int(11) NOT NULL default '1', - Theme int(11) NOT NULL default '1', - GroupId int(11) NOT NULL default '0', - IpAddress varchar(20) NOT NULL default '0.0.0.0', - `Status` int(11) NOT NULL default '1', - GroupList varchar(255) default NULL, - tz int(11) default NULL, - PRIMARY KEY (SessionKey), + SessionKey int(10) unsigned NOT NULL DEFAULT '0', + LastAccessed int(10) unsigned NOT NULL DEFAULT '0', + PortalUserId int(11) NOT NULL DEFAULT '-2', + `Language` int(11) NOT NULL DEFAULT '1', + Theme int(11) NOT NULL DEFAULT '1', + GroupId int(11) NOT NULL DEFAULT '0', + IpAddress varchar(20) NOT NULL DEFAULT '0.0.0.0', + `Status` int(11) NOT NULL DEFAULT '1', + GroupList varchar(255) DEFAULT NULL, + tz int(11) DEFAULT NULL, + BrowserSignature varchar(32) NOT NULL, + PRIMARY KEY (SessionKey), KEY UserId (PortalUserId), - KEY LastAccessed (LastAccessed) + KEY LastAccessed (LastAccessed), + KEY BrowserSignature (BrowserSignature) ); CREATE TABLE EmailLog ( @@ -412,7 +416,7 @@ Modified int(11) NOT NULL default '0', ModifiedById int(11) NOT NULL default '0', CachedTemplate varchar(255) NOT NULL, - Template varchar(255) default NULL, + Template varchar(255) NOT NULL default '#inherit#', UseExternalUrl tinyint(3) unsigned NOT NULL default '0', ExternalUrl varchar(255) NOT NULL default '', UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0', Index: branches/5.1.x/core/admin_templates/img/tab_active_back.jpg =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/catalog/catalog_counters.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/catalog/catalog_counters.tpl (.../catalog_counters.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/catalog/catalog_counters.tpl (.../catalog_counters.tpl) (revision 12657) @@ -5,7 +5,7 @@ $Catalog.ParentCategoryID = ; - + Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_reset_to_pending_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_reset_to_pending.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_affiliate_payment_type.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_deleted.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_summary_logs.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/languages/phrases_cache.php =================================================================== diff -u -N -r12453 -r12657 --- branches/5.1.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12453) +++ branches/5.1.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12657) @@ -1,6 +1,6 @@ Conn =& $this->Application->GetADODBConnection(); + + if (defined('DEBUG_MODE') && DEBUG_MODE && $this->Application->IsAdmin()) { + // only has effect in admin, because on front-end phrases are translated in "Content Mode" + $this->_editMissing = defined('DBG_PHRASES') && DBG_PHRASES; + } + + // now we use admin phrase editing template even on front-end + $this->_phraseEditTemplate = 'regional/phrases_edit'; } + /** + * Sets phrase editing mode, that corresponds current editing mode + * + */ + function setPhraseEditing() + { + if (!$this->Application->IsAdmin() && (EDITING_MODE == EDITING_MODE_CONTENT)) { + $this->_editExisting = true; + $this->_editMissing = true; + $this->_simpleEditingMode = true; + $this->_translateHtmlTag = 'span'; + } + } + function Init($prefix, $special = '') { if (constOn('IS_INSTALL')) { @@ -62,11 +128,13 @@ function GetCachedIds() { - $query = sprintf("SELECT PhraseList, ConfigVariables FROM %s WHERE Template = %s", - TABLE_PREFIX.'PhraseCache', - $this->Conn->Qstr(md5($this->Application->GetVar('t').$this->Application->GetVar('m_theme').$this->Application->GetVar('m_lang')))); - $res = $this->Conn->GetRow($query); + $cache_key = md5($this->Application->GetVar('t') . $this->Application->GetVar('m_theme') . $this->Application->GetVar('m_lang')); + $sql = 'SELECT PhraseList, ConfigVariables + FROM ' . TABLE_PREFIX . 'PhraseCache + WHERE Template = ' . $this->Conn->qstr($cache_key); + $res = $this->Conn->GetRow($sql); + if ($res && $res['ConfigVariables']) { $this->Application->OriginalConfigCacheIds = explode(',', $res['ConfigVariables']); $this->Application->ConfigCacheIds = $this->Application->OriginalConfigCacheIds; @@ -77,24 +145,30 @@ function LoadPhrases($ids) { - if ( !is_array($ids) || !implode('', $ids) ) return; - $query = sprintf("SELECT Translation,UPPER(Phrase) AS Phrase FROM %s WHERE LanguageId = %s AND PhraseId IN (%s)", - TABLE_PREFIX.'Phrase', - $this->LanguageId, - join(',', $ids)); - $this->Phrases = $this->Conn->GetCol($query,'Phrase'); + if ( !is_array($ids) || !implode('', $ids) ) { + return; + } + + $sql = 'SELECT Translation, UPPER(Phrase) AS Phrase + FROM ' . TABLE_PREFIX . 'Phrase + WHERE (LanguageId = ' . $this->LanguageId . ') AND PhraseId IN (' . implode(',', $ids) . ')'; + $this->Phrases = $this->Conn->GetCol($sql, 'Phrase'); + /*foreach($phrases as $phrase => $tanslation) { $this->AddCachedPhrase(mb_strtoupper($phrase), $tanslation); }*/ + $this->Ids = $ids; $this->OriginalIds = $ids; } - function AddCachedPhrase($label, $value) + function AddCachedPhrase($label, $value, $allow_editing = true) { - $label = mb_strtoupper($label); - $this->Phrases[$label] = $value; + // uppercase phrase name for cases, when this method is called outside this class + $cache_key = ($allow_editing ? '' : 'NE:') . mb_strtoupper($label); + + $this->Phrases[$cache_key] = $value; } function NeedsCacheUpdate() @@ -125,11 +199,13 @@ } } - function GetPhrase($label) + function GetPhrase($label, $allow_editing = true) { - if (!isset($this->LanguageId)) return 'impossible case'; - //actually possible when custom field contains references to language labels and its being rebuilt in OnAfterConfigRead - //which is triggered by Sections rebuild, which in turn read all the configs and all of that happens BEFORE seeting the language... + if (!isset($this->LanguageId)) { + //actually possible when custom field contains references to language labels and its being rebuilt in OnAfterConfigRead + //which is triggered by Sections rebuild, which in turn read all the configs and all of that happens BEFORE seeting the language... + return 'impossible case'; + } // cut exclamation marks - depricated form of passing phrase name from templates $label = preg_replace('/^!(.*)!$/', '\\1', $label); @@ -140,81 +216,64 @@ $original_label = $label; $label = mb_strtoupper($label); - if(isset($this->Phrases[$label])) { - $translated_label = $this->Phrases[$label]; - // debug mode is checked directly to improve performance - if (defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_PHRASES_HIGHLIGHT')) { - if (!$this->Application->isDebugMode()) return $translated_label; - if ($this->Application->IsAdmin()) { - $sql = 'SELECT Module - FROM '.TABLE_PREFIX.'Phrase - WHERE (LanguageId = '.$this->LanguageId.') AND (Phrase = '.$this->Conn->qstr($label).')'; - $this->Application->Debugger->appendHTML('Phrase: '.$label.'; Module: '.$this->Conn->GetOne($sql).''); -// $translated_label = $translated_label.' [m: '.$this->Conn->GetOne($sql).'; l: '.$label.']'; - } - else { - // highlight text created via translated phrase (used to detect if text on screen is phrase or not) - $translated_label = ''.$translated_label.' '.$original_label.''; - } + $cache_key = ($allow_editing ? '' : 'NE:') . $label; - } + if (array_key_exists($cache_key, $this->Phrases)) { + $translated_label = $this->Phrases[$cache_key]; - if (defined('DEBUG_MODE') && DEBUG_MODE && - (($this->Application->IsAdmin() && constOn('DBG_PHRASES_EDIT_ADMIN')) || (!$this->Application->IsAdmin() && constOn('DBG_PHRASES_EDIT_FRONT')) ) ) { + if ($this->_editExisting && $allow_editing && !array_key_exists($label, $this->_missingPhrases)) { // option to change translation for Labels - list($edit_tpl, $index_file) = $this->Application->IsAdmin() ? Array('regional/phrases_edit', 'index.php') : Array('phrases_edit', 'index.php'); + $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPrepareUpdate\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; + $translated_label = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Edit translation">' . $translated_label . '_translateHtmlTag . '>'; - if ($this->Application->IsAdmin() && $this->Application->ConfigValue('UsePopups')) { - // link to popup when using popups (only in admin) - $edit_url = 'javascript:translate_phrase(\''.addslashes($translated_label).'\', \''.$edit_tpl.'\');'; + if ($this->fromTag) { + $translated_label = $this->escapeTagReserved($translated_label); } - else { - // direct link, when not using popups OR on frontend - $edit_url = $this->Application->HREF($edit_tpl,'',Array('m_opener'=>'d','phrases_label'=>$original_label,'phrases_event'=>'OnPrepareUpdate', 'pass'=>'all,phrases'), $index_file ); - } - $translated_label = '!'.$translated_label.'!'; } return $translated_label; } - $this->LoadPhraseByLabel($label, $original_label); - return $this->GetPhrase($label); + $this->LoadPhraseByLabel($label, $original_label, $allow_editing); + + return $this->GetPhrase($label, $allow_editing); } - function LoadPhraseByLabel($label, $original_label) + function LoadPhraseByLabel($label, $original_label, $allow_editing = true) { - $query = sprintf("SELECT PhraseId, Translation FROM %s WHERE LanguageId = %s AND UPPER(Phrase) = UPPER(%s)", - TABLE_PREFIX.'Phrase', - $this->LanguageId, - $this->Conn->qstr($label)); - $res = $this->Conn->GetRow($query); - if ($res === false || count($res) == 0) - { - $translation = '!'.$label.'!'; - if($this->Application->isDebugMode() && constOn('DBG_PHRASES')) { - list($edit_tpl, $index_file) = $this->Application->IsAdmin() ? Array('regional/phrases_edit', 'index.php') : Array('phrases_edit', 'index.php'); + // bug: MySQL don't use index on Phrase column, when function is used on it's value (e.g. UPPER, like in this case) + $sql = 'SELECT PhraseId, Translation + FROM ' . TABLE_PREFIX . 'Phrase + WHERE (LanguageId = ' . $this->LanguageId . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')'; + $res = $this->Conn->GetRow($sql); - if ($this->Application->IsAdmin() && $this->Application->ConfigValue('UsePopups')) { - // link to popup when using popups (only in admin) - $edit_url = 'javascript:translate_phrase(\''.addslashes($original_label).'\', \''.$edit_tpl.'\');'; + if ($res === false || count($res) == 0) { + $translation = '!' . $label . '!'; + + if ($this->_editMissing && $allow_editing) { + $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnNew\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});'; + $translation = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Translate">!' . $label . '!_translateHtmlTag . '>'; + + if ($this->fromTag) { + $translation = $this->escapeTagReserved($translation); } - else { - // direct link, when not using popups OR on frontend - $edit_url = $this->Application->HREF($edit_tpl,'',Array('m_opener'=>'d','phrases_label'=>$original_label,'phrases_event'=>'OnNew', 'pass'=>'all,phrases'), $index_file ); - } - $translation = '!'.$label.'!'; - if($this->fromTag) $translation = $this->escapeTagReserved($translation); + $this->_missingPhrases[$label] = true; // add as key for faster accessing } - $this->AddCachedPhrase($label, $translation); //add it as already cached, as long as we dont need to cache not found phrase + + // add it as already cached, as long as we dont need to cache not found phrase + $this->AddCachedPhrase($label, $translation, $allow_editing); + return false; } - $this->Phrases[$label] = $res['Translation']; + $cache_key = ($allow_editing ? '' : 'NE:') . $label; + $this->Phrases[$cache_key] = $res['Translation']; + array_push($this->Ids, $res['PhraseId']); - $this->Ids = array_unique($this->Ids); //just to make sure + $this->Ids = array_unique($this->Ids); // just to make sure + return true; } @@ -242,23 +301,29 @@ * @return string * @access public */ - function ReplaceLanguageTags($text,$forse_escaping=null) + function ReplaceLanguageTags($text, $forse_escaping = null) { $this->fromTag = true; - if( isset($forse_escaping) ) $this->fromTag = $forse_escaping; + if( isset($forse_escaping) ) { + $this->fromTag = $forse_escaping; + } + preg_match_all("(!(la|lu)[^!]+!)", $text, $res, PREG_PATTERN_ORDER); $language_tags = $res[0]; - uasort($language_tags, Array(&$this, 'CmpParams') ); + uasort($language_tags, Array(&$this, 'CmpParams')); - $values = Array(); $i = 0; + $values = Array(); + foreach ($language_tags as $label) { array_push($values, $this->GetPhrase($label) ); //array_push($values, $this->Application->Phrase($label) ); $language_tags[$i] = '/' . $language_tags[$i] . '/'; $i++; } + $this->fromTag = false; + return preg_replace($language_tags, $values, $text); } @@ -276,7 +341,4 @@ return str_replace($reserved,$replacement,$text); } -} - - -?> \ No newline at end of file +} \ No newline at end of file Index: branches/5.1.x/core/units/general/libchart/classes/model/XYDataSet.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/model/XYDataSet.php (.../XYDataSet.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/model/XYDataSet.php (.../XYDataSet.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * Set of data in the form of (x, y) items. * @@ -52,5 +54,4 @@ public function getPointList() { return $this->pointList; } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon24_server_info.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_banlist.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/logs/change_logs/changes_formatter.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/logs/change_logs/changes_formatter.php (.../changes_formatter.php) (revision 12127) +++ branches/5.1.x/core/units/logs/change_logs/changes_formatter.php (.../changes_formatter.php) (revision 12657) @@ -1,6 +1,6 @@ $data) { - $fld_translation = $this->Application->Phrase('la_fld_'.$field); + $res = ''; + if (!$changes) { + return ; + } - // remove translation link (added in debug mode) - $fld_translation = preg_replace('/(.*?)<\/a>/', '\\2', $fld_translation); + foreach ($changes as $field => $data) { + $fld_translation = $this->Application->Phrase('la_fld_'.$field); - if ($fld_translation == '!'.strtoupper('la_fld_'.$field).'!') { - // when phrase is not translated use field name as label - $fld_translation = $field; - } + // remove translation link (added in debug mode) + $fld_translation = preg_replace('/(.*?)<\/a>/', '\\2', $fld_translation); - if (is_array($data) && isset($data['old']) && isset($data['new'])) { - $res .= "$fld_translation: {$data['old']} => {$data['new']}
    \n"; + if ($fld_translation == '!'.strtoupper('la_fld_'.$field).'!') { + // when phrase is not translated use field name as label + $fld_translation = $field; + } + + if (is_array($data) && isset($data['old']) && isset($data['new'])) { + $res .= "$fld_translation: {$data['old']} => {$data['new']}
    \n"; + } + else { + $res .= "$fld_translation: {$data['new']}
    \n"; + } } - else { - $res .= "$fld_translation: {$data['new']}
    \n"; - } + return $res; } - return $res; - } -} \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_search_log.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_style.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_pick.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/config/config_email.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/config/config_email.tpl (.../config_email.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/config/config_email.tpl (.../config_email.tpl) (revision 12657) @@ -7,43 +7,77 @@ -
    - @@ -53,11 +87,19 @@
    + + + Root + + + + + - + \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_manufacturer_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_language_disabled.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/modules/modules_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0); if ($object->Update()) { - $event->status = erSUCCESS; + $sql = 'UPDATE ' . TABLE_PREFIX . 'ImportScripts + SET Status = ' . ($event->Name == 'OnMassApprove' ? STATUS_ACTIVE : STATUS_DISABLED) . ' + WHERE Module = "' . $object->GetDBField('Name') . '"'; + $this->Conn->Query($sql); + + $event->status = erSUCCESS; $event->redirect_params = Array('opener' => 's'); //stay! } else { @@ -109,7 +116,7 @@ parent::OnAfterListQuery($event); $new_modules = $this->_getNewModules(); - if (!$new_modules) { + if (!$new_modules || $this->Application->RecallVar('user_id') != -1) { return ; } @@ -123,8 +130,10 @@ foreach ($new_modules as $module) { $module_record = Array ( 'Name' => $toolkit->getModuleName($module), - 'Loaded' => 0, + 'Path' => $module . '/', 'Version' => $toolkit->GetMaxModuleVersion($module), + 'Loaded' => 0, + 'BuildDate' => null, ); $object->addRecord($module_record); @@ -174,6 +183,4 @@ { return file_exists($folder . '/install.php') && file_exists($folder . '/install/install_schema.sql'); } - } - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/themes/themes_list.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/themes/themes_list.tpl (.../themes_list.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/themes/themes_list.tpl (.../themes_list.tpl) (revision 12657) @@ -14,7 +14,7 @@ } var a_toolbar = new ToolBar(); - a_toolbar.AddButton( new ToolBarButton('new_theme', '::', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { std_precreate_item('theme', 'themes/themes_edit') } ) ); @@ -28,12 +28,12 @@ a_toolbar.AddButton( new ToolBarSeparator('sep1') ); - a_toolbar.AddButton( new ToolBarButton('primary_theme', '::', function() { + a_toolbar.AddButton( new ToolBarButton('setprimary', '', function() { submit_event('theme','OnSetPrimary'); } ) ); - a_toolbar.AddButton( new ToolBarButton('rescan_themes', '::', function() { + a_toolbar.AddButton( new ToolBarButton('refresh', '::', function() { submit_event('adm', 'OnRebuildThemes'); } ) ); @@ -56,7 +56,7 @@ \ No newline at end of file Index: branches/5.1.x/core/units/relationship/relationship_tp.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/relationship/relationship_tp.php (.../relationship_tp.php) (revision 12127) +++ branches/5.1.x/core/units/relationship/relationship_tp.php (.../relationship_tp.php) (revision 12657) @@ -1,6 +1,6 @@ _language =& $this->Application->recallObject('lang.current'); - /* @var $lang kDBItem */ - - $this->_decimalSeparator = $this->_language->GetDBField('DecimalPoint'); - $this->_thousandsSeparator = $this->_language->GetDBField('ThousandSep'); - } - - function InitHelper($min_field, $max_field, $default_values, $default_start_value = null) - { - $this->min_field = $min_field; - $this->max_field = $max_field; - $this->default_values = $default_values; - - if (isset($default_start_value)) { - $this->defaultStartValue = $default_start_value; - } - } - - /** - * Converts number to operatable form - * - * @param string $value - * @return float - */ - function _parseNumber($value) - { - $value = str_replace($this->_thousandsSeparator, '', $value); - $value = str_replace($this->_decimalSeparator, '.', $value); - - return $value; - } - - /** - * Returns brackets from form with all numbers parsed - * - * @param kEvent $event - * @return Array - */ - function getBrackets(&$event) - { - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - - return $this->parseBrackets($items_info); - } - - function parseBrackets($brackets) - { - if (!$brackets) { - return $brackets; - } - - foreach ($brackets as $id => $field_values) { - if (strlen($brackets[$id][$this->min_field])) { - $brackets[$id][$this->min_field] = (float)$this->_parseNumber($brackets[$id][$this->min_field]); - } - - if (strlen($brackets[$id][$this->max_field])) { - $brackets[$id][$this->max_field] = (float)$this->_parseNumber($brackets[$id][$this->max_field]); - } - } - - return $brackets; - } - - /** - * Formats given brackets and sets them back to request - * - * @param kEvent $event - * @param Array $brackets - */ - function setBrackets(&$event, $brackets) - { - $brackets = $this->formatBrackets($brackets); - - $this->Application->SetVar($event->getPrefixSpecial(true), $brackets); - } - - function formatBrackets($brackets) - { - if (!$brackets) { - return $brackets; - } - - foreach ($brackets as $id => $field_values) { - if (strlen($brackets[$id][$this->min_field])) { - $brackets[$id][$this->min_field] = $this->_language->formatNumber($brackets[$id][$this->min_field]); - } - - if (strlen($brackets[$id][$this->max_field])) { - $brackets[$id][$this->max_field] = $this->_language->formatNumber($brackets[$id][$this->max_field]); - } - } - - return $brackets; - } - - /** - * Adds 5 more empty brackets to brackets - * - * @param kEvent $event - */ - function OnMoreBrackets(&$event) - { - $field_values = $this->getBrackets($event); - - $object =& $event->getObject(); - - foreach($field_values as $id => $record) - { - if($record[$this->max_field] == '∞') $field_values[$id][$this->max_field] = -1; - } - - $new_id = (int)$this->Conn->GetOne('SELECT MIN('.$object->IDField.') FROM '.$object->TableName); - if($new_id > 0) $new_id = 0; - do - { - $new_id--; - }while( $this->arraySearch($field_values, $object->IDField, $new_id) ); - - - $last_max_qty = $this->Conn->GetOne('SELECT MAX('.$this->max_field.') FROM '.$object->TableName); - $min_qty = $this->Conn->GetOne('SELECT MIN('.$this->max_field.') FROM '.$object->TableName); - - if($min_qty == -1) $last_max_qty = -1; - if(!$last_max_qty) $last_max_qty = $this->defaultStartValue; - - - for($i = $new_id; $i > $new_id - 5; $i--) - { - $field_values[$i][$object->IDField] = $i; - $field_values[$i][$this->min_field] = ($i == $new_id-4 && $last_max_qty != -1) ? $last_max_qty : ''; - $field_values[$i][$this->max_field] = ($i == $new_id-4 && $last_max_qty != -1) ? -1 : ''; - $field_values[$i] = array_merge_recursive2($field_values[$i], $this->default_values); - } - - $event->CallSubEvent('OnPreSaveBrackets'); - - $this->setBrackets($event, $field_values); - } - - /** - * Adds infinity bracket - * - * @param kEvent $event - */ - function OnInfinity(&$event) - { - $object =& $event->getObject(); - $infinite_exists = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$object->TableName.' WHERE '.$this->max_field.' = -1'); - $field_values = $this->getBrackets($event); - /*if(is_array($field_values)) - { - foreach($field_values as $values) - { - $infinite_exists = $infinite_exists || ($values[$this->max_field] == -1); - } - }*/ - - if ($infinite_exists == 0) { - reset($field_values); - $last_bracket = end($field_values); - $new_id = (int)$this->Conn->GetOne('SELECT MIN('.$object->IDField.') FROM '.$object->TableName); - - $brackets_exist = (int)$this->Conn->GetOne('SELECT COUNT(*) FROM '.$object->TableName); - - if($new_id > 0) $new_id = 0; - do - { - $new_id--; - }while( $this->arraySearch($field_values, $object->IDField, $new_id) ); - - $infinite_bracket[$object->IDField] = $new_id; - $infinite_bracket[$this->min_field] = ($brackets_exist > 0) ? $last_bracket[$this->max_field] : $this->defaultStartValue; - $infinite_bracket[$this->max_field] = '-1'; - $infinite_bracket = array_merge_recursive2($infinite_bracket, $this->default_values); - - $field_values[$new_id] = $infinite_bracket; - reset($field_values); - - $this->setBrackets($event, $field_values); - } - } - - /** - * Saves brackets to database - * - * @param kEvent $event - */ - function OnPreSaveBrackets(&$event) - { - $items_info = $this->getBrackets($event); - if ($items_info) { - $object =& $event->getObject(); - - $linked_info = $object->getLinkedInfo(); - $stored_ids = $this->Conn->GetCol('SELECT '.$object->IDField.' FROM '.$object->TableName.' WHERE '.$linked_info['ForeignKey'].' = '.$linked_info['ParentId']); - - uasort($items_info, Array(&$this, 'compareBrackets') ); - - foreach ($items_info as $item_id => $values) { - - if (in_array($item_id, $stored_ids)) { //if it's already exist - $object->SetDefaultValues(); - $object->Load($item_id); - $object->SetFieldsFromHash($values); - if (!$object->Validate()) { - unset($stored_ids[array_search($item_id, $stored_ids)]); - $event->redirect = false; - continue; - } - if( $object->Update($item_id) ) - { - $event->status = erSUCCESS; - } - else - { - $event->status = erFAIL; - $event->redirect = false; - break; - } - unset( $stored_ids[ array_search($item_id, $stored_ids) ] ); - } - else { - $object->SetDefaultValues(); - $object->SetFieldsFromHash($values); - $object->SetDBField($linked_info['ForeignKey'], $linked_info['ParentId']); - - if( $object->Create() ) - { - $object->setTempID(); - $event->status = erSUCCESS; - } - } - } - - // delete - foreach ($stored_ids as $stored_id) - { - $this->Conn->Query('DELETE FROM '.$object->TableName.' WHERE '.$object->IDField.' = '.$stored_id); - } - - } - } - - function arrangeBrackets(&$event) - { - $object =& $event->getObject(); - - $temp = $this->getBrackets($event); - - foreach($temp as $id => $record) - { - if( $record[$this->max_field] == '∞' ) - { - $temp[$id][$this->max_field] = -1; - } - } - - $temp_orig = $temp; - reset($temp); - if( is_array($temp) ) - { - // array to store max values (2nd column) - $end_values = Array(); - - // get minimal value of Min - $first_elem = current($temp); - $start = $first_elem[$this->min_field]; - if (!strlen($start)) { - $start = $this->defaultStartValue; - } - - foreach($temp as $id => $record) - { - if( - // MAX is less than start - ($record[$this->max_field] <= $start && $record[$this->max_field] != -1) || - // Max is empty - !strlen($record[$this->max_field]) || - // Max already defined in $end_values - (array_search($record[$this->max_field], $end_values) !== false) - ) { // then delete from brackets list - unset($temp[$id]); - } - else { // this is when ok - add to end_values list - $end_values[] = $record[$this->max_field]; - } - } - - // sort brackets by 2nd column (Max values) - uasort($temp, Array(&$this, 'compareBrackets') ); - reset($temp); - $first_item = each($temp); - $first_item_key = $first_item['key']; - - $linked_info = $object->getLinkedInfo(); - $sql = 'SELECT %s FROM %s WHERE %s = %s'; - $ids = $this->Conn->GetCol( sprintf($sql, $object->IDField, $object->TableName, $linked_info['ForeignKey'], $linked_info['ParentId']) ); - if( is_array($ids) ) - { - usort($ids, Array(&$this, 'sortBracketIDs') ); - } - -// $min_id = min( min($ids) - 1, -1 ); - - foreach($temp as $key => $record) - { - $temp[$key][$this->min_field] = $start; - $start = $temp[$key][$this->max_field]; - } - } - - $this->setBrackets($event, $temp); - - return $temp; - } - - function compareBrackets($bracket1, $bracket2) // ap_bracket_comp - { - $bracket1_min = $bracket1[$this->min_field]; - $bracket1_max = $bracket1[$this->max_field]; - - $bracket2_min = $bracket2[$this->min_field]; - $bracket2_max = $bracket2[$this->max_field]; - - // limits - if( ($bracket1_min != '') && ($bracket1_max == '') && ($bracket2_min != '') && ($bracket2_max != '') ) return 1; - if( ($bracket1_min != '') && ($bracket1_max == '') && ($bracket2_min == '') && ($bracket2_max == '') ) return -1; - if( ($bracket1_max == '') && ($bracket2_max != '') ) return 1; - if( ($bracket1_max != '') && ($bracket2_max == '') ) return -1; - - - if( ( ($bracket1_max > $bracket2_max) && ($bracket2_max != -1) ) || ( ($bracket1_max == -1) && ($bracket2_max != -1) ) ) - { - return 1; - } - elseif( ($bracket1_max < $bracket2_max) || ( ($bracket2_max == -1) && ($bracket1_max != -1) ) ) - { - return -1; - } - else - { - return 0; - } - } - - function sortBracketIDs($first_id, $second_id) // pr_bracket_id_sort - { - $first_abs = abs($first_id); - $second_abs = abs($second_id); - - $first_sign = ($first_id == 0) ? 0 : $first_id / $first_abs; - $second_sign = ($second_id == 0) ? 0 : $second_id / $second_abs; - - if($first_sign != $second_sign) - { - if($first_id > $second_id) - { - $bigger =& $first_abs; - $smaller =& $second_abs; - } - else - { - $bigger =& $second_abs; - $smaller =& $first_abs; - } - $smaller = $bigger + $smaller; - } - - return ($first_abs > $second_abs) ? 1 : ($first_abs < $second_abs ? -1 : 0); - } - - /** - * Searches through submitted grid data to find record with specific value in specific field - * - * @param Array $records // grid data from REQUEST - * @param string $field - * @param string $value - * @return bool - */ - function arraySearch($records, $field, $value) // check_array - { - foreach ($records as $record) - { - if ($record[$field] == $value) - { - return true; - } - } - return false; - } - - /** - * Replate infinity mark with -1 before saving to db - * - * @param kEvent $event - */ - function replaceInfinity(&$event) - { - $object =& $event->getObject(); - if($object->GetDBField($this->max_field) == '∞') $object->SetDBField($this->max_field, -1); - } - - } - -?> \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon24_site.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_form_submission_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/fck/fck_eh.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12127) +++ branches/5.1.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12657) @@ -1,6 +1,6 @@ array('self' => true), - 'OnLoadResources' => array('self' => true), - 'OnRenameFile' => array('self' => true), - 'OnDeleteFiles' => array('self' => true), - 'OnGetFoldersFilesList' => array('self' => true), - 'OnCreateFolder' => array('self' => true), - 'OnUploadFile' => array('self' => true), - ); - - $this->permMapping = array_merge($this->permMapping, $permissions); - } - /** * Checks permissions of user * @@ -40,6 +24,7 @@ function CheckPermission(&$event) { if ($this->Application->LoggedIn() && $this->Application->IsAdmin()) { + // this limits all event execution only to logged-in users in admin return true; } @@ -98,106 +83,106 @@ } - function OnRenameFile(&$event) - { - $event->status = erSTOP; - $old_name = $this->Application->GetVar('old_name'); - $new_name = $this->Application->GetVar('new_name'); - $folder = $this->Application->GetVar('folder'); - $sServerDir = WRITEABLE.'/user_files/'.$folder.'/'; + function OnRenameFile(&$event) + { + $event->status = erSTOP; + $old_name = $this->Application->GetVar('old_name'); + $new_name = $this->Application->GetVar('new_name'); + $folder = $this->Application->GetVar('folder'); + $sServerDir = WRITEABLE . '/user_files/' . $folder . '/'; - if (!file_exists($sServerDir.$old_name) || !is_file($sServerDir.$old_name)) { - echo 204; - return; - } + if (!file_exists($sServerDir.$old_name) || !is_file($sServerDir.$old_name)) { + echo 204; + return; + } - $fck_helper =& $this->Application->recallObject('FCKHelper'); - /* @var fck_helper fckFCKHelper*/ + $fck_helper =& $this->Application->recallObject('FCKHelper'); + /* @var fck_helper fckFCKHelper*/ - if (!$fck_helper->IsAllowedExtension($folder, $new_name)) { - echo 203; - return; - } + if (!$fck_helper->IsAllowedExtension($folder, $new_name)) { + echo 203; + return; + } - if (!rename($sServerDir.$old_name,$sServerDir.$new_name)) { -// echo $sServerDir.$old_name.' -> '.$sServerDir.$new_name; - echo 205; - return; + if (!rename($sServerDir.$old_name,$sServerDir.$new_name)) { + // echo $sServerDir.$old_name.' -> '.$sServerDir.$new_name; + echo 205; + return; + } + + echo '0'; } - echo '0'; - } + function OnDeleteFiles(&$event) + { + $event->status = erSTOP; + $files = trim($this->Application->GetVar('files'),'|'); + // echo $files; + $a_files = explode('|', $files); + $folder = $this->Application->GetVar('folder'); + $sServerDir = WRITEABLE . '/user_files/' . $folder . '/'; - function OnDeleteFiles(&$event) - { - $event->status = erSTOP; - $files = trim($this->Application->GetVar('files'),'|'); -// echo $files; - $a_files = explode('|', $files); - $folder = $this->Application->GetVar('folder'); - $sServerDir = WRITEABLE.'/user_files/'.$folder.'/'; + foreach ($a_files AS $file) { + @unlink($sServerDir.$file); + } - foreach ($a_files AS $file) { - @unlink($sServerDir.$file); + // print_r($a_files); } -// print_r($a_files); - } + function OnGetFoldersFilesList(&$event) + { + $this->CreateXmlHeader(); + $fck_helper =& $this->Application->recallObject('FCKHelper'); + /* @var fck_helper fckFCKHelper*/ - function OnGetFoldersFilesList(&$event) - { - $this->CreateXmlHeader(); - $fck_helper =& $this->Application->recallObject('FCKHelper'); - /* @var fck_helper fckFCKHelper*/ + $ret = ''."\n" ; + $ret .= ""."\n"; + $ret .= $fck_helper->PrintFolders(); + $ret .= $fck_helper->PrintFiles(); + $ret .= ""."\n"; + echo $ret; + exit; + } - $ret = ''."\n" ; - $ret .= ""."\n"; - $ret .= $fck_helper->PrintFolders(); - $ret .= $fck_helper->PrintFiles(); - $ret .= ""."\n"; - echo $ret; - exit; - } + function OnCreateFolder(&$event) + { + $event->status = erSTOP; - function OnCreateFolder(&$event) - { - $event->status = erSTOP; + $new_folder = $this->Application->GetVar('new_folder'); + $current_folder = $this->Application->GetVar('current_folder'); + $folderPath = WRITEABLE . '/user_files' . '/' . $current_folder . "/" . $new_folder; + if ( file_exists( $folderPath ) && is_dir($folderPath)) { + echo "101"; + } - $new_folder = $this->Application->GetVar('new_folder'); - $current_folder = $this->Application->GetVar('current_folder'); - $folderPath = WRITEABLE.'/user_files'.'/'.$current_folder."/".$new_folder; - if ( file_exists( $folderPath ) && is_dir($folderPath)) { - echo "101"; + if ( !file_exists( $folderPath ) ) + { + // Turn off all error reporting. + error_reporting( 0 ) ; + // Enable error tracking to catch the error. + ini_set( 'track_errors', '1' ) ; + // To create the folder with 0777 permissions, we need to set umask to zero. + $oldumask = umask(0) ; + mkdir( $folderPath, 0777 ) ; + umask( $oldumask ) ; + $sErrorMsg = $php_errormsg ; + // Restore the configurations. + ini_restore( 'track_errors' ) ; + ini_restore( 'error_reporting' ) ; + if ($sErrorMsg) + echo $sErrorMsg ; + else + echo '0'; + } } - if ( !file_exists( $folderPath ) ) + function OnUploadFile(&$event) { - // Turn off all error reporting. - error_reporting( 0 ) ; - // Enable error tracking to catch the error. - ini_set( 'track_errors', '1' ) ; - // To create the folder with 0777 permissions, we need to set umask to zero. - $oldumask = umask(0) ; - mkdir( $folderPath, 0777 ) ; - umask( $oldumask ) ; - $sErrorMsg = $php_errormsg ; - // Restore the configurations. - ini_restore( 'track_errors' ) ; - ini_restore( 'error_reporting' ) ; - if ($sErrorMsg) - echo $sErrorMsg ; - else - echo '0'; + $event->status = erSTOP; + $fck_helper =& $this->Application->recallObject('FCKHelper'); + /* @var fck_helper fckFCKHelper*/ + $fck_helper->UploadFile(); } - } - - function OnUploadFile(&$event) - { - $event->status = erSTOP; - $fck_helper =& $this->Application->recallObject('FCKHelper'); - /* @var fck_helper fckFCKHelper*/ - $fck_helper->UploadFile(); - } -} + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_theme.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_group_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/tab_back3.jpg =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_more_brackets.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r12453 -r12657 --- branches/5.1.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12453) +++ branches/5.1.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12657) @@ -1,6 +1,6 @@ Application->ConfigValue('UsePopups') || $this->Application->GetVar('_force_popup'); + if ($this->Application->GetVar('_force_popup')) { + return true; + } + + $use_popups = (int)$this->Application->ConfigValue('UsePopups'); + + if (array_key_exists('mode', $params)) { + $mode_mapping = Array ('popup' => 1, 'modal' => 2); + return $use_popups == $mode_mapping[ $params['mode'] ]; + } + + return $use_popups; } function UseToolbarLabels($params) @@ -805,68 +824,10 @@ function AdminSkin($params) { - static $style; - if (!isset($style)) { - $style = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1'); - } + $skin_helper =& $this->Application->recallObject('SkinHelper'); + /* @var $skin_helper SkinHelper */ - $css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH. DIRECTORY_SEPARATOR . 'kernel') . DIRECTORY_SEPARATOR . 'user_files'; - $css_url = $this->Application->BaseURL(defined('WRITEBALE_BASE') ? str_replace(DIRECTORY_SEPARATOR, '/', WRITEBALE_BASE) : '/kernel') . 'user_files/'; - - $type = array_key_exists('type', $params) ? $params['type'] : false; - if ($type == 'logo') { - $type = 'Logo'; - } - - if ($type == 'Logo' || $type == 'LogoBottom' || $type == 'LogoLogin') { - return $style[$type] ? $css_url.$style[$type] : ''; - } - - $last_compiled = $style['LastCompiled']; - - $style_name = mb_strtolower( $style['Name'] ); - - if( file_exists($css_path.'/'.'admin-'.$style_name.'-'.$last_compiled.'.css') ) - { - $ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css'; - - } - else - { - // search for previously compiled stylesheet - $last_compiled = 0; - if( $dh = opendir($css_path) ) - { - while( ($file = readdir($dh)) !== false ) - { - if( preg_match('/admin-(.*)-([\d]+).css/', $file, $rets) ) - { - if( $rets[1] == $style_name && $rets[2] > $last_compiled ) $last_compiled = $rets[2]; - } - } - closedir($dh); - } - if ($last_compiled) { - // found - $ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css'; - } - else { - // not found (try to compile on the fly) - $object =& $this->Application->recallObject('skin.-item', null, Array ('skip_autoload' => true)); - /* @var $object kDBItem */ - - $skin_eh =& $this->Application->recallObject('skin_EventHandler'); - /* @var $skin_eh SkinEventHandler */ - - $object->Load(1, 'IsPrimary'); - $skin_eh->Compile($object); - $ret = $css_url.'admin-'.$style_name.'-'.adodb_mktime().'.css'; - } - } - - if (isset($params['file_only'])) return $ret; - - return ''; + return $skin_helper->AdminSkinTag($params); } function PrintCompileErrors($params) @@ -1148,6 +1109,65 @@ $this->Application->Phrases->LanguageId = $params['language_id']; $this->Application->Phrases->LoadPhrases( $this->Application->Caches['PhraseList'] ); } - } -?> \ No newline at end of file + /** + * Performs HTTP Authentification for administrative console + * + * @param Array $params + */ + function HTTPAuth($params) + { + if (!$this->Application->ConfigValue('UseHTTPAuth')) { + // http authentification not required + return true; + } + + $super_admin_ips = defined('SA_IP') ? SA_IP : false; + $auth_bypass_ips = $this->Application->ConfigValue('HTTPAuthBypassIPs'); + + if (($auth_bypass_ips && ipMatch($auth_bypass_ips)) || ($super_admin_ips && ipMatch($super_admin_ips))) { + // user ip is in ip bypass list + return true; + } + + if (!array_key_exists('PHP_AUTH_USER', $_SERVER)) { + // ask user to authentificate, when not authentificated before + return $this->_httpAuthentificate(); + } + else { + // validate user credentials (browsers remembers user/password + // and sends them each time page is visited, so no need to save + // authentification result in session) + if ($this->Application->ConfigValue('HTTPAuthUsername') != $_SERVER['PHP_AUTH_USER']) { + // incorrect username + return $this->_httpAuthentificate(); + } + + $password_formatter =& $this->Application->recallObject('kPasswordFormatter'); + /* @var $password_formatter kPasswordFormatter */ + + $password = $password_formatter->EncryptPassword($_SERVER['PHP_AUTH_PW'], 'b38'); + + if ($this->Application->ConfigValue('HTTPAuthPassword') != $password) { + // incorrect password + return $this->_httpAuthentificate(); + } + } + + return true; + } + + /** + * Ask user to authentificate + * + * @return false + */ + function _httpAuthentificate() + { + $realm = strip_tags( $this->Application->ConfigValue('Site_Name') ); + header('WWW-Authenticate: Basic realm="' . $realm . '"'); + header('HTTP/1.0 401 Unauthorized'); + + return false; + } + } \ No newline at end of file Index: branches/5.1.x/core/units/selectors/selectors_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/selectors/selectors_event_handler.php (.../selectors_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/selectors/selectors_event_handler.php (.../selectors_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/system/cache/dummy =================================================================== diff -u -N --- branches/5.1.x/system/cache/dummy (revision 12127) +++ branches/5.1.x/system/cache/dummy (revision 0) @@ -1 +0,0 @@ -dummy \ No newline at end of file Index: branches/5.1.x/core/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module)); $object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section)); + if (!$this->Application->ConfigValue('AllowAdminConsoleInterfaceChange')) { + $object->addFilter('interface_change_filter', '%1$s.VariableName <> "AdminConsoleInterface"'); + } + if (defined('IS_INSTALL') && IS_INSTALL) { $object->addFilter('install_filter', 'ca.Install = 1'); } @@ -57,8 +61,23 @@ */ function OnBeforeItemUpdate(&$event) { + static $default_field_options = null; + $object =& $event->getObject(); + /* @var $object kDBItem */ + // ability to validate each configuration variable separately + if (!isset($default_field_options)) { + $default_field_options = $object->GetFieldOptions('VariableValue'); + } + + $new_field_options = $default_field_options; + $validation = $object->GetDBField('Validation'); + if ($validation) { + $new_field_options = array_merge($new_field_options, unserialize($validation)); + } + $object->SetFieldOptions('VariableValue', $new_field_options); + // if password field is empty, then don't update if ($object->GetDBField('element_type') == 'password') { if (trim($object->GetDBField('VariableValue')) == '') { @@ -71,20 +90,25 @@ } } - $field_values = $this->Application->GetVar($event->getPrefixSpecial(true)); + $field_values = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - $state_country_hash = Array( - 'Comm_State' => 'Comm_Country', - 'Comm_Shipping_State' => 'Comm_Shipping_Country' - ); + $state_country_hash = Array ( + 'Comm_State' => 'Comm_Country', + 'Comm_Shipping_State' => 'Comm_Shipping_Country' + ); $field_name = $object->GetDBField('VariableName'); - if (isset($state_country_hash[$field_name])) { + if (array_key_exists($field_name, $state_country_hash)) { // if this is state field + $sql = 'SELECT VariableId + FROM ' . $this->Application->getUnitOption('conf', 'TableName') . ' + WHERE VariableName = "' . $state_country_hash[$field_name] . '"'; + $country_variable_id = $this->Conn->GetOne($sql); + $check_state = $object->GetDBField('VariableValue'); - $check_country = $field_values[ $state_country_hash[$field_name] ]['VariableValue']; + $check_country = $field_values[$country_variable_id]['VariableValue']; - if (!($check_country && $check_state)) { + if (!$check_country || !$check_state) { return true; } @@ -93,19 +117,20 @@ if ($state_iso !== false) { $object->SetDBField('VariableValue', $state_iso); } - else - { - $errormsgs = $this->Application->GetVar('errormsgs'); - $errors = !$errormsgs || !isset($errormsgs[$event->Prefix_Special]) ? Array() : $errormsgs[$event->Prefix_Special]; + else { + // selected state doesn't belong to selected country + $object->SetError('VariableValue', 'invalid_state', 'la_InvalidState'); + } + } - $errors[$field_name] = 'la_InvalidState'; - $errormsgs[$event->Prefix_Special] = $errors; + if ($object->GetDBField('VariableName') == 'AdminConsoleInterface') { + $can_change = $this->Application->ConfigValue('AllowAdminConsoleInterfaceChange'); - $this->Application->SetVar('errormsgs', $errormsgs); - $event->status = erFAIL; + if (($object->GetDBField('VariableValue') != $object->GetOriginalField('VariableValue')) && !$can_change) { + $object->SetError('VariableValue', 'not_allowed', 'la_error_NotAllowed'); } - } + } } /** @@ -116,13 +141,53 @@ function OnAfterItemUpdate(&$event) { $object =& $event->getObject(); + /* @var $object kDBItem */ + if ($object->GetDBField('element_type') == 'password') { if (trim($object->GetDBField('VariableValue')) == '') { $field_options = $object->GetFieldOptions('VariableValue'); unset($field_options['skip_empty']); $object->SetFieldOptions('VariableValue', $field_options); } } + + // allows to check if variable's value was changed now + $variable_name = $object->GetDBField('VariableName'); + $variable_value = $object->GetDBField('VariableValue'); + $watch_variables = Array ( + 'Require_AdminSSL', 'AdminSSL_URL', 'AdvancedUserManagement', + 'Site_Name', 'AdminConsoleInterface' + ); + + if (in_array($variable_name, $watch_variables)) { + $changed = $this->Application->GetVar($event->getPrefixSpecial() . '_changed', Array ()); + + if ($variable_value != $object->GetOriginalField('VariableValue')) { + $changed[] = $variable_name; + $this->Application->SetVar($event->getPrefixSpecial() . '_changed', $changed); + } + + switch ($variable_name) { + case 'Require_AdminSSL': + case 'AdminSSL_URL': + static $skin_deleted = false; + + if (in_array($variable_name, $changed) && !$skin_deleted) { + // when administrative console is moved to SSL mode, then delete skin + $skin_helper =& $this->Application->recallObject('SkinHelper'); + /* @var $skin_helper SkinHelper */ + + $skin_file = $skin_helper->getSkinPath(); + if (file_exists($skin_file)) { + unlink($skin_file); + } + + $skin_deleted = true; + } + break; + } + } + } /** @@ -133,56 +198,70 @@ function OnUpdate(&$event) { if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); // 1. save user selected module root category - $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); $new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue'); if ($new_category_id !== false) { unset($items_info['ModuleRootCategory']); - $this->Application->SetVar($event->getPrefixSpecial(true), $items_info); } - parent::OnUpdate($event); + $object =& $event->getObject( Array('skip_autoload' => true) ); + /* @var $object kDBItem */ - if ($event->status == erSUCCESS && $new_category_id !== false) { - // root category was submitted - $module = $this->Application->GetVar('module'); - $root_category_id = $this->Application->findModule('Name', $module, 'RootCat'); + if ($items_info) { + $has_error = false; + foreach ($items_info as $id => $field_values) { + $object->Clear(); // clear validation errors from previous variable + $object->Load($id); + $object->SetFieldsFromHash($field_values); - if ($root_category_id != $new_category_id) { - // root category differs from one in db - $fields_hash = Array('RootCat' => $new_category_id); - $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module)); + if (!$object->Update($id)) { + // don't stop when error found ! + $has_error = true; + } } + + $event->status = $has_error ? erFAIL : erSUCCESS; } - if ($event->status == erSUCCESS) { // reset cache - $refresh_sections = false; - if ($items_info) { - $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); + if ($event->status == erSUCCESS) { + if ($new_category_id !== false) { + // root category was submitted + $module = $this->Application->GetVar('module'); + $root_category_id = $this->Application->findModule('Name', $module, 'RootCat'); - $sql = 'SELECT ' . $id_field . ' - FROM ' . $table_name . ' - WHERE ' . $id_field . ' IN (' . implode(',', array_keys($items_info)) . ') AND (VariableName = "AdvancedUserManagement")'; - $refresh_sections = $this->Conn->GetCol($sql); + if ($root_category_id != $new_category_id) { + // root category differs from one in db + $fields_hash = Array('RootCat' => $new_category_id); + $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module)); + } } - if ($refresh_sections) { + // reset cache + $changed = $this->Application->GetVar($event->getPrefixSpecial() . '_changed', Array ()); + $require_refresh = Array ( + 'AdvancedUserManagement', 'Site_Name', 'AdminConsoleInterface' + ); + + $refresh_sections = array_intersect($require_refresh, $changed); + $require_full_refresh = Array ('Site_Name', 'AdminConsoleInterface'); + + if (array_intersect($require_full_refresh, $changed)) { + $event->SetRedirectParam('refresh_all', 1); + } elseif ($refresh_sections) { // reset sections too, because of AdvancedUserManagement $event->SetRedirectParam('refresh_tree', 1); } $this->Application->UnitConfigReader->ResetParsedData($refresh_sections ? true : false); } + elseif ($this->Application->GetVar('errors_' . $event->getPrefixSpecial())) { + // because we have list out there, and this is item + $this->Application->removeObject( $event->getPrefixSpecial() ); + } } - if ($this->Application->GetVar('errormsgs')) { - // because we have list out there, and this is item - $this->Application->removeObject($event->getPrefixSpecial()); - $event->redirect = false; - } - // keeps module and section in REQUEST to ensure, that last admin template will work $event->SetRedirectParam('module', $this->Application->GetVar('module')); $event->SetRedirectParam('section', $this->Application->GetVar('section')); @@ -223,8 +302,4 @@ $event->SetRedirectParam('opener', 'u'); } - } - - - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_currency_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_reviews.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_import_language_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/files/file_tp.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/files/file_tp.php (.../file_tp.php) (revision 12127) +++ branches/5.1.x/core/units/files/file_tp.php (.../file_tp.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_modify.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/utility/cache.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/cache.php (.../cache.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/cache.php (.../cache.php) (revision 12657) @@ -1,6 +1,6 @@ _filename = (defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache') . '/' . $filename; + $this->_filename = WRITEABLE . '/cache' . '/' . $filename; if (file_exists($this->_filename)) { $cache_data = unserialize(file_get_contents($this->_filename)); @@ -284,6 +286,4 @@ return $ret; } - } - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_usergroups.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/js/tree.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/tree.js (.../tree.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/tree.js (.../tree.js) (revision 12657) @@ -84,8 +84,8 @@ TreeItem.prototype.appendIcon = function (td) { img = document.createElement('img'); - img.style.width = '24px'; - img.style.height = '22px'; +// img.style.width = '24px'; +// img.style.height = '22px'; if (this.Icon.indexOf('http://') != -1) { img.src = this.Icon; } @@ -133,8 +133,11 @@ } else { // ensures, that click is made before AJAX request will be sent - if (res === true) { - // only in case of "true" is returned, used in catalog + var $res_type = Object.prototype.toString.call(res); + + if ((res === true) || ($res_type == '[object Object]')) { + // in case of "true" is returned, used in catalog + // in case of object (tree node) is returned, used in advanced view if (this.treeItem.isContainer()) { this.href = this.treeItem.locateFirstItem().Url; } @@ -145,7 +148,15 @@ if (!this.treeItem.Expanded && this.treeItem.isFolder()) { if (this.treeItem.folderClick()); } - this.treeItem.highLight(); + + if ($res_type == '[object Object]') { + // highlight returned tree node instead of clicked one + res.highLight(false); // don't expand such node + } + else { + this.treeItem.highLight(); + } + return false; } } @@ -167,7 +178,7 @@ TreeItem.prototype.display = function() { - this.Tr.style.display = is.ie ? 'block' : 'table-row'; + this.Tr.style.display = ''; // is.ie ? 'block' : 'table-row'; this.Displayed = true; var do_sub = TreeManager.isExpanded(this.Key); @@ -186,21 +197,29 @@ this.Displayed = false; } -TreeItem.prototype.highLight = function() +TreeItem.prototype.highLight = function($auto_expand) { - if (last_hightlighted) last_hightlighted.Tr.className = ''; + if ($auto_expand === undefined) { + $auto_expand = true; + } + + if (last_hightlighted) { + last_hightlighted.Tr.className = ''; + } + if (this.Children && this.Children.length > 0 && this.isContainer()) { - if (!this.Expanded) { + if (!this.Expanded && $auto_expand) { this.expand(); } - this.Children[0].highLight(); + + this.Children[0].highLight($auto_expand); return; } this.Tr.className = "highlighted"; last_hightlighted = this; last_highlighted_key = this.Key; - if (!this.Expanded) { + if (!this.Expanded && $auto_expand) { this.expand(); } } Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_settings_search.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/categories/categories_edit_relations.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/categories/categories_edit_relations.tpl (.../categories_edit_relations.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/categories/categories_edit_relations.tpl (.../categories_edit_relations.tpl) (revision 12657) @@ -35,7 +35,7 @@ a_toolbar.AddButton( new ToolBarSeparator('sep2') ); //Relations related: - a_toolbar.AddButton( new ToolBarButton('new_relation', '', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { openSelector('c-rel', '', 'TargetId', '950x600'); } ) ); Index: branches/5.1.x/core/admin_templates/img/icons/icon24_advanced_view.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_theme_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/logs/change_logs/change_log_list.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/logs/change_logs/change_log_list.tpl (.../change_log_list.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/logs/change_logs/change_log_list.tpl (.../change_log_list.tpl) (revision 12657) @@ -18,7 +18,7 @@ std_edit_item('change-log', 'logs/change_logs/change_log_edit'); } - a_toolbar.AddButton( new ToolBarButton('view_item', '::', edit) ); + a_toolbar.AddButton( new ToolBarButton('edit', '::', edit) ); a_toolbar.AddButton( new ToolBarSeparator('sep1') ); @@ -73,7 +73,7 @@ \ No newline at end of file Index: branches/5.1.x/core/units/general/cat_dbitem_export.php =================================================================== diff -u -N --- branches/5.1.x/core/units/general/cat_dbitem_export.php (revision 12127) +++ branches/5.1.x/core/units/general/cat_dbitem_export.php (revision 0) @@ -1,1444 +0,0 @@ -cacheTable = TABLE_PREFIX.'ImportCache'; - } - - /** - * Returns value from cache if found or false otherwise - * - * @param string $type - * @param int $key - * @return mixed - */ - function getFromCache($type, $key) - { - return getArrayValue($this->cache, $type, $key); - } - - /** - * Adds value to be cached - * - * @param string $type - * @param int $key - * @param mixed $value - */ - function addToCache($type, $key, $value, $is_new = true) - { -// if (!isset($this->cache[$type])) $this->cache[$type] = Array(); - $this->cache[$type][$key] = $value; - if ($is_new) { - $this->cacheStatus[$type][$key] = true; - } - } - - function storeCache($cache_types) - { - $cache_types = explode(',', $cache_types); - - $values_sql = ''; - foreach ($cache_types as $cache_type) { - $sql_mask = '('.$this->Conn->qstr($cache_type).',%s,%s),'; - $cache = getArrayValue($this->cacheStatus, $cache_type); - if (!$cache) $cache = Array(); - foreach ($cache as $var_name => $cache_status) { - $var_value = $this->cache[$cache_type][$var_name]; - $values_sql .= sprintf($sql_mask, $this->Conn->qstr($var_name), $this->Conn->qstr($var_value) ); - } - } - $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql); - if ($values_sql) { - $sql = 'INSERT INTO '.$this->cacheTable.'(`CacheName`,`VarName`,`VarValue`) VALUES '.$values_sql; - $this->Conn->Query($sql); - } - - } - - function loadCache() - { - $sql = 'SELECT * FROM '.$this->cacheTable; - $records = $this->Conn->Query($sql); - - $this->cache = Array(); - foreach ($records as $record) { - $this->addToCache($record['CacheName'], $record['VarName'], $record['VarValue'], false); - } - } - - /** - * Fill required fields with dummy values - * - * @param kEvent $event - */ - function fillRequiredFields(&$event, &$object, $set_status = false) - { - if ($object == $this->false) { - $object =& $event->getObject(); - } - - $has_empty = false; - $fields = array_keys($object->Fields); - foreach ($fields as $field_name) - { - $field_options =& $object->Fields[$field_name]; - if (isset($object->VirtualFields[$field_name]) || !getArrayValue($field_options, 'required') ) continue; - if ( $object->GetDBField($field_name) ) continue; - - $formatter_class = getArrayValue($field_options, 'formatter'); - if ($formatter_class) // not tested - { - $formatter =& $this->Application->recallObject($formatter_class); - $sample_value = $formatter->GetSample($field_name, $field_options, $object); - } - - $has_empty = true; - $object->SetField($field_name, isset($sample_value) && $sample_value ? $sample_value : 'no value'); - } - $object->UpdateFormattersSubFields(); - - if ($set_status && $has_empty) { - $object->SetDBField('Status', 0); - } - } - - /** - * Verifies that all user entered export params are correct - * - * @param kEvent $event - */ - function verifyOptions(&$event) - { - if ($this->Application->RecallVar($event->getPrefixSpecial().'_ForceNotValid')) - { - $this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 0); - return false; - } - - $this->fillRequiredFields($event, $this->false); - - $object =& $event->getObject(); - $cross_unique_fields = Array('FieldsSeparatedBy', 'FieldsEnclosedBy'); - if (($object->GetDBField('CategoryFormat') == 1) || ($event->Special == 'import')) // in one field - { - $object->setRequired('CategorySeparator', true); - $cross_unique_fields[] = 'CategorySeparator'; - } - - $ret = $object->Validate(); - - // check if cross unique fields has no same values - foreach ($cross_unique_fields as $field_index => $field_name) - { - if (getArrayValue($object->FieldErrors, $field_name, 'pseudo') == 'required') continue; - - $check_fields = $cross_unique_fields; - unset($check_fields[$field_index]); - - foreach ($check_fields as $check_field) - { - if ($object->GetDBField($field_name) == $object->GetDBField($check_field)) - { - $object->SetError($check_field, 'unique'); - } - } - } - - if ($event->Special == 'import') - { - $this->exportOptions = $this->loadOptions($event); - - $automatic_fields = ($object->GetDBField('FieldTitles') == 1); - $object->setRequired('ExportColumns', !$automatic_fields); - $category_prefix = '__CATEGORY__'; - if ( $automatic_fields && ($this->exportOptions['SkipFirstRow']) ) { - $this->openFile($event); - $this->exportOptions['ExportColumns'] = $this->readRecord(); - - if (!$this->exportOptions['ExportColumns']) { - $this->exportOptions['ExportColumns'] = Array (); - } - - $this->closeFile(); - - // remove additional (non-parseble columns) - foreach ($this->exportOptions['ExportColumns'] as $field_index => $field_name) { - if (!$this->validateField($field_name, $object)) { - unset($this->exportOptions['ExportColumns'][$field_index]); - } - } - $category_prefix = ''; - } - - // 1. check, that we have column definitions - if (!$this->exportOptions['ExportColumns']) { - $object->setError('ExportColumns', 'required'); - $ret = false; - } - else { - // 1.1. check that all required fields are present in imported file - $missing_columns = Array(); - foreach ($object->Fields as $field_name => $field_options) { - if ($object->skipField($field_name)) continue; - if (getArrayValue($field_options, 'required') && !in_array($field_name, $this->exportOptions['ExportColumns']) ) { - $missing_columns[] = $field_name; - $object->setError('ExportColumns', 'required_fields_missing', 'la_error_RequiredColumnsMissing'); - $ret = false; - } - } - - if (!$ret && $this->Application->isDebugMode()) { - $this->Application->Debugger->appendHTML('Missing required for import/export:'); - $this->Application->Debugger->dumpVars($missing_columns); - } - } - - - // 2. check, that we have only mixed category field or only separated category fields - $category_found['mixed'] = false; - $category_found['separated'] = false; - - foreach ($this->exportOptions['ExportColumns'] as $import_field) { - if (preg_match('/^'.$category_prefix.'Category(Path|[0-9]+)/', $import_field, $rets)) { - $category_found[$rets[1] == 'Path' ? 'mixed' : 'separated'] = true; - } - } - if ($category_found['mixed'] && $category_found['separated']) { - $object->SetError('ExportColumns', 'unique_category', 'la_error_unique_category_field'); - $ret = false; - } - - // 3. check, that duplicates check fields are selected & present in imported fields - if ($this->exportOptions['ReplaceDuplicates']) { - if ($this->exportOptions['CheckDuplicatesMethod'] == 1) { - $check_fields = Array($object->IDField); - } - else { - $check_fields = $this->exportOptions['DuplicateCheckFields'] ? explode('|', substr($this->exportOptions['DuplicateCheckFields'], 1, -1)) : Array(); - $object =& $event->getObject(); - - $language_id = $this->Application->GetDefaultLanguageId(); - foreach ($check_fields as $index => $check_field) { - foreach ($object->Fields as $field_name => $field_options) { - if ($field_name == 'l'.$language_id.'_'.$check_field) { - $check_fields[$index] = 'l'.$language_id.'_'.$check_field; - break; - } - } - } - } - $this->exportOptions['DuplicateCheckFields'] = $check_fields; - - if (!$check_fields) { - $object->setError('CheckDuplicatesMethod', 'required'); - $ret = false; - } - else { - foreach ($check_fields as $check_field) { - $check_field = preg_replace('/^cust_(.*)/', 'Custom_\\1', $check_field); - if (!in_array($check_field, $this->exportOptions['ExportColumns'])) { - $object->setError('ExportColumns', 'required'); - $ret = false; - break; - } - } - } - } - $this->saveOptions($event); - } - - return $ret; - } - - /** - * Returns filename to read import data from - * - * @return string - */ - function getImportFilename() - { - if ($this->exportOptions['ImportSource'] == 1) - { - $ret = $this->exportOptions['ImportFilename']; // ['name']; commented by Kostja - } - else { - $ret = $this->exportOptions['ImportLocalFilename']; - } - return EXPORT_PATH.'/'.$ret; - } - - /** - * Returns filename to write export data to - * - * @return string - */ - function getExportFilename() - { - return EXPORT_PATH.'/'.$this->exportOptions['ExportFilename'].'.'.$this->getFileExtension(); - } - - /** - * Opens file required for export/import operations - * - * @param kEvent $event - */ - function openFile(&$event) - { - if ($event->Special == 'export') { - $write_mode = ($this->exportOptions['start_from'] == 0) ? 'w' : 'a'; - $this->filePointer = fopen($this->getExportFilename(), $write_mode); - } - else { - $this->filePointer = fopen($this->getImportFilename(), 'r'); - } - - // skip UTF-8 BOM Modifier - $first_chars = fread($this->filePointer, 3); - if (bin2hex($first_chars) != 'efbbbf') { - fseek($this->filePointer, 0); - } - } - - /** - * Closes opened file - * - */ - function closeFile() - { - fclose($this->filePointer); - } - - function getCustomSQL() - { - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - - $custom_sql = ''; - foreach ($this->customFields as $custom_id => $custom_name) { - $custom_sql .= 'custom_data.'.$ml_formatter->LangFieldName('cust_'.$custom_id).' AS cust_'.$custom_name.', '; - } - - return preg_replace('/(.*), /', '\\1', $custom_sql); - } - - function getPlainExportSQL($count_only = false) { - if ($count_only && isset($this->exportOptions['ForceCountSQL'])) { - $sql = $this->exportOptions['ForceCountSQL']; - } - elseif (!$count_only && isset($this->exportOptions['ForceSelectSQL'])) { - $sql = $this->exportOptions['ForceSelectSQL']; - } - else { - $items_list =& $this->Application->recallObject($this->curItem->Prefix.'.export-items-list', $this->curItem->Prefix.'_List'); - $items_list->SetPerPage(-1); - - if ($options['export_ids'] != '') { - $items_list->AddFilter('export_ids', $items_list->TableName.'.'.$items_list->IDField.' IN ('.implode(',',$options['export_ids']).')'); - } - - if ($count_only) { - $sql = $items_list->getCountSQL( $items_list->GetSelectSQL(true,false) ); - } - else { - $sql = $items_list->GetSelectSQL(); - } - } - - if (!$count_only) - { - $sql .= ' LIMIT '.$this->exportOptions['start_from'].','.EXPORT_STEP; - } -// else { -// $sql = preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", "SELECT COUNT(*) AS count FROM ", $sql); -// } - - return $sql; - } - - function getExportSQL($count_only = false) - { - if (!$this->Application->getUnitOption($this->curItem->Prefix, 'CatalogItem')) { - return $this->GetPlainExportSQL($count_only); // in case this is not a CategoryItem - } - - if ($this->exportOptions['export_ids'] === false) - { - // get links from current category & all it's subcategories - $join_clauses = Array(); - - $custom_sql = $this->getCustomSQL(); - if ($custom_sql) { - $custom_table = $this->Application->getUnitOption($this->curItem->Prefix.'-cdata', 'TableName'); - $join_clauses[$custom_table.' custom_data'] = 'custom_data.ResourceId = item_table.ResourceId'; - } - - $join_clauses[TABLE_PREFIX.'CategoryItems ci'] = 'ci.ItemResourceId = item_table.ResourceId'; - $join_clauses[TABLE_PREFIX.'Category c'] = 'c.CategoryId = ci.CategoryId'; - - $sql = 'SELECT item_table.*, ci.CategoryId'.($custom_sql ? ', '.$custom_sql : '').' - FROM '.$this->curItem->TableName.' item_table'; - - foreach ($join_clauses as $table_name => $join_expression) { - $sql .= ' LEFT JOIN '.$table_name.' ON '.$join_expression; - } - $sql .= ' WHERE '; - - if ($this->exportOptions['export_cats_ids'][0] == 0) - { - $sql .= '1'; - } - else { - foreach ($this->exportOptions['export_cats_ids'] as $category_id) { - $sql .= '(c.ParentPath LIKE "%|'.$category_id.'|%") OR '; - } - $sql = preg_replace('/(.*) OR $/', '\\1', $sql); - } - - $sql .= ' ORDER BY ci.PrimaryCat DESC'; // NEW - } - else { - // get only selected links - $sql = 'SELECT item_table.*, '.$this->exportOptions['export_cats_ids'][0].' AS CategoryId - FROM '.$this->curItem->TableName.' item_table - WHERE '.$this->curItem->IDField.' IN ('.implode(',', $this->exportOptions['export_ids']).')'; - } - - if (!$count_only) - { - $sql .= ' LIMIT '.$this->exportOptions['start_from'].','.EXPORT_STEP; - } - else { - $sql = preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", "SELECT COUNT(*) AS count FROM ", $sql); - } - - return $sql; - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function performExport(&$event) - { - $this->exportOptions = $this->loadOptions($event); - $this->exportFields = $this->exportOptions['ExportColumns']; - $this->curItem =& $event->getObject( Array('skip_autoload' => true) ); - $this->customFields = $this->Application->getUnitOption($event->Prefix, 'CustomFields'); - $this->openFile($event); - - if ($this->exportOptions['start_from'] == 0) // first export step - { - if (!getArrayValue($this->exportOptions, 'IsBaseCategory')) { - $this->exportOptions['IsBaseCategory'] = 0; - } - - if ($this->exportOptions['IsBaseCategory'] ) { - $sql = 'SELECT ParentPath - FROM '.TABLE_PREFIX.'Category - WHERE CategoryId = '.$this->Application->GetVar('m_cat_id'); - $parent_path = $this->Conn->GetOne($sql); - $parent_path = explode('|', substr($parent_path, 1, -1)); - if ($parent_path && $parent_path[0] == $this->Application->findModule('Name', 'Core', 'RootCat')) { - array_shift($parent_path); - } - - $this->exportOptions['BaseLevel'] = count($parent_path); // level to cut from other categories - } - - // 1. export field titles if required - if ($this->exportOptions['IncludeFieldTitles']) - { - $data_array = Array(); - foreach ($this->exportFields as $export_field) - { - $data_array = array_merge($data_array, $this->getFieldCaption($export_field)); - } - $this->writeRecord($data_array); - } - $this->exportOptions['total_records'] = $this->Conn->GetOne( $this->getExportSQL(true) ); - } - - // 2. export data - $records = $this->Conn->Query( $this->getExportSQL() ); - $records_exported = 0; - foreach ($records as $record_info) { - $this->curItem->Clear(); - $this->curItem->SetDBFieldsFromHash($record_info); - $this->setCurrentID(); - $this->curItem->raiseEvent('OnAfterItemLoad', $this->curItem->GetID() ); - - $data_array = Array(); - foreach ($this->exportFields as $export_field) - { - $data_array = array_merge($data_array, $this->getFieldValue($export_field) ); - } - $this->writeRecord($data_array); - $records_exported++; - } - $this->closeFile(); - - $this->exportOptions['start_from'] += $records_exported; - $this->saveOptions($event); - - return $this->exportOptions; - } - - function getItemFields() - { - // just in case dummy user selected automtic mode & moved columns too :( - return array_merge($this->curItem->Fields['AvailableColumns']['options'], $this->curItem->Fields['ExportColumns']['options']); - } - - /** - * Checks if field really belongs to importable field list - * - * @param string $field_name - * @param kCatDBItem $object - * @return bool - */ - function validateField($field_name, &$object) - { - // 1. convert custom field - $field_name = preg_replace('/^Custom_(.*)/', '__CUSTOM__\\1', $field_name); - - // 2. convert category field (mixed version & serparated version) - $field_name = preg_replace('/^Category(Path|[0-9]+)/', '__CATEGORY__Category\\1', $field_name); - - $valid_fields = $object->getPossibleExportColumns(); - return isset($valid_fields[$field_name]) || isset($valid_fields['__VIRTUAL__'.$field_name]); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function performImport(&$event) - { - if (!$this->exportOptions) { - // load import options in case if not previously loaded in verification function - $this->exportOptions = $this->loadOptions($event); - } - - $backup_category_id = $this->Application->GetVar('m_cat_id'); - $this->Application->SetVar('m_cat_id', (int)$this->Application->RecallVar('ImportCategory') ); - - $this->openFile($event); - - $bytes_imported = 0; - if ($this->exportOptions['start_from'] == 0) // first export step - { - // 1st time run - if ($this->exportOptions['SkipFirstRow']) { - $this->readRecord(); - $this->exportOptions['start_from'] = ftell($this->filePointer); - $bytes_imported = ftell($this->filePointer); - } - - $current_category_id = $this->Application->GetVar('m_cat_id'); - if ($current_category_id > 0) { - $sql = 'SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$current_category_id; - $this->exportOptions['ImportCategoryPath'] = $this->Conn->GetOne($sql); - } - else { - $this->exportOptions['ImportCategoryPath'] = ''; - } - $this->exportOptions['total_records'] = filesize($this->getImportFilename()); - } - else { - $this->loadCache(); - } - - $this->exportFields = $this->exportOptions['ExportColumns']; - $this->addToCache('category_parent_path', $this->Application->GetVar('m_cat_id'), $this->exportOptions['ImportCategoryPath']); - - // 2. import data - $this->dummyCategory =& $this->Application->recallObject('c.-tmpitem', 'c', Array('skip_autoload' => true)); - fseek($this->filePointer, $this->exportOptions['start_from']); - - $items_processed = 0; - while (($bytes_imported < IMPORT_CHUNK && $items_processed < IMPORT_STEP) && !feof($this->filePointer)) { - $data = $this->readRecord(); - if ($data) { - if ($this->exportOptions['ReplaceDuplicates']) { - // set fields used as keys for replace duplicates code - $this->resetImportObject($event, IMPORT_TEMP, $data); - } - - $this->processCurrentItem($event, $data); - } - $bytes_imported = ftell($this->filePointer) - $this->exportOptions['start_from']; - $items_processed++; - } - - $this->closeFile(); - $this->Application->SetVar('m_cat_id', $backup_category_id); - - $this->exportOptions['start_from'] += $bytes_imported; - $this->storeCache('new_ids'); - - $this->saveOptions($event); - - if ($this->exportOptions['start_from'] == $this->exportOptions['total_records']) { - $this->Conn->Query('TRUNCATE TABLE '.$this->cacheTable); - } - - return $this->exportOptions; - } - - function setCurrentID() - { - $this->curItem->setID( $this->curItem->GetDBField($this->curItem->IDField) ); - } - - function setFieldValue($field_index, $value) - { - if (empty($value)) { - $value = null; - } - - $field_name = getArrayValue($this->exportFields, $field_index); - if ($field_name == 'ResourceId') { - return false; - } - - if (substr($field_name, 0, 7) == 'Custom_') { - $field_name = 'cust_'.substr($field_name, 7); - $this->curItem->SetField($field_name, $value); - } - elseif ($field_name == 'CategoryPath' || $field_name == '__CATEGORY__CategoryPath') { - $this->curItem->CategoryPath = $value ? explode($this->exportOptions['CategorySeparator'], $value) : Array(); - } - elseif (substr($field_name, 0, 8) == 'Category') { - $this->curItem->CategoryPath[ (int)substr($field_name, 8) - 1 ] = $value; - } - elseif (substr($field_name, 0, 20) == '__CATEGORY__Category') { - $this->curItem->CategoryPath[ (int)substr($field_name, 20) ] = $value; - } - elseif (substr($field_name, 0, 11) == '__VIRTUAL__') { - $field_name = substr($field_name, 11); - $this->curItem->SetField($field_name, $value); - } - else { - $this->curItem->SetField($field_name, $value); - } - - $pseudo_error = getArrayValue($this->curItem->FieldErrors, $field_name, 'pseudo'); - if ($pseudo_error) { - $this->curItem->SetDBField($field_name, null); - unset($this->curItem->FieldErrors[$field_name]); - } - } - - function resetImportObject(&$event, $object_type, $record_data = null) - { - switch ($object_type) { - case IMPORT_TEMP: - $this->curItem =& $event->getObject( Array('skip_autoload' => true) ); - break; - - case IMPORT_LIVE: - $this->curItem =& $this->Application->recallObject($event->Prefix.'.-tmpitem'.$event->Special, $event->Prefix, Array('skip_autoload' => true)); - break; - } - $this->curItem->Clear(); - $this->customFields = $this->Application->getUnitOption($event->Prefix, 'CustomFields'); - - if (isset($record_data)) { - $this->setImportData($record_data); - } - } - - function setImportData($record_data) - { - foreach ($record_data as $field_index => $field_value) { - $this->setFieldValue($field_index, $field_value); - } - $this->setCurrentID(); - } - - - function getItemCategory() - { - static $lang_prefix = null; - $backup_category_id = $this->Application->GetVar('m_cat_id'); - - $category_id = $this->getFromCache('category_names', implode(':', $this->curItem->CategoryPath)); - if ($category_id) { - $this->Application->SetVar('m_cat_id', $category_id); - return $category_id; - } - - if (is_null($lang_prefix)) { - $lang_prefix = 'l'.$this->Application->GetVar('m_lang').'_'; - } - - foreach ($this->curItem->CategoryPath as $category_index => $category_name) { - if (!$category_name) continue; - $category_key = crc32( implode(':', array_slice($this->curItem->CategoryPath, 0, $category_index + 1) ) ); - - $category_id = $this->getFromCache('category_names', $category_key); - if ($category_id === false) { - // get parent category path to search only in it - $current_category_id = $this->Application->GetVar('m_cat_id'); -// $parent_path = $this->getParentPath($current_category_id); - - // get category id from database by name - $sql = 'SELECT CategoryId - FROM '.TABLE_PREFIX.'Category - WHERE ('.$lang_prefix.'Name = '.$this->Conn->qstr($category_name).') AND (ParentId = '.$current_category_id.')'; - $category_id = $this->Conn->GetOne($sql); - - if ($category_id === false) { - // category not in db -> create - $category_fields = Array( $lang_prefix.'Name' => $category_name, $lang_prefix.'Description' => $category_name, - 'Status' => STATUS_ACTIVE, 'ParentId' => $current_category_id, 'AutomaticFilename' => 1 - ); - $this->dummyCategory->SetDBFieldsFromHash($category_fields); - if ($this->dummyCategory->Create()) { - $category_id = $this->dummyCategory->GetID(); - $this->addToCache('category_parent_path', $category_id, $this->dummyCategory->GetDBField('ParentPath')); - $this->addToCache('category_names', $category_key, $category_id); - } - } - else { - $this->addToCache('category_names', $category_key, $category_id); - } - } - - if ($category_id) { - $this->Application->SetVar('m_cat_id', $category_id); - } - } - if (!$this->curItem->CategoryPath) { - $category_id = $backup_category_id; - } - - return $category_id; - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function processCurrentItem(&$event, $record_data) - { - $save_method = 'Create'; - $load_keys = Array(); - - // create/update categories - $backup_category_id = $this->Application->GetVar('m_cat_id'); - - // perform replace duplicates code - if ($this->exportOptions['ReplaceDuplicates']) { - // get replace keys first, then reset current item to empty one - $category_id = $this->getItemCategory(); - if ($this->exportOptions['CheckDuplicatesMethod'] == 1) { - if ($this->curItem->GetID()) { - $load_keys = Array($this->curItem->IDField => $this->curItem->GetID()); - } - } - else { - $key_fields = $this->exportOptions['DuplicateCheckFields']; - foreach ($key_fields as $key_field) { - $load_keys[$key_field] = $this->curItem->GetDBField($key_field); - } - } - - $this->resetImportObject($event, IMPORT_LIVE); - - if (count($load_keys)) { - $where_clause = ''; - foreach ($load_keys as $field_name => $field_value) { - if (preg_match('/^cust_(.*)/', $field_name, $regs)) { - $custom_id = array_search($regs[1], $this->customFields); - $field_name = 'l'.$this->Application->GetVar('m_lang').'_cust_'.$custom_id; - $where_clause .= '(custom_data.`'.$field_name.'` = '.$this->Conn->qstr($field_value).') AND '; - } - else { - $where_clause .= '(item_table.`'.$field_name.'` = '.$this->Conn->qstr($field_value).') AND '; - } - - } - $where_clause = preg_replace('/(.*) AND $/', '\\1', $where_clause); - - $item_id = $this->getFromCache('new_ids', crc32($where_clause)); - if (!$item_id) { - if ($this->exportOptions['CheckDuplicatesMethod'] == 2) { - // by other fields - $parent_path = $this->getParentPath($category_id); - $where_clause = '(c.ParentPath LIKE "'.$parent_path.'%") AND '.$where_clause; - } - - $cdata_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName'); - $sql = 'SELECT '.$this->curItem->IDField.' - FROM '.$this->curItem->TableName.' item_table - LEFT JOIN '.$cdata_table.' custom_data ON custom_data.ResourceId = item_table.ResourceId - LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON ci.ItemResourceId = item_table.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category c ON c.CategoryId = ci.CategoryId - WHERE '.$where_clause; - $item_id = $this->Conn->GetOne($sql); - } - $save_method = $item_id && $this->curItem->Load($item_id) ? 'Update' : 'Create'; - if ($save_method == 'Update') { - // replace id from csv file with found id (only when ID is found in cvs file) - if (in_array($this->curItem->IDField, $this->exportFields)) { - $record_data[ array_search($this->curItem->IDField, $this->exportFields) ] = $item_id; - } - } - } - - $this->setImportData($record_data); - } - else { - $this->resetImportObject($event, IMPORT_LIVE, $record_data); - $category_id = $this->getItemCategory(); - } - - // create main record - if ($save_method == 'Create') { - $this->fillRequiredFields($this->false, $this->curItem, true); - } - -// $sql_start = getmicrotime(); - if (!$this->curItem->$save_method()) { - $this->Application->SetVar('m_cat_id', $backup_category_id); - return false; - } -// $sql_end = getmicrotime(); -// $this->saveLog('SQL ['.$save_method.'] Time: '.($sql_end - $sql_start).'s'); - - if ($load_keys && ($save_method == 'Create') && $this->exportOptions['ReplaceDuplicates']) { - // map new id to old id - $this->addToCache('new_ids', crc32($where_clause), $this->curItem->GetID() ); - } - - // assign item to categories - $this->curItem->assignToCategory($category_id, false); - - $this->Application->SetVar('m_cat_id', $backup_category_id); - return true; - } - - /*function saveLog($msg) - { - static $first_time = true; - - $fp = fopen(FULL_PATH.'/sqls.log', $first_time ? 'w' : 'a'); - fwrite($fp, $msg."\n"); - fclose($fp); - - $first_time = false; - }*/ - - /** - * Returns category parent path, if possible, then from cache - * - * @param int $category_id - * @return string - */ - function getParentPath($category_id) - { - $parent_path = $this->getFromCache('category_parent_path', $category_id); - if ($parent_path === false) { - $sql = 'SELECT ParentPath - FROM '.TABLE_PREFIX.'Category - WHERE CategoryId = '.$category_id; - $parent_path = $this->Conn->GetOne($sql); - $this->addToCache('category_parent_path', $category_id, $parent_path); - } - return $parent_path; - } - - function getFileExtension() - { - return $this->exportOptions['ExportFormat'] == 1 ? 'csv' : 'xml'; - } - - function getLineSeparator($option = 'LineEndings') - { - return $this->exportOptions[$option] == 1 ? "\r\n" : "\n"; - } - - /** - * Returns field caption for any exported field - * - * @param string $field - * @return string - */ - function getFieldCaption($field) - { - if (substr($field, 0, 10) == '__CUSTOM__') - { - $ret = 'Custom_'.substr($field, 10, strlen($field) ); - } - elseif (substr($field, 0, 12) == '__CATEGORY__') - { - return $this->getCategoryTitle(); - } - elseif (substr($field, 0, 11) == '__VIRTUAL__') { - $ret = substr($field, 11); - } - else - { - $ret = $field; - } - - return Array($ret); - } - - /** - * Returns requested field value (including custom fields and category fields) - * - * @param string $field - * @return string - */ - function getFieldValue($field) - { - if (substr($field, 0, 10) == '__CUSTOM__') { - $field = 'cust_'.substr($field, 10, strlen($field)); - $ret = $this->curItem->GetField($field); - } - elseif (substr($field, 0, 12) == '__CATEGORY__') { - return $this->getCategoryPath(); - } - elseif (substr($field, 0, 11) == '__VIRTUAL__') { - $field = substr($field, 11); - $ret = $this->curItem->GetField($field); - } - else - { - $ret = $this->curItem->GetField($field); - } - - $ret = str_replace("\r\n", $this->getLineSeparator('LineEndingsInside'), $ret); - return Array($ret); - } - - /** - * Returns category field(-s) caption based on export mode - * - * @return string - */ - function getCategoryTitle() - { - // category path in separated fields - $category_count = $this->getMaxCategoryLevel(); - if ($this->exportOptions['CategoryFormat'] == 1) - { - // category path in one field - return $category_count ? Array('CategoryPath') : Array(); - } - else - { - $i = 0; - $ret = Array(); - while ($i < $category_count) { - $ret[] = 'Category'.($i + 1); - $i++; - } - return $ret; - } - } - - /** - * Returns category path in required format for current link - * - * @return string - */ - function getCategoryPath() - { - $category_id = $this->curItem->GetDBField('CategoryId'); - $category_path = $this->getFromCache('category_path', $category_id); - if (!$category_path) - { - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - $sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').' - FROM '.TABLE_PREFIX.'Category - WHERE CategoryId = '.$category_id; - $category_path = $this->Conn->GetOne($sql); - - $category_path = $category_path ? explode('&|&', $category_path) : Array(); - if ($category_path && strtolower($category_path[0]) == 'content') { - array_shift($category_path); - } - - if ($this->exportOptions['IsBaseCategory']) { - $i = $this->exportOptions['BaseLevel']; - while ($i > 0) { - array_shift($category_path); - $i--; - } - } - - $category_count = $this->getMaxCategoryLevel(); - if ($this->exportOptions['CategoryFormat'] == 1) { - // category path in single field - $category_path = $category_count ? Array( implode($this->exportOptions['CategorySeparator'], $category_path) ) : Array(); - } - else { - // category path in separated fields - $levels_used = count($category_path); - if ($levels_used < $category_count) - { - $i = 0; - while ($i < $category_count - $levels_used) { - $category_path[] = ''; - $i++; - } - } - } - $this->addToCache('category_path', $category_id, $category_path); - } - - return $category_path; - } - - /** - * Get maximal category deep level from links beeing exported - * - * @return int - */ - function getMaxCategoryLevel() - { - static $max_level = -1; - - if ($max_level != -1) - { - return $max_level; - } - - $sql = 'SELECT IF(c.CategoryId IS NULL, 0, MAX( LENGTH(c.ParentPath) - LENGTH( REPLACE(c.ParentPath, "|", "") ) - 1 )) - FROM '.$this->curItem->TableName.' item_table - LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON item_table.ResourceId = ci.ItemResourceId - LEFT JOIN '.TABLE_PREFIX.'Category c ON c.CategoryId = ci.CategoryId - WHERE (ci.PrimaryCat = 1) AND '; - - $where_clause = ''; - if ($this->exportOptions['export_ids'] === false) { - // get links from current category & all it's subcategories - if ($this->exportOptions['export_cats_ids'][0] == 0) { - $where_clause = 1; - } - else { - foreach ($this->exportOptions['export_cats_ids'] as $category_id) { - $where_clause .= '(c.ParentPath LIKE "%|'.$category_id.'|%") OR '; - } - $where_clause = preg_replace('/(.*) OR $/', '\\1', $where_clause); - } - } - else { - // get only selected links - $where_clause = $this->curItem->IDField.' IN ('.implode(',', $this->exportOptions['export_ids']).')'; - } - - $max_level = $this->Conn->GetOne($sql.'('.$where_clause.')'); - - if ($this->exportOptions['IsBaseCategory'] ) { - $max_level -= $this->exportOptions['BaseLevel']; - } - - return $max_level; - } - - /** - * Saves one record to export file - * - * @param Array $fields_hash - */ - function writeRecord($fields_hash) - { - fputcsv2($this->filePointer, $fields_hash, $this->exportOptions['FieldsSeparatedBy'], $this->exportOptions['FieldsEnclosedBy'], $this->getLineSeparator() ); - } - - function readRecord() - { - return fgetcsv($this->filePointer, 10000, $this->exportOptions['FieldsSeparatedBy'], $this->exportOptions['FieldsEnclosedBy']); - } - - function saveOptions(&$event, $options = null) - { - if (!isset($options)) { - $options = $this->exportOptions; - } - $this->Application->StoreVar($event->getPrefixSpecial().'_options', serialize($options) ); - } - - function loadOptions(&$event) - { - return unserialize($this->Application->RecallVar($event->getPrefixSpecial().'_options')); - } - - /** - * Sets correct available & export fields - * - * @param kEvent $event - */ - function prepareExportColumns(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - if (!array_key_exists('ExportColumns', $object->Fields)) { - // import/export prefix was used (see kDBEventHandler::prepareObject) but object don't plan to be imported/exported - return ; - } - - $available_columns = Array(); - - if ($this->Application->getUnitOption($event->Prefix, 'CatalogItem')) { - // category field (mixed) - $available_columns['__CATEGORY__CategoryPath'] = 'CategoryPath'; - - if ($event->Special == 'import') { - // category field (separated fields) - $max_level = $this->Application->ConfigValue('MaxImportCategoryLevels'); - $i = 0; - while ($i < $max_level) { - $available_columns['__CATEGORY__Category'.($i + 1)] = 'Category'.($i + 1); - $i++; - } - } - } - - // db fields - foreach ($object->Fields as $field_name => $field_options) - { - if (!$object->skipField($field_name)) - { - $available_columns[$field_name] = $field_name.(getArrayValue($field_options, 'required') ? '*' : ''); - } - } - - $handler =& $this->Application->recallObject($event->Prefix.'_EventHandler'); - $available_columns = array_merge_recursive2($available_columns, $handler->getCustomExportColumns($event)); - - // custom fields - foreach ($object->customFields as $custom_id => $custom_name) - { - $available_columns['__CUSTOM__'.$custom_name] = $custom_name; - } - - // columns already in use - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if ($items_info) - { - list($item_id, $field_values) = each($items_info); - $export_keys = $field_values['ExportColumns']; - $export_keys = $export_keys ? explode('|', substr($export_keys, 1, -1) ) : Array(); - } - else { - $export_keys = Array(); - } - - $export_columns = Array(); - foreach ($export_keys as $field_key) - { - $field_name = $this->getExportField($field_key); - $export_columns[$field_key] = $field_name; - unset($available_columns[$field_key]); - } - - $options = $object->GetFieldOptions('ExportColumns'); - $options['options'] = $export_columns; - $object->SetFieldOptions('ExportColumns', $options); - - $options = $object->GetFieldOptions('AvailableColumns'); - $options['options'] = $available_columns; - $object->SetFieldOptions('AvailableColumns', $options); - - $this->updateImportFiles($event); - $this->PrepareExportPresets($event); - } - - function PrepareExportPresets(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $options = $object->GetFieldOptions('ExportPresets'); - - $export_settings = $this->Application->RecallPersistentVar('export_settings'); - if (!$export_settings) return ; - $export_settings = unserialize($export_settings); - - if (!isset($export_settings[$event->Prefix])) return ; - - - $export_presets = array(''=>''); - foreach ($export_settings[$event->Prefix] as $key => $val) { - $export_presets[implode('|', $val['ExportColumns'])] = $key; - } - - $options['options'] = $export_presets; - $object->SetFieldOptions('ExportPresets', $options); - } - - function getExportField($field_key) - { - $prepends = Array('__CUSTOM__', '__CATEGORY__'); - foreach ($prepends as $prepend) - { - if (substr($field_key, 0, strlen($prepend) ) == $prepend) - { - $field_key = substr($field_key, strlen($prepend), strlen($field_key) ); - break; - } - } - return $field_key; - } - - /** - * Updates uploaded files list - * - * @param kEvent $event - */ - function updateImportFiles(&$event) - { - if ($event->Special != 'import') { - return false; - } - - $object =& $event->getObject(); - - $import_filenames = Array(); - - if ($folder_handle = opendir(EXPORT_PATH)) { - while (false !== ($file = readdir($folder_handle))) { - if (is_dir(EXPORT_PATH.'/'.$file) || substr($file, 0, 1) == '.' || strtolower($file) == 'cvs' || strtolower($file) == 'dummy' || filesize(EXPORT_PATH.'/'.$file) == 0) continue; - - $file_size = formatSize( filesize(EXPORT_PATH.'/'.$file) ); - $import_filenames[$file] = $file.' ('.$file_size.')'; - } - closedir($folder_handle); - } - - $options = $object->GetFieldOptions('ImportLocalFilename'); - $options['options'] = $import_filenames; - $object->SetFieldOptions('ImportLocalFilename', $options); - } - - /** - * Returns module folder - * - * @param kEvent $event - * @return string - */ - function getModuleFolder(&$event) - { - return $this->Application->getUnitOption($event->Prefix, 'ModuleFolder'); - } - - /** - * Export form validation & processing - * - * @param kEvent $event - */ - function OnExportBegin(&$event) - { - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if (!$items_info) - { - $items_info = unserialize( $this->Application->RecallVar($event->getPrefixSpecial().'_ItemsInfo') ); - $this->Application->SetVar($event->getPrefixSpecial(true), $items_info); - } - - list($item_id, $field_values) = each($items_info); - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->SetFieldsFromHash($field_values); - $field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!! - - $object->setID($item_id); - $this->setRequiredFields($event); - - $export_object =& $this->Application->recallObject('CatItemExportHelper'); - - // save export/import options - if ($event->Special == 'export') - { - $export_ids = $this->Application->RecallVar($event->Prefix.'_export_ids'); - $export_cats_ids = $this->Application->RecallVar($event->Prefix.'_export_cats_ids'); - - // used for multistep export - $field_values['export_ids'] = $export_ids ? explode(',', $export_ids) : false; - $field_values['export_cats_ids'] = $export_cats_ids ? explode(',', $export_cats_ids) : Array( $this->Application->GetVar('m_cat_id') ); - } - - $field_values['ExportColumns'] = $field_values['ExportColumns'] ? explode('|', substr($field_values['ExportColumns'], 1, -1) ) : Array(); - $field_values['start_from'] = 0; - - $this->Application->HandleEvent($nevent, $event->Prefix.':OnBeforeExportBegin', array('options'=>$field_values)); - $field_values = $nevent->getEventParam('options'); - - $export_object->saveOptions($event, $field_values); - - if( $export_object->verifyOptions($event) ) - { - if ($this->_getExportSavePreset($object)) { - $name = $object->GetDBField('ExportPresetName'); - - $export_settings = $this->Application->RecallPersistentVar('export_settings'); - $export_settings = $export_settings ? unserialize($export_settings) : array(); - $export_settings[$event->Prefix][$name] = $field_values; - $this->Application->StorePersistentVar('export_settings', serialize($export_settings)); - } - - $progress_t = $this->Application->RecallVar('export_progress_t'); - if ($progress_t) { - $this->Application->RemoveVar('export_progress_t'); - } - else { - $progress_t = $export_object->getModuleFolder($event).'/'.$event->Special.'_progress'; - } - $event->redirect = $progress_t; - - if ($event->Special == 'import') { - $import_category = (int)$this->Application->RecallVar('ImportCategory'); - - // in future could use module root category if import category will be unavailable :) - $event->SetRedirectParam('m_cat_id', $import_category); // for template permission checking - $this->Application->StoreVar('m_cat_id', $import_category); // for event permission checking - } - } - else - { - // make uploaded file local & change source selection - $filename = getArrayValue($field_values, 'ImportFilename'); - if ($filename) { - $export_object->updateImportFiles($event); - $object->SetDBField('ImportSource', 2); - $field_values['ImportSource'] = 2; - $object->SetDBField('ImportLocalFilename', $filename); - $field_values['ImportLocalFilename'] = $filename; - $export_object->saveOptions($event, $field_values); - } - - $event->status = erFAIL; - $event->redirect = false; - } - } - - /** - * Returns export save preset name, when used at all - * - * @param kDBItem $object - * @return string - */ - function _getExportSavePreset(&$object) - { - if (!array_key_exists('ExportSavePreset', $object->Fields)) { - return ''; - } - - return $object->GetDBField('ExportSavePreset'); - } - - /** - * set required fields based on import or export params - * - * @param kEvent $event - */ - function setRequiredFields(&$event) - { - $required_fields['common'] = Array('FieldsSeparatedBy', 'LineEndings', 'CategoryFormat'); - - $required_fields['export'] = Array('ExportFormat', 'ExportFilename','ExportColumns'); - - $object =& $event->getObject(); - if ($this->_getExportSavePreset($object)) { - $required_fields['export'][] = 'ExportPresetName'; - } - - $required_fields['import'] = Array('FieldTitles', 'ImportSource', 'CheckDuplicatesMethod'); // ImportFilename, ImportLocalFilename - - if ($event->Special == 'import') - { - $import_source = Array(1 => 'ImportFilename', 2 => 'ImportLocalFilename'); - $used_field = $import_source[ $object->GetDBField('ImportSource') ]; - - $required_fields[$event->Special][] = $used_field; - $object->Fields[$used_field]['error_field'] = 'ImportSource'; - - if ($object->GetDBField('FieldTitles') == 2) $required_fields[$event->Special][] = 'ExportColumns'; // manual field titles - } - - $required_fields = array_merge($required_fields['common'], $required_fields[$event->Special]); - foreach ($required_fields as $required_field) { - $object->setRequired($required_field, true); - } - } - - } - -?> Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_image_disabled.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/js/catalog.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/catalog.js (.../catalog.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/catalog.js (.../catalog.js) (revision 12657) @@ -24,12 +24,22 @@ this.searchInfo = {}; // information about search (for each tab) } -Catalog.prototype.Init = function () { +Catalog.prototype.Init = function ($auto_hide_tabs) { var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix'); if ($prefix !== this.ActivePrefix && this.TabRegistry.length > 0) { // ActivePrefix not set or has non-existing prefix value this.ActivePrefix = this.TabRegistry[0]['prefix']; } + + if ($auto_hide_tabs === undefined) { + $auto_hide_tabs = true; + } + + if ((this.TabRegistry.length == 1) && $auto_hide_tabs) { + // only one tab -> hide all tab bar + $('div.tab-viewport').parents('table:first').hide(); + } + this.SetAlternativeTabs(); this.AfterInit(); } @@ -368,14 +378,28 @@ } Catalog.prototype.displaySearch = function ($prefix) { - var $search_input = document.getElementById('search_keyword') + var $search_input = $('#search_keyword'); - $search_input.setAttribute('PrefixSpecial', $prefix); + $search_input.attr('PrefixSpecial', $prefix); if (this.searchInfo[$prefix]) { - $search_input.value = this.searchInfo[$prefix].keyword; - $search_input.setAttribute('Grid', this.searchInfo[$prefix].grid); + $search_input + .val(this.searchInfo[$prefix].keyword) + .attr('Grid', this.searchInfo[$prefix].grid); + + if (this.searchInfo[$prefix].keyword) { + // catalog tab found and keyword present + $search_input.addClass('filter-active'); + } + else { + // catalog tab found and keyword missing + $search_input.removeClass('filter-active'); + } } + else { + // catalog tab not found + $search_input.removeClass('filter-active'); + } } Catalog.prototype.setCurrentCategory = function($prefix, $category_id) { Index: branches/5.1.x/core/admin_templates/img/icons/icon46_server_info.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_banlist.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/general/libchart/classes/view/color/ColorSet.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/color/ColorSet.php (.../ColorSet.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/color/ColorSet.php (.../ColorSet.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * A set of colors, used for drawing series of data. * @@ -79,5 +81,4 @@ public function currentShadowColor() { return current($this->shadowColorList); } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/captcha/captcha_eh.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/captcha/captcha_eh.php (.../captcha_eh.php) (revision 12127) +++ branches/5.1.x/core/units/captcha/captcha_eh.php (.../captcha_eh.php) (revision 12657) @@ -1,6 +1,6 @@ Application->recallObject('CaptchaHelper'); /* @var $captcha_helper kCaptchaHelper */ - // generate captcha code - $captcha_helper->prepareCode($event->MasterEvent); - // create field for captcha code storage $virtual_fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'VirtualFields'); $virtual_fields['Captcha'] = Array ('type' => 'string', 'default' => ''); Index: branches/5.1.x/core/units/dummy =================================================================== diff -u -N --- branches/5.1.x/core/units/dummy (revision 12127) +++ branches/5.1.x/core/units/dummy (revision 0) @@ -1 +0,0 @@ -dummy \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_conf_regional.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/submissions/submission_view.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/submissions/submission_view.tpl (.../submission_view.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/submissions/submission_view.tpl (.../submission_view.tpl) (revision 12657) @@ -1,6 +1,8 @@ - + + + Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_more_brackets_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/utility/formatters/formatters_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/formatters/formatters_config.php (.../formatters_config.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/formatters/formatters_config.php (.../formatters_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'formatters', 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), Index: branches/5.1.x/core/admin_templates/js/jquery/thickbox/thickbox.css =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/jquery/thickbox/thickbox.css (.../thickbox.css) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/jquery/thickbox/thickbox.css (.../thickbox.css) (revision 12657) @@ -92,16 +92,16 @@ } #TB_closeAjaxWindow, .TB_closeAjaxWindow { - padding:7px 10px 5px 0; - margin-bottom:1px; - text-align:right; - float:right; + padding: 6px 10px 6px 0px; + /*margin-bottom: 1px;*/ + text-align: right; + float: right; } #TB_ajaxWindowTitle, .TB_ajaxWindowTitle { - float:left; - padding:7px 0 5px 10px; - margin-bottom:1px; + float: left; + padding: 6px 0px 6px 10px; + /*margin-bottom: 1px;*/ font-weight: bold; } @@ -165,7 +165,7 @@ clear:both; border:none; margin-bottom:-1px; - margin-top:1px; + /*margin-top:1px;*/ _margin-bottom:1px; } Index: branches/5.1.x/core/admin_templates/config/config_general.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/config/config_general.tpl (.../config_general.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/config/config_general.tpl (.../config_general.tpl) (revision 12657) @@ -117,4 +117,16 @@
    + + \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_update_rates.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_view_item_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_affiliate_payment_type_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/email_events/email_events_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 12127) +++ branches/5.1.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'emailevents', - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'EmailEventsEventsHandler','file'=>'email_events_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'), - 'AutoLoad' => true, +defined('FULL_PATH') or die('restricted access!'); - 'QueryString' => Array( - 1 => 'id', - 2 => 'page', - 3 => 'event', - ), + $config = Array ( + 'Prefix' => 'emailevents', + 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'EmailEventsEventsHandler', 'file' => 'email_events_event_handler.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), - 'IDField' => 'EventId', + 'AutoLoad' => true, - 'StatusField' => Array('Enabled'), + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'event', + 4 => 'mode', + ), - 'TitleField' => 'Event', + 'IDField' => 'EventId', + 'StatusField' => Array ('Enabled'), + 'TitleField' => 'Event', - 'TitlePresets' => Array( - 'email_settings_list' => Array('prefixes' => Array('emailevents.module_List'), 'format' => '!la_title_EmailSettings!'), + 'TitlePresets' => Array ( + 'default' => Array ( + 'edit_status_labels' => Array ('emailevents' => '!la_title_EditingEmailEvent!'), + ), - 'email_send_form' => Array('prefixes' => Array(), 'format' => '!la_title_SendEmail!'), - 'email_prepare' => Array('prefixes' => Array(), 'format' => '!la_title_PreparingEmailsForSending!. !la_title_PleaseWait!'), - 'email_send' => Array('prefixes' => Array(), 'format' => '!la_title_SendingPreparedEmails!. !la_title_PleaseWait!'), - 'email_send_complete' => Array('prefixes' => Array(), 'format' => '!la_title_SendMailComplete!'), - ), + 'email_settings_list' => Array ('prefixes' => Array ('emailevents.module_List'), 'format' => '!la_title_EmailSettings!'), - 'PermSection' => Array('main' => 'in-portal:configure_lang'), + 'email_settings_edit' => Array ( + 'prefixes' => Array ('emailevents'), 'format' => "#emailevents_status# '#emailevents_titlefield#'", + 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'), + ), - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_enabled','show_disabled','show_frontonly'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_enabled' => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ), - 'show_frontonly' => Array('label' => 'la_Text_FrontOnly', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 2' ), - ) - ), + 'email_send_form' => Array ('prefixes' => Array (), 'format' => '!la_title_SendEmail!'), + 'email_prepare' => Array ('prefixes' => Array (), 'format' => '!la_title_PreparingEmailsForSending!. !la_title_PleaseWait!'), + 'email_send' => Array ('prefixes' => Array (), 'format' => '!la_title_SendingPreparedEmails!. !la_title_PleaseWait!'), + 'email_send_complete' => Array ('prefixes' => Array (), 'format' => '!la_title_SendMailComplete!'), + ), - 'TableName' => TABLE_PREFIX.'Events', + 'PermSection' => Array ('main' => 'in-portal:configure_lang'), - 'CalculatedFields' => Array( - '' => Array ( - 'FromUser' => 'u.Login', - ) - ), + 'FilterMenu' => Array ( + 'Groups' => Array ( + Array ('mode' => 'AND', 'filters' => Array ('show_enabled', 'show_disabled', 'show_frontonly'), 'type' => WHERE_FILTER), + ), - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.FromUserId = u.PortalUserId', - ), // key - special, value - list select sql), + 'Filters' => Array ( + 'show_enabled' => Array ('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ), + 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ), + 'show_frontonly' => Array ('label' => 'la_Text_FrontOnly', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 2' ), + ) + ), - 'ItemSQLs' => Array( ''=>'SELECT * FROM %s'), + 'TableName' => TABLE_PREFIX . 'Events', - 'ListSortings' => Array( - '' => Array('Sorting' => Array('Module' => 'asc', 'Description' => 'asc') ), + 'CalculatedFields' => Array ( + '' => Array ( + 'FromUser' => 'u.Login', + ) + ), - 'module' => Array('Sorting' => Array('Description' => 'asc') ), - ), + 'ListSQLs' => Array ( + '' => ' SELECT %1$s.* %2$s + FROM %1$s + LEFT JOIN ' . TABLE_PREFIX . 'PortalUser u ON %1$s.FromUserId = u.PortalUserId', + ), - 'Fields' => Array( - 'EventId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'Event' => Array('type' => 'string','not_null' => '1','default' => ''), - 'ReplacementTags' => Array ('type' => 'string', 'default' => NULL), - 'Enabled' => Array('type'=>'int', 'formatter'=>'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Text_FrontOnly'), 'use_phrases' => 1, 'default' => 1, 'not_null' => 1), - 'FromUserId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1=>'root'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required'=>1, 'not_null' => 1, 'default' => -1), - 'Module' => Array('type' => 'string','not_null' => '1','default' => ''), - 'Description' => Array('type' => 'string','not_null' => '1','default' => ''), - 'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1, 'default' => 0, 'not_null' => 1), - ), - 'VirtualFields' => Array( - 'FromUser' => Array(), - ), + 'ListSortings' => Array ( + '' => Array ('Sorting' => Array ('Module' => 'asc', 'Description' => 'asc')), + 'module' => Array ('Sorting' => Array ('Description' => 'asc') ), + ), - 'Grids' => Array( - 'Default' => Array ( - 'Icons' => Array('default'=>'icon16_custom.gif'), - 'Fields' => Array( - 'EventId' => Array('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter'), - 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter'), - 'Event' => Array( 'title'=>'la_col_Event', 'filter_block' => 'grid_like_filter'), - 'Module' => Array( 'title'=>'la_col_Module', 'filter_block' => 'grid_like_filter'), - 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'), - 'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'), - ), - ), + 'Fields' => Array ( + 'EventId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Event' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'ReplacementTags' => Array ('type' => 'string', 'default' => NULL), - 'EmailSettings' => Array ( - 'Icons' => Array('default'=>'icon16_custom.gif'), - 'Fields' => Array( - 'EventId' => Array('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter'), - 'Description' => Array('title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td' ), - 'Type' => Array('title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'), - 'Enabled' => Array('title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'), - 'FromUser' => Array('title'=>'la_col_FromToUser', 'filter_block' => 'grid_like_filter'), - ), - ), - ), + 'Enabled' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 1 + ), + + 'FrontEndOnly' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 0 + ), + + 'FromUserId' => Array ( + 'type' => 'int', + 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', + 'default' => NULL + ), + + 'Module' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'Description' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'Type' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1, + 'not_null' => 1, 'required' => 1, 'default' => 0 + ), + ), + + 'VirtualFields' => Array ( + 'FromUser' => Array ('type' => 'string', 'default' => ''), + ), + + 'Grids' => Array ( + 'Default' => Array ( + 'Icons' => Array ( + 'default' => 'icon16_item.png', + 0 => 'icon16_disabled.png', + 1 => 'icon16_item.png', + ), + 'Fields' => Array ( + 'EventId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 70, ), + 'Description' => Array ( 'title' => 'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 250, ), + 'Event' => Array ( 'title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', 'width' => 250, ), + 'Module' => Array ( 'title' => 'la_col_Module', 'filter_block' => 'grid_like_filter', 'width' => 100, ), + 'Type' => Array ( 'title' => 'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 120, ), + 'Enabled' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + ), + ), + + 'EmailSettings' => Array ( + 'Icons' => Array ( + 'default' => 'icon16_item.png', + 0 => 'icon16_disabled.png', + 1 => 'icon16_item.png', + ), + 'Fields' => Array ( + 'EventId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 70, ), + 'Description' => Array ('title' => 'la_col_EventDescription', 'data_block' => 'label_grid_checkbox_td', 'width' => 250, ), + 'FromUser' => Array ('title' => 'la_col_FromToUser', 'data_block' => 'from_user_td', 'filter_block' => 'grid_like_filter', 'width' => 150, ), + 'Type' => Array ('title' => 'la_col_RecipientType', 'filter_block' => 'grid_options_filter', 'width' => 120, ), + 'FrontEndOnly' => Array ('title' => 'la_col_FrontEndOnly', 'filter_block' => 'grid_options_filter', 'width' => 120, ), + 'Enabled' => Array ('title' => 'la_col_Enabled', 'filter_block' => 'grid_options_filter', 'width' => 80, ), + ), + ), + ), ); \ No newline at end of file Index: branches/5.1.x/core/units/thesaurus/thesaurus_tp.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/thesaurus/thesaurus_tp.php (.../thesaurus_tp.php) (revision 12127) +++ branches/5.1.x/core/units/thesaurus/thesaurus_tp.php (.../thesaurus_tp.php) (revision 12657) @@ -1,6 +1,6 @@ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_settings_general.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/db/cat_dbitem.php =================================================================== diff -u -N -r12535 -r12657 --- branches/5.1.x/core/kernel/db/cat_dbitem.php (.../5.0.x/core/kernel/db/cat_dbitem.php) (revision 12535) +++ branches/5.1.x/core/kernel/db/cat_dbitem.php (.../5.1.x/core/kernel/db/cat_dbitem.php) (revision 12657) @@ -1,6 +1,6 @@ ValidateFileName($this->FullPath, $real_name, $files2delete); $file_name = $this->FullPath.$real_name; - $tmp_file = (defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/').$swf_uploaded_ids[$i].'_'.$swf_uploaded_names[$i]; + $tmp_file = WRITEABLE . '/tmp/' . $swf_uploaded_ids[$i].'_'.$swf_uploaded_names[$i]; rename($tmp_file, $file_name); @chmod($file_name, 0666); Index: branches/5.1.x/core/admin_templates/skins/skin_list.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/skins/skin_list.tpl (.../skin_list.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/skins/skin_list.tpl (.../skin_list.tpl) (revision 12657) @@ -35,7 +35,7 @@ a_toolbar.AddButton( new ToolBarSeparator('sep1') ); - a_toolbar.AddButton( new ToolBarButton('primary_theme', '::', function() { + a_toolbar.AddButton( new ToolBarButton('setprimary', '::', function() { submit_event('skin','OnSetPrimary'); } ) ); @@ -66,7 +66,7 @@ \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_file_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_image_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_image.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/js/script.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 12657) @@ -23,8 +23,12 @@ replaceFireBug(); } -function use_popups($prefix_special, $event) { - return $use_popups; +function use_popups($prefix_special, $event, $mode) { + if ($mode === undefined || $mode == 'popup') { + return $use_popups; + } + + return $modal_windows; } function getArrayValue() @@ -538,9 +542,37 @@ ); } -function translate_phrase($label, $template) { +function translate_phrase($label, $edit_template, $options) { set_hidden_field('phrases_label', $label); - open_popup('phrases', 'OnNew', $template); + var $event = $options.event === undefined ? 'OnNew' : $options.event; + + if ($options.simple_mode !== undefined) { + Application.SetVar('simple_mode', $options.simple_mode ? 1 : 0); + + if ($options.simple_mode) { + Application.SetVar('front', 1); + } + } + else { + Application.SetVar('front', null); + Application.SetVar('simple_mode', null); + Application.SetVar('phrases_label', null); + } + + if (use_popups('phrases', $event)) { + open_popup('phrases', $event, $edit_template, null, function() { + Application.SetVar('front', null); + Application.SetVar('simple_mode', null); + }); + } + else { + opener_action('d'); + submit_event('phrases', $event, $edit_template); + + Application.SetVar('front', null); + Application.SetVar('simple_mode', null); + Application.SetVar('phrases_label', null); + } } function direct_edit($prefix_special, $url) { @@ -850,7 +882,7 @@ $window.top.document.title = (main_title.length ? main_title + ' - ' : '') + $title; if ($modal_windows) { - $window.TB.setWindowTitle($title); + $window.TB.setWindowTitle(''); } } Index: branches/5.1.x/core/kernel/db/cat_dblist.php =================================================================== diff -u -N -r12343 -r12657 --- branches/5.1.x/core/kernel/db/cat_dblist.php (.../5.0.x/core/kernel/db/cat_dblist.php) (revision 12343) +++ branches/5.1.x/core/kernel/db/cat_dblist.php (.../5.1.x/core/kernel/db/cat_dblist.php) (revision 12657) @@ -1,6 +1,6 @@ " /> Index: branches/5.1.x/core/admin_templates/img/icons/icon24_tool_restore.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_community.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_paymenttype_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/globals.php =================================================================== diff -u -N -r12453 -r12657 --- branches/5.1.x/core/kernel/globals.php (.../globals.php) (revision 12453) +++ branches/5.1.x/core/kernel/globals.php (.../globals.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 12657) @@ -1,6 +1,6 @@ _directorySeparator = preg_quote(DIRECTORY_SEPARATOR); + $this->_directorySeparator = preg_quote( DIRECTORY_SEPARATOR ); $this->_skipFolders[] = trim(WRITEBALE_BASE, '/'); // system folder (where web server can write) - $this->_skipFolders[] = array_pop( explode('/', trim(EDITOR_PATH, '/')) ); // last of cmseditor folders + + $editor_path = explode('/', trim(EDITOR_PATH, '/')); + $this->_skipFolders[] = array_pop($editor_path); // last of cmseditor folders } function CacheParsedData() @@ -69,7 +73,8 @@ $config_vars = Array ( 'SessionTimeout', 'SessionCookieName', - 'SessionReferrerCheck', + 'SessionBrowserSignatureCheck', + 'SessionIPAddressCheck', 'CookieSessions', 'UseCronForRegularEvent', 'User_GuestGroup', @@ -82,6 +87,7 @@ 'Config_Server_Time', 'Config_Site_Time', 'UseChangeLog', + 'UseVisitorTracking', ); foreach ($config_vars as $var) { @@ -105,6 +111,7 @@ 'Application.ConfigCacheIds' => $this->Application->ConfigCacheIds, 'Application.ConfigHash' => $this->Application->ConfigHash, 'Application.ReplacementTemplates' => $this->Application->ReplacementTemplates, + 'Application.RewriteListeners' => $this->Application->RewriteListeners, 'Application.ModuleInfo' => $this->Application->ModuleInfo, ); @@ -153,6 +160,7 @@ $this->Application->ConfigCacheIds = $cache['Application.ConfigCacheIds']; $this->Application->ReplacementTemplates = $cache['Application.ReplacementTemplates']; + $this->Application->RewriteListeners = $cache['Application.RewriteListeners']; $this->Application->ModuleInfo = $cache['Application.ModuleInfo']; @@ -216,6 +224,9 @@ $base_folder = FULL_PATH . $folderPath . DIRECTORY_SEPARATOR; $sub_folders = glob($base_folder . '*', GLOB_ONLYDIR); + if (!$sub_folders) { + return ; + } if ($level == 0) { // don't scan Front-End themes because of extensive directory structure @@ -234,8 +245,10 @@ continue; } - if (file_exists(FULL_PATH . $this->getConfigName($folderPath . DIRECTORY_SEPARATOR . $sub_folder))) { - $this->configFiles[] = $this->getConfigName($folderPath . DIRECTORY_SEPARATOR . $sub_folder); + $config_name = $this->getConfigName($folderPath . DIRECTORY_SEPARATOR . $sub_folder); + + if (file_exists(FULL_PATH . $config_name)) { + $this->configFiles[] = $config_name; } $this->findConfigFiles($full_path, $level + 1); @@ -254,27 +267,22 @@ $conn =& $this->Application->GetADODBConnection(); if (!isset($this->Application->Memcached) || !($data = $this->Application->Memcached->get('master:config_files'))) { - $data = $conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"'); + $data = $conn->GetOne('SELECT Data FROM ' . TABLE_PREFIX . 'Cache WHERE VarName = "config_files"'); } + if ($cache && $data) { $this->configFiles = unserialize($data); shuffle($this->configFiles); } else { - $old_kernel_path = FULL_PATH . DIRECTORY_SEPARATOR . 'kernel' . DIRECTORY_SEPARATOR . 'kernel4'; - if (file_exists($old_kernel_path)) { - // when we got both kernel (one from "kernel/kernel4" and other from "core/kernel") version after upgrade - die('Please remove "' . $old_kernel_path . '" folder.'); - } - $this->findConfigFiles($folderPath); // search from base directory } foreach ($this->configFiles as $filename) { $prefix = $this->PreloadConfigFile($filename); if (!$prefix) { - trigger_error('Prefix not defined in config file '.$filename, E_USER_ERROR); + trigger_error('Prefix not defined in config file ' . $filename, E_USER_ERROR); } } } @@ -333,12 +341,14 @@ if ($store_cache || (defined('IS_INSTALL') && IS_INSTALL)) { // cache is not stored during install, but dynamic clones should be processed in any case $this->processDynamicClones(); + $this->retrieveCollections(); } if ($store_cache) { + $this->_sortRewriteListeners(); $this->CacheParsedData(); - if ($this->Application->isDebugMode(false) && constOn('DBG_VALIDATE_CONFIGS')) { + if (defined('DEBUG_MODE') && DEBUG_MODE && defined('DBG_VALIDATE_CONFIGS') && DBG_VALIDATE_CONFIGS) { // validate configs here to have changes from OnAfterConfigRead hooks to prefixes foreach ($this->configData as $prefix => $config) { if (!isset($config['TableName'])) continue; @@ -352,6 +362,34 @@ } /** + * Sort rewrite listeners according to RewritePriority (non-prioritized listeners goes first) + * + */ + function _sortRewriteListeners() + { + $listeners = Array (); + $prioritized_listeners = Array (); + + // process non-prioritized listeners + foreach ($this->Application->RewriteListeners as $prefix => $listener_data) { + if ($listener_data['priority'] === false) { + $listeners[$prefix] = $listener_data; + } + else { + $prioritized_listeners[$prefix] = $listener_data['priority']; + } + } + + // process prioritized listeners + asort($prioritized_listeners); + foreach ($prioritized_listeners as $prefix => $priority) { + $listeners[$prefix] = $this->Application->RewriteListeners[$prefix]; + } + + $this->Application->RewriteListeners = $listeners; + } + + /** * Re-reads all configs * */ @@ -376,6 +414,7 @@ $this->ParseConfigs(); $this->AfterConfigRead(false); $this->processDynamicClones(); + $this->retrieveCollections(); } /** @@ -405,6 +444,32 @@ } /** + * Process all collectable unit config options here to also catch ones, defined from OnAfterConfigRead events + * + */ + function retrieveCollections() + { + foreach ($this->configData as $prefix => $config) { + // collect replacement templates + if (array_key_exists('ReplacementTemplates', $config) && $config['ReplacementTemplates']) { + $this->Application->ReplacementTemplates = array_merge($this->Application->ReplacementTemplates, $config['ReplacementTemplates']); + } + + // collect rewrite listeners + if (array_key_exists('RewriteListener', $config) && $config['RewriteListener']) { + $rewrite_listener = $config['RewriteListener']; + if (strpos($rewrite_listener, ':') === false) { + $rewrite_listener = $prefix . '_EventHandler:' . $rewrite_listener; + } + + $rewrite_priority = array_key_exists('RewritePriority', $config) ? $config['RewritePriority'] : false; + + $this->Application->RewriteListeners[$prefix] = Array ('listener' => $rewrite_listener, 'priority' => $rewrite_priority); + } + } + } + + /** * Register nessasary classes * This method should only process the data which is cached! * @@ -415,6 +480,7 @@ { $config =& $this->configData[$prefix]; $event_manager =& $this->Application->recallObject('EventManager'); + /* @var $event_manager kEventManager */ $register_classes = getArrayValue($config,'RegisterClasses'); if (!$register_classes) $register_classes = Array(); @@ -451,11 +517,10 @@ } $regular_events = getArrayValue($config, 'RegularEvents'); - if($regular_events) - { - foreach($regular_events as $short_name => $regular_event_info) - { - $event_manager->registerRegularEvent( $short_name, $config['Prefix'].':'.$regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'] ); + if ($regular_events) { + foreach ($regular_events as $short_name => $regular_event_info) { + $event_status = array_key_exists('Status', $regular_event_info) ? $regular_event_info['Status'] : STATUS_ACTIVE; + $event_manager->registerRegularEvent( $short_name, $config['Prefix'].':'.$regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'], $event_status); } } @@ -513,11 +578,6 @@ $this->Application->registerAggregateTag($aggregate_tag); } } - - if (isset($config['ReplacementTemplates']) && $config['ReplacementTemplates']) { - // replacement templates defined in this config - $this->Application->ReplacementTemplates = array_merge_recursive2($this->Application->ReplacementTemplates, $config['ReplacementTemplates']); - } } function ValidateConfig($prefix) @@ -721,8 +781,18 @@ $config['AdminTemplatePath'] = $module_templates . $config['AdminTemplatePath']; } + if (array_key_exists($prefix, $this->prefixFiles) && ($this->prefixFiles[$prefix] != $filename)) { + trigger_error( + 'Single unit config prefix "' . $prefix . '" ' . + 'is used in multiple unit config files: ' . + '"' . $this->prefixFiles[$prefix] . '", "' . $filename . '"', + E_USER_WARNING + ); + } + $this->configData[$prefix] = $config; $this->prefixFiles[$prefix] = $filename; + return $prefix; } elseif ($prefix = array_search($filename, $this->prefixFiles)) { @@ -919,7 +989,4 @@ } } -} - - -?> \ No newline at end of file +} \ No newline at end of file Index: branches/5.1.x/core/units/general/libchart/classes/view/chart/Chart.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/chart/Chart.php (.../Chart.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/chart/Chart.php (.../Chart.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /*! \mainpage Libchart * * This is the reference API, automatically compiled by
    Doxygen. @@ -98,5 +100,4 @@ public function setTitle($title) { $this->plot->setTitle($title); } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/configuration/configuration.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/configuration/configuration.php (.../configuration.php) (revision 12127) +++ branches/5.1.x/core/units/configuration/configuration.php (.../configuration.php) (revision 12657) @@ -1,6 +1,6 @@ IDField] = $this->ID; return parent::GetKeyClause($method, $keys_hash); } - - } -?> \ No newline at end of file + /** + * Set's field error, if pseudo passed not found then create it with message text supplied. + * Don't owerrite existing pseudo translation. + * + * @param string $field + * @param string $pseudo + * @param string $error_label + */ + function SetError($field, $pseudo, $error_label = null, $error_params = null) + { + if (!parent::SetError($field, $pseudo, $error_label, $error_params)) { + // this field already has an error -> don't overwrite it + return false; + } + + $list_errors = $this->Application->GetVar('errors_' . $this->getPrefixSpecial(), Array ()); + $list_errors[ $this->GetDBField('VariableName') ] = $this->GetErrorMsg($field); + $this->Application->SetVar('errors_' . $this->getPrefixSpecial(), $list_errors); + } + + } \ No newline at end of file Index: branches/5.1.x/core/units/themes/themes_tag_processor.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 12127) +++ branches/5.1.x/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 12657) @@ -1,6 +1,6 @@ Application->BaseURL((defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . '/stylesheets'); - $css_path = rtrim( str_replace( $this->Application->BaseURL(), FULL_PATH.'/', $css_url), '/' ); + $css_url = $this->Application->BaseURL(WRITEBALE_BASE . '/stylesheets'); + $css_path = rtrim( str_replace( $this->Application->BaseURL(), FULL_PATH . '/', $css_url), '/' ); $last_compiled = $object->GetDBField('LastCompiled'); @@ -74,4 +76,3 @@ return $object->GetDBField('ThemeId') == $themes_helper->getCurrentThemeId(); } } -?> \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_manufacturer.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/general/libchart/classes/view/chart/VerticalBarChart.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/chart/VerticalBarChart.php (.../VerticalBarChart.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/chart/VerticalBarChart.php (.../VerticalBarChart.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * Chart composed of vertical bars. * @@ -209,5 +211,4 @@ $this->plot->render($fileName); } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon46_users_settings.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_users_settings.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_user_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/mailing_lists/mailing_lists_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/mailing_lists/mailing_lists_config.php (.../mailing_lists_config.php) (revision 12127) +++ branches/5.1.x/core/units/mailing_lists/mailing_lists_config.php (.../mailing_lists_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'mailing-list', 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -59,20 +61,21 @@ 'Sections' => Array ( 'in-portal:mailing_folder' => Array ( 'parent' => 'in-portal:users', - 'icon' => 'custom', + 'icon' => 'mailing_list', 'label' => 'la_title_MailingLists', + 'use_parent_header' => 1, 'permissions' => Array (), - 'priority' => 7, + 'priority' => 5, 'type' => stTREE, ), 'in-portal:mailing_lists' => Array ( 'parent' => 'in-portal:mailing_folder', - 'icon' => 'custom', + 'icon' => 'mailing_list', 'label' => 'la_title_MailingLists', 'url' => Array('t' => 'mailing_lists/mailing_list_list', 'pass' => 'm'), 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 7.1, + 'priority' => 5.1, // ., because this section replaces parent in tree 'type' => stTAB, ), ), @@ -104,7 +107,7 @@ 'Attachments' => Array ( 'type' => 'string', 'formatter' => 'kUploadFormatter', 'upload_dir' => ITEM_FILES_PATH, 'max_size' => 50000000, - 'multiple' => 10, 'direct_links' => true, 'file_types' => '*.*', 'files_description' => 'All Files', + 'multiple' => 10, 'direct_links' => true, 'file_types' => '*.*', 'files_description' => '!la_hint_AllFiles!', 'default' => NULL ), @@ -125,16 +128,16 @@ 'Grids' => Array ( 'Default' => Array ( - 'Icons' => Array ('default' => 'icon16_custom.gif'), + 'Icons' => Array ('default' => 'icon16_item.png'), 'Fields' => Array ( - 'MailingId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ), - 'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ), - 'MessageText' => Array ('title' => 'la_col_MessageText', 'filter_block' => 'grid_like_filter', 'cut_first' => 100), - 'MessageHtml' => Array ('title' => 'la_col_MessageHtml', 'filter_block' => 'grid_like_filter', 'cut_first' => 100), - 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter',), - 'EmailsQueued' => Array ('title' => 'la_col_EmailsQueued', 'filter_block' => 'grid_range_filter',), - 'EmailsSent' => Array ('title' => 'la_col_EmailsSent', 'filter_block' => 'grid_range_filter',), - 'EmailsTotal' => Array ('title' => 'la_col_EmailsTotal', 'filter_block' => 'grid_range_filter',), + 'MailingId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ), + 'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'MessageText' => Array ('title' => 'la_col_MessageText', 'filter_block' => 'grid_like_filter', 'cut_first' => 100, 'width' => 120, ), + 'MessageHtml' => Array ('title' => 'la_col_MessageHtml', 'filter_block' => 'grid_like_filter', 'cut_first' => 100, 'width' => 120, ), + 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ), + 'EmailsQueued' => Array ('title' => 'la_col_EmailsQueued', 'filter_block' => 'grid_range_filter', 'width' => 80, ), + 'EmailsSent' => Array ('title' => 'la_col_EmailsSent', 'filter_block' => 'grid_range_filter', 'width' => 80, ), + 'EmailsTotal' => Array ('title' => 'la_col_EmailsTotal', 'filter_block' => 'grid_range_filter', 'width' => 80, ), ), ), ), Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_view_item_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/tab_back.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/pdf/pdf_renderer_tcpdf.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/pdf/pdf_renderer_tcpdf.php (.../pdf_renderer_tcpdf.php) (revision 12127) +++ branches/5.1.x/core/units/pdf/pdf_renderer_tcpdf.php (.../pdf_renderer_tcpdf.php) (revision 12657) @@ -1,6 +1,6 @@ IncludeTCPDF(); - + $this->PDF = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true); $this->PDF->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $this->PDF->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $this->PDF->setPrintHeader(false); $this->PDF->setPrintFooter(false); $this->PDF->AddPage(); - + // $this->PDF->SetX(50); // $this->PDF->SetY(200); // $this->PDF->wr } - + function IncludeTCPDF() { static $included = false; @@ -88,26 +90,26 @@ $included = true; } } - + function NextPage() { $this->PDF->AddPage(); } - + function GetWidth() { return $this->PDF->getPageWidth(); } - + function GetHeight() { return $this->PDF->getPageHeight(); } - + function SetFont($family, $size, $weight=400, $style='normal', $variant='normal') { $this->CurFontSize = $size; - + $family = strtolower($family); switch ($family) { case 'serif': @@ -127,19 +129,19 @@ $font = 'FreeSans'; break; } - + $bold = $weight >= 700 ? 'B' : ''; $italic = preg_match('/italic|oblique/i', $style) ? 'I' : ''; - + return $this->PDF->SetFont($font, $bold.$italic, $size); } - + function SetFontSize($size) { $this->CurFontSize = $size; $this->PDF->SetFontSize($size); } - + function ProcessHTMLColor($color) { $mapping = array( 'maroon' => '#800000', @@ -173,30 +175,30 @@ return array(255,255,0); } - + function SetFillColor($color) { list($r,$g,$b) = $this->ProcessHTMLColor($color); $this->PDF->SetFillColor($r,$g,$b); $this->PDF->SetTextColor($r,$g,$b); } - + function SetLineColor($color) { list($r,$g,$b) = $this->ProcessHTMLColor($color); return $this->PDF->SetDrawColor($r,$g,$b); } - - function SetLineWidth($width) + + function SetLineWidth($width) { return $this->PDF->setLineWidth($width); } - + function DrawLine($x1, $y1, $x2, $y2) { return $this->PDF->Line($x1, $y1, $x2, $y2); } - + function DrawRectangle($x1, $y1, $x2, $y2, $mode='D') { switch ($mode) { @@ -209,18 +211,18 @@ case kPDFRenderer::SHAPE_DRAW_FILL_AND_STROKE : $mode = 'DF'; break; - + } $w = $x2-$x1; $h = $y2-$y1; return $this->PDF->Rect($x1, $y1, $w, $h, $mode); } - + function DrawText($text, $x, $y) { return $this->PDF->text($x, $y, $text); } - + function DrawImage($filepath, $x, $y, $w=0, $h=0) { $info = pathinfo($filepath); @@ -237,36 +239,36 @@ $im = @imagecreatefromgif ($filepath); imagepng($im, $converted_filepath); } - + return $this->PDF->Image($converted_filepath, $x, $y, $w, $h); } } - + function GetPDFString() { return $this->PDF->Output('', 'S'); } - + function GetAscent() { //$this->CurrentFont['desc'] $font = $this->PDF->GetFont(); return ($font['desc']['Ascent'] / 1000) * $this->CurFontSize; } - + function GetDescent() { $font = $this->PDF->GetFont(); return ($font['desc']['Descent'] / 1000) * $this->CurFontSize; } - + function GetLineGap() { return 0; $font = $this->PDF->GetFont(); return (($font['Ascent'] - $font['Descent'])*0 / 1000) * $this->CurFontSize; } - + function GetStringWidth($string) { return $this->PDF->GetStringWidth($string); Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_affiliate_payment_type.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/users/admins_edit.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/users/admins_edit.tpl (.../admins_edit.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/users/admins_edit.tpl (.../admins_edit.tpl) (revision 12657) @@ -51,13 +51,6 @@ a_toolbar.DisableButton('prev');
    - - addLoadEvent( - function() { - // fixes Firefox 2.0+ bug will password autocomplete - document.getElementById('').value = ''; - } - ); Index: branches/5.1.x/core/admin_templates/img/icons/icon46_visits.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/logs/email_logs/email_logs_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/logs/email_logs/email_logs_config.php (.../email_logs_config.php) (revision 12127) +++ branches/5.1.x/core/units/logs/email_logs/email_logs_config.php (.../email_logs_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'email-log', 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -72,14 +74,14 @@ 'Grids' => Array ( 'Default' => Array ( - 'Icons' => Array ('default' => 'icon16_custom.gif'), + 'Icons' => Array ('default' => 'icon16_item.png'), 'Fields' => Array ( - 'EmailLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter',), - 'fromuser' => Array ('title' => 'la_prompt_FromUsername', 'filter_block' => 'grid_like_filter', ), - 'addressto' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', ), - 'subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ), - 'event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', ), - 'timestamp' => Array ('title' => 'la_prompt_SentOn', 'filter_block' => 'grid_date_range_filter', ), + 'EmailLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ), + 'fromuser' => Array ('title' => 'la_prompt_FromUsername', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'addressto' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', 'width' => 200, ), + 'event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', 'width' => 170, ), + 'timestamp' => Array ('title' => 'la_prompt_SentOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), // 'EventParams' => Array ('title' => 'la_col_EventParams', 'filter_block' => 'grid_like_filter', ), ), ), Index: branches/5.1.x/core/admin_templates/img/logo_bg.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_update_rates_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/email_messages/email_message_tp.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/email_messages/email_message_tp.php (.../email_message_tp.php) (revision 12127) +++ branches/5.1.x/core/units/email_messages/email_message_tp.php (.../email_message_tp.php) (revision 12657) @@ -1,6 +1,6 @@ Conn->GetCol($sql); } - } -?> \ No newline at end of file + /** + * Removes "Enabled" column, when not in debug mode + * + * @param Array $params + */ + function ModifyUnitConfig($params) + { + if (!$this->Application->isDebugMode()) { + $grids = $this->Application->getUnitOption($this->Prefix, 'Grids'); + + foreach ($grids as $grid_name => $grid_data) { + if (array_key_exists('Enabled', $grid_data['Fields'])) { + unset($grids[$grid_name]['Fields']['Enabled']); + } + } + + $this->Application->setUnitOption($this->Prefix, 'Grids', $grids); + } + } + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon24_settings_custom.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_file_f2.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/users/user_edit_images.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/users/user_edit_images.tpl (.../user_edit_images.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/users/user_edit_images.tpl (.../user_edit_images.tpl) (revision 12657) @@ -41,7 +41,7 @@ a_toolbar.AddButton( new ToolBarSeparator('sep2') ); - a_toolbar.AddButton( new ToolBarButton('new_image', '', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { std_new_item('u-img', 'users/image_edit') } ) ); @@ -54,6 +54,25 @@ a_toolbar.AddButton( new ToolBarSeparator('sep3') ); + a_toolbar.AddButton( new ToolBarButton('approve', '', function() { + submit_event('u-img', 'OnMassApprove'); + } + ) ); + + a_toolbar.AddButton( new ToolBarButton('decline', '', function() { + submit_event('u-img', 'OnMassDecline'); + } + ) ); + + + a_toolbar.AddButton( new ToolBarButton('setprimary', '', function() { + submit_event('u-img','OnSetPrimary'); + } + ) ); + + a_toolbar.AddButton( new ToolBarSeparator('sep4') ); + + a_toolbar.AddButton( new ToolBarButton('move_up', '', function() { submit_event('u-img','OnMassMoveUp'); } @@ -64,12 +83,8 @@ } ) ); - a_toolbar.AddButton( new ToolBarButton('primary_image', '', function() { - submit_event('u-img','OnSetPrimary'); - } - ) ); - a_toolbar.AddButton( new ToolBarSeparator('sep4') ); + a_toolbar.AddButton( new ToolBarSeparator('sep5') ); a_toolbar.AddButton( new ToolBarButton('view', '', function() { show_viewmenu(a_toolbar,'view'); @@ -100,7 +115,7 @@ \ No newline at end of file Index: branches/5.1.x/core/install.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/install.php (.../install.php) (revision 12127) +++ branches/5.1.x/core/install.php (.../install.php) (revision 12657) @@ -1,6 +1,6 @@ Array ('check_paths', 'db_config', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish'), - 'clean_reinstall' => Array ('check_paths', 'clean_db', 'db_config', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish'), + 'fresh_install' => Array ('check_paths', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish'), + 'clean_reinstall' => Array ('check_paths', 'clean_db', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish'), 'already_installed' => Array ('check_paths', 'install_setup'), - 'upgrade' => Array ('check_paths', 'install_setup', 'upgrade_modules', 'finish'), - 'update_license' => Array ('check_paths', 'install_setup', 'select_license', 'download_license', 'select_domain', 'finish'), - 'db_reconfig' => Array ('check_paths', 'install_setup', 'db_reconfig', 'finish'), - 'fix_paths' => Array ('check_paths', 'install_setup', 'fix_paths', 'finish'), + 'upgrade' => Array ('check_paths', 'install_setup', 'upgrade_modules', 'security', 'finish'), + 'update_license' => Array ('check_paths', 'install_setup', 'select_license', /*'download_license',*/ 'select_domain', 'security', 'finish'), + 'db_reconfig' => Array ('check_paths', 'install_setup', 'db_reconfig', 'security', 'finish'), + 'fix_paths' => Array ('check_paths', 'install_setup', 'fix_paths', 'security', 'finish'), ); /** * Steps, that doesn't required admin to be logged-in to proceed * * @var Array */ - var $skipLoginSteps = Array ('check_paths', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish', -1); + var $skipLoginSteps = Array ('check_paths', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish', -1); /** * Steps, on which kApplication should not be initialized, because of missing correct db table structure @@ -106,6 +106,8 @@ '$1/images/emoticons', // for "In-Bulletin" '$1/images/manufacturers', // for "In-Commerce" '$1/images/manufacturers/resized', // for "In-Commerce" + '$1/images/polls', // for "In-Bulletin" + '$1/images/polls/resized', // for "In-Bulletin" '$1/backupdata', '$1/export', '$1/stylesheets', @@ -250,7 +252,7 @@ foreach ($this->writeableFolders as $folder_path) { $file_path = FULL_PATH . str_replace('$1', $writeable_base, $folder_path); if (file_exists($file_path) && !is_writable($file_path)) { - $this->errorMessage = 'Install cannot write to specified folder in the root directory of your installation'; + $this->errorMessage = '
    Installation can not continue until all required permissions are set correctly'; break; } } @@ -387,6 +389,59 @@ $this->errorMessage = 'Please select action to perform'; } break; + + case 'security': + // perform write check + if ($this->Application->GetVar('skip_security_check')) { + // administrator intensionally skips security checks + break; + } + + $write_check = true; + $check_paths = Array ('/', '/index.php', '/config.php', ADMIN_DIRECTORY . '/index.php'); + foreach ($check_paths as $check_path) { + $path_check_status = $this->toolkit->checkWritePermissions(FULL_PATH . $check_path); + + if (is_bool($path_check_status) && $path_check_status) { + $write_check = false; + break; + } + } + + // script execute check + if (file_exists(WRITEABLE . '/install_check.php')) { + unlink(WRITEABLE . '/install_check.php'); + } + + $fp = fopen(WRITEABLE . '/install_check.php', 'w'); + fwrite($fp, "Application->recallObject('CurlHelper'); + /* @var $curl_helper kCurlHelper */ + + $output = $curl_helper->Send($this->Application->BaseURL(WRITEBALE_BASE) . 'install_check.php'); + unlink(WRITEABLE . '/install_check.php'); + $execute_check = ($output !== 'OK'); + + $directive_check = true; + $ini_vars = Array ('register_globals' => false, 'open_basedir' => true, 'allow_url_fopen' => false); + foreach ($ini_vars as $var_name => $var_value) { + $current_value = ini_get($var_name); + + if (($var_value && !$current_value) || (!$var_value && $current_value)) { + $directive_check = false; + break; + } + } + + if (!$write_check || !$execute_check || !$directive_check) { + $this->errorMessage = true; + } + /*else { + $this->currentStep = $this->GetNextStep(); + }*/ + break; } $this->PerformValidation(); // returns validation status (just in case) @@ -457,20 +512,20 @@ break; case 'choose_modules': + break; + case 'upgrade_modules': $modules = $this->Application->GetVar('modules'); if (!$modules) { $modules = Array (); $this->errorMessage = 'Please select module(-s) to ' . ($this->currentStep == 'choose_modules' ? 'install' : 'upgrade'); } - if ($this->currentStep == 'choose_modules') { - // don't check interface modules during install, only for during upgrade - break; - } - // check interface module - if (!in_array('core', $modules)) { + $upgrade_data = $this->GetUpgradableModules(); + + if (array_key_exists('core', $upgrade_data) && !in_array('core', $modules)) { + // core can be upgraded, but isn't selected $this->errorMessage = 'Please select "Core" as interface module'; } @@ -531,6 +586,9 @@ // set module "Core" version after install (based on upgrade scripts) $this->toolkit->SetModuleVersion('Core'); + + // for now we set "In-Portal" module version to "Core" module version (during clean install) + $this->toolkit->SetModuleVersion('In-Portal', $this->toolkit->GetMaxModuleVersion('Core')); } break; @@ -680,7 +738,7 @@ if ($domain != '') { if (strstr($domain, $license_domain) || $modules_helper->_IsLocalSite($domain)) { - $this->toolkit->setSystemConfig('Intechnic', 'Domain', $domain); + $this->toolkit->setSystemConfig('Misc', 'Domain', $domain); $this->toolkit->SaveConfig(); } else { @@ -700,11 +758,18 @@ 'RootPass' => $password, 'Site_Path' => BASE_PATH.'/', // set Site_Path (for SSL & old in-portal code) 'Backup_Path' => FULL_PATH . $this->toolkit->getSystemConfig('Misc', 'WriteablePath') . DIRECTORY_SEPARATOR . 'backupdata', - 'Smtp_AdminMailFrom' => 'portal@' . $this->toolkit->getSystemConfig('Intechnic', 'Domain') + 'Smtp_AdminMailFrom' => 'portal@' . $this->toolkit->getSystemConfig('Misc', 'Domain') ); $this->toolkit->saveConfigValues($config_values); + // login as "root", when no errors on password screen + $this->Application->SetVar('login', 'root'); + $this->Application->SetVar('password', $this->Application->GetVar('root_password')); + + $login_event = new kEvent('u.current:OnLogin'); + $this->Application->HandleEvent($login_event); + // import base language for core (english) $this->toolkit->ImportLanguage('/core/install/english'); @@ -824,6 +889,11 @@ // after upgrade sqls are executed update version and upgrade language pack $this->toolkit->SetModuleVersion($module_name, $module_info['ToVersion']); } + + // for now we set "In-Portal" module version to "Core" module version (during upgrade) + if (in_array('core', $modules)) { + $this->toolkit->SetModuleVersion('In-Portal', $upgrade_data['core']['ToVersion']); + } } break; @@ -1074,8 +1144,8 @@ if (!isset($modules)) { $modules = Array(); $fh = opendir(MODULES_PATH); - while (($sub_folder = readdir($fh))) { - $folder_path = MODULES_PATH.'/'.$sub_folder; + while ( ($sub_folder = readdir($fh)) ) { + $folder_path = MODULES_PATH . '/'.$sub_folder; if ($sub_folder != '.' && $sub_folder != '..' && is_dir($folder_path)) { if ($sub_folder == 'core') { // skip modules here @@ -1336,5 +1406,32 @@ $this->Done($errstr); } } + + /** + * Checks, that given button should be visible on current installation step + * + * @param string $name + * @return bool + */ + function buttonVisible($name) + { + $button_visibility = Array ( + 'continue' => $this->GetNextStep() != -1 || ($this->stepsPreset == 'already_installed'), + 'refresh' => in_array($this->currentStep, Array ('check_paths', 'security')), + 'back' => in_array($this->currentStep, Array (/*'select_license',*/ 'download_license', 'select_domain')), + ); + + if ($name == 'any') { + foreach ($button_visibility as $button_name => $button_visible) { + if ($button_visible) { + return true; + } + } + + return false; + } + + return array_key_exists($name, $button_visibility) ? $button_visibility[$name] : true; + } } ?> \ No newline at end of file Index: branches/5.1.x/core/admin_templates/js/forms.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/forms.js (.../forms.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/forms.js (.../forms.js) (revision 12657) @@ -62,8 +62,8 @@ // process all FCKEditor instances var iframes = document.getElementsByTagName('IFRAME'); - for (var i=0; iValidate()) return false; - $this->SetDBField('ResourceId', $this->Application->NextResourceId()); + class GroupsItem extends kDBItem { - return parent::Create(); - } + function Create($force_id = false, $system_create = false) + { + if (!$this->Validate()) return false; + $this->SetDBField('ResourceId', $this->Application->NextResourceId()); - function Update($id = null, $system_update = false) - { - $this->VirtualFields['ResourceId'] = Array(); - $ret = parent::Update($id, $system_update); - unset($this->VirtualFields['ResourceId']); - - return $ret; - } -} + return parent::Create(); + } -?> \ No newline at end of file + function Update($id = null, $system_update = false) + { + $this->VirtualFields['ResourceId'] = Array(); + $ret = parent::Update($id, $system_update); + unset($this->VirtualFields['ResourceId']); + + return $ret; + } + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_option.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_catalog.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/install/install_toolkit.php =================================================================== diff -u -N -r12453 -r12657 --- branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 12453) +++ branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 12657) @@ -1,6 +1,6 @@ Conn->Query($sql); } @@ -305,13 +308,27 @@ } $sqls = str_replace("\r\n", "\n", $sqls); // convert to linux line endings - $sqls = preg_replace("/#([^;]*?)\n/", '', $sqls); // remove all comments - $sqls = explode(";\n", $sqls . "\n"); // ensures that last sql won't have ";" in it + $no_comment_sqls = preg_replace("/#\s([^;]*?)\n/is", '', $sqls); // remove all comments "#" on new lines + if ($no_comment_sqls === null) { + // "ini.pcre.backtrack-limit" reached and error happened + $sqls = explode(";\n", $sqls . "\n"); // ensures that last sql won't have ";" in it + $sqls = array_map('trim', $sqls); + + // remove all comments "#" on new lines (takes about 2 seconds for 53000 sqls) + $sqls = preg_replace("/#\s([^;]*?)/", '', $sqls); + } + else { + $sqls = explode(";\n", $no_comment_sqls . "\n"); // ensures that last sql won't have ";" in it + $sqls = array_map('trim', $sqls); + } + + $sql_count = count($sqls); $db_collation = $this->getSystemConfig('Database', 'DBCollation'); - for ($i=$start_from; $iApplication->getUnitOption('theme', 'TableName'); $sql = 'SELECT Name, ' . $id_field . ' - FROM ' . $table_name; + FROM ' . $table_name . 'ORDER BY Name ASC'; return $this->Conn->GetCol($sql, $id_field); } @@ -539,14 +556,88 @@ */ function getModuleName($module_folder) { - if ($module_folder == 'kernel') { - $module_folder = 'in-portal'; + return implode('-', array_map('ucfirst', explode('-', $module_folder))); + } + + /** + * Returns information about module (based on "install/module_info.xml" file) + * + * @param string $module_folder + * @return Array + */ + function getModuleInfo($module_folder) + { + $info_file = MODULES_PATH . '/' . $module_folder . '/install/module_info.xml'; + + if (!file_exists($info_file)) { + return Array (); } - return implode('-', array_map('ucfirst', explode('-', $module_folder))); + $xml_helper =& $this->Application->recallObject('kXMLHelper'); + /* @var $xml_helper kXMLHelper */ + + $root_node =& $xml_helper->Parse( file_get_contents($info_file) ); + + if (!is_object($root_node) || !preg_match('/^kxmlnode/i', get_class($root_node)) || ($root_node->Name == 'ERROR')) { + // non-valid xml file + return Array (); + } + + $ret = Array (); + $current_node =& $root_node->firstChild; + + do { + $ret[ strtolower($current_node->Name) ] = trim($current_node->Data); + } while (($current_node =& $current_node->NextSibling())); + + return $ret; } /** + * Returns nice module string to be used on install/upgrade screens + * + * @param string $module_folder + * @param string $version_string + * @return string + */ + function getModuleString($module_folder, $version_string) + { + // image (if exists) ( ) + + $ret = Array (); + $module_info = $this->getModuleInfo($module_folder); + + if (array_key_exists('name', $module_info) && $module_info['name']) { + $module_name = $module_info['name']; + } + else { + $module_name = $this->getModuleName($module_folder); + } + + if (array_key_exists('image', $module_info) && $module_info['image']) { + $image_src = $module_info['image']; + + if (!preg_match('/^(http|https):\/\//', $image_src)) { + // local image -> make absolute url + $image_src = $this->Application->BaseURL() . $image_src; + } + + $ret[] = '' . htmlspecialchars($module_name) . ''; + } + + if (array_key_exists('description', $module_info) && $module_info['description']) { + $ret[] = $module_info['description']; + } + else { + $ret[] = $module_name; + } + + $ret[] = '(' . $module_name . ' ' . $version_string . ')'; + + return implode(' ', $ret); + } + + /** * Creates module root category in "Home" category using given data and returns it * * @param string $name @@ -571,7 +662,7 @@ $category_fields = Array ( $fields['name'] => $name, 'Filename' => $name, 'AutomaticFilename' => 1, - $fields['description'] => $description, 'Status' => $status, 'Priority' => -9999, + $fields['description'] => $description, 'Status' => STATUS_ACTIVE, 'Priority' => -9999, ); $category_fields['ParentId'] = $this->Application->findModule('Name', 'Core', 'RootCat'); @@ -732,4 +823,21 @@ { $this->Application->HandleEvent($themes_event, 'adm:OnRebuildThemes'); } + + /** + * Checks that file is writable by group or others + * + * @param string $file + * @return boolean + */ + function checkWritePermissions($file) + { + if (DIRECTORY_SEPARATOR == '\\') { + // windows doen't allow to check permissions (always returns null) + return null; + } + + $permissions = fileperms($file); + return $permissions & 0x0010 || $permissions & 0x0002; + } } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/tab_back.jpg =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/pdf/pdf_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/pdf/pdf_config.php (.../pdf_config.php) (revision 12127) +++ branches/5.1.x/core/units/pdf/pdf_config.php (.../pdf_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'pdf', 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), Index: branches/5.1.x/core/units/user_profile/user_profile_tp.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 12127) +++ branches/5.1.x/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon24_sessions_log.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon46_email_log.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/statistics/statistics_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/statistics/statistics_config.php (.../statistics_config.php) (revision 12127) +++ branches/5.1.x/core/units/statistics/statistics_config.php (.../statistics_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'stat', 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), @@ -61,7 +63,7 @@ 'Grids' => Array( 'Default' => Array( - 'Icons' => Array('default' => 'icon16_custom.gif'), + 'Icons' => Array('default' => 'icon16_item.png'), 'Fields' => Array( 'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_checkbox_td'), 'LastName' => Array( 'title'=>'la_col_LastName'), @@ -72,6 +74,4 @@ ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/tools/backup3.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/tools/backup3.tpl (.../backup3.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/tools/backup3.tpl (.../backup3.tpl) (revision 12657) @@ -34,7 +34,7 @@ "> -
    +

    M Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_conf.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/tools/cron.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/tools/cron.php (.../cron.php) (revision 12127) +++ branches/5.1.x/tools/cron.php (.../cron.php) (revision 12657) @@ -1,6 +1,6 @@ /tools/cron.php -O /dev/null > /dev/null 2>&1 + // Use this line to invoke from cron. + // wget http:///tools/cron.php -O /dev/null > /dev/null 2>&1 -define('FULL_PATH', realpath(dirname(__FILE__).'/..')); -define('REL_PATH', 'tools/'); -define('ADMIN', 1); + $start = getmicrotime(); -include_once(FULL_PATH.'/core/kernel/startup.php'); + define('CRON', 1); + define('ADMIN', 1); + define('REL_PATH', 'tools'); + define('FULL_PATH', realpath(dirname(__FILE__) . '/..')); + define('CMD_MODE', isset($argv) && count($argv) ? 1 : 0); -$application =& kApplication::Instance(); -$application->Init(); + if (CMD_MODE) { + define('DBG_SKIP_REPORTING', 1); + $_SERVER['HTTP_USER_AGENT'] = 'gecko'; + $_SERVER['HTTP_HOST'] = 'localhost'; + } -$event_manager =& $application->recallObject('EventManager'); -$event_manager->RunRegularEvents(reBEFORE, true); -$event_manager->RunRegularEvents(reAFTER, true); + include_once(FULL_PATH . '/core/kernel/startup.php'); -function getmicrotime() -{ - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); -} + $application =& kApplication::Instance(); + $application->Init(); -?> \ No newline at end of file + // events from request are not processed, only predefined regular events + $application->EventManager->RunRegularEvents(reBEFORE, true); + $application->EventManager->RunRegularEvents(reAFTER, true); + + $application->Done(); + + $end = getmicrotime(); + + function getmicrotime() + { + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_new.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/mailing_lists/mailing_list_tp.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/mailing_lists/mailing_list_tp.php (.../mailing_list_tp.php) (revision 12127) +++ branches/5.1.x/core/units/mailing_lists/mailing_list_tp.php (.../mailing_list_tp.php) (revision 12657) @@ -1,6 +1,6 @@ Prefix != 'c') { - return parent::ItemIcon($params); + $grids = $this->Application->getUnitOption($this->Prefix, 'Grids'); + $grid = $grids[ $params['grid'] ]; + + if (!array_key_exists('Icons', $grid)) { + return ''; } + $icons = $grid['Icons']; + + if (array_key_exists('name', $params)) { + $icon_name = $params['name']; + return array_key_exists($icon_name, $icons) ? $icons[$icon_name] : ''; + } + $object =& $this->getObject($params); - if ($object->GetDBField('IsMenu')) { - $status = $object->GetDBField('Status'); - if ($status == 1) { - $ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_folder.gif'; - } - else { - $ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif'; - } + /* @var $object kDBList */ + + if ($object->GetDBField('CreatedBySystem')) { + return 'icon16_section_system.png'; } - else { - $ret = 'icon16_folder-red.gif'; + + $status = $object->GetDBField('Status'); + + if ($status == STATUS_DISABLED) { + return 'icon16_section_disabled.png'; } - return $ret; + if (!$object->GetDBField('IsMenu')) { + return 'icon16_section_menuhidden.png'; + } + + if ($status == STATUS_PENDING) { + return 'icon16_section_pending.png'; + } + + if ($object->GetDBField('IsNew')) { + return 'icon16_section_new.png'; + } + + return 'icon16_section.png'; } function ItemCount($params) @@ -182,7 +202,7 @@ $cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List'); $sql = 'SELECT '.$this->getTitleField().' FROM '.$cat_object->TableName.' - WHERE CategoryId = '.$this->Application->GetVar('m_cat_id'); + WHERE CategoryId = '.(int)$this->Application->GetVar('m_cat_id'); return $this->Conn->GetOne($sql); } @@ -601,10 +621,13 @@ function CatalogItemCount($params) { + $params['skip_quering'] = true; $object =& $this->GetList($params); + if (!$object->Counted) { $object->CountRecs(); } + return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount; } @@ -673,7 +696,7 @@ if (!isset($current_path)) { $sql = 'SELECT ParentPath FROM ' . TABLE_PREFIX . 'Category - WHERE CategoryId = ' . $this->Application->GetVar('m_cat_id'); + WHERE CategoryId = ' . (int)$this->Application->GetVar('m_cat_id'); $current_path = $this->Conn->GetOne($sql); } @@ -1033,7 +1056,12 @@ } else { // no relation with current category object -> query from db - $sql = 'SELECT l' . $this->Application->GetVar('m_lang') . '_CachedNavbar + $language_id = (int)$this->Application->GetVar('m_lang'); + if (!$language_id) { + $language_id = 1; + } + + $sql = 'SELECT l' . $language_id . '_CachedNavbar FROM ' . $object->TableName . ' WHERE ' . $object->IDField . ' = ' . $category_id; $cached_navbar = $this->Conn->GetOne($sql); @@ -1135,7 +1163,7 @@ $edit_code_before = $edit_code_after = ''; - if (EDITING_MODE == EDITING_MODE_CMS) { + if (EDITING_MODE == EDITING_MODE_CONTENT) { $bg_color = isset($params['bgcolor']) ? $params['bgcolor'] : '#ffffff'; $url_params = Array ( 'pass' => 'm,c,content', @@ -1162,11 +1190,11 @@ $edit_url = $this->Application->HREF('categories/edit_content', ADMIN_DIRECTORY, $url_params, 'index.php'); $edit_code_before = '
    -
    +
    - +
    -
    Edit '.(defined('DEBUG_MODE') && DEBUG_MODE ? " - #{$num}" : '').'
    +
    ' . $this->Application->Phrase('la_btn_EditContent', false) . ' '.(defined('DEBUG_MODE') && DEBUG_MODE ? " - #{$num}" : '').'
    '; @@ -1331,7 +1359,7 @@ $ret = '' . "\n"; $ret .= '' . "\n"; - if (EDITING_MODE == EDITING_MODE_LAYOUT) { + if (EDITING_MODE == EDITING_MODE_DESIGN) { $ret .= ' '; @@ -1345,49 +1373,56 @@ $ret .= '' . "\n"; $ret .= '' . "\n"; $ret .= '' . "\n"; - // add form, so admin scripts could work - $ret .= '
    - - -
    '; + if (EDITING_MODE != EDITING_MODE_BROWSE) { + // add form, so admin scripts could work + $ret .= '
    + + +
    '; + } return $ret; } @@ -1409,48 +1444,79 @@ $page =& $this->_getPage($params); - if (!$page->isLoaded()) { + if (!$page->isLoaded() || (($display_mode != 'end') && (EDITING_MODE == EDITING_MODE_BROWSE))) { // when "EditingScripts" tag is not used, make sure, that scripts are also included return $this->EditingScripts($params); } // show "EditPage" button only for pages, that exists in structure if ($display_mode != 'end') { - $url_params = Array( - 'pass' => 'm,c', - 'm_opener' => 'd', - 'c_id' => $page->GetID(), - 'c_mode' => 't', - 'c_event' => 'OnEdit', - 'front' => 1, - '__URLENCODE__' => 1, - '__NO_REWRITE__'=> 1, - 'escape' => 1, - 'index_file' => 'index.php', - ); + $edit_btn = ''; - $edit_url = $this->Application->HREF('categories/categories_edit', '/admin', $url_params); + if (EDITING_MODE == EDITING_MODE_CONTENT) { + $url_params = Array( + 'pass' => 'm,c', + 'm_opener' => 'd', + 'c_id' => $page->GetID(), + 'c_mode' => 't', + 'c_event' => 'OnEdit', + 'front' => 1, + '__URLENCODE__' => 1, + '__NO_REWRITE__'=> 1, + 'escape' => 1, + 'index_file' => 'index.php', + ); - $edit_btn = ''; + $edit_url = $this->Application->HREF('categories/categories_edit', ADMIN_DIRECTORY, $url_params); - if (EDITING_MODE == EDITING_MODE_LAYOUT) { $edit_btn .= ' -
    +
    - +
    -
    Save Layout
    +
    ' . $this->Application->Phrase('la_btn_SectionProperties', false) . '
    ' . "\n"; - } + } elseif (EDITING_MODE == EDITING_MODE_DESIGN) { + $url_params = Array( + 'pass' => 'm,theme', + 'm_opener' => 'd', + 'theme_id' => $this->Application->GetVar('m_theme'), + 'theme_mode' => 't', + 'theme_event' => 'OnEdit', + 'theme-file_id' => $this->_getThemeFileId(), + 'front' => 1, + '__URLENCODE__' => 1, + '__NO_REWRITE__'=> 1, + 'escape' => 1, + 'index_file' => 'index.php', + ); - $edit_btn .= ' -
    -
    - + $edit_url = $this->Application->HREF('themes/file_edit', ADMIN_DIRECTORY, $url_params); + + $edit_btn .= ' +
    +
    +
    + +
    +
    ' . $this->Application->Phrase('la_btn_SaveChanges', false) . '
    +
    +
    +
    + +
    +
    ' . $this->Application->Phrase('la_btn_Cancel', false) . '
    +
    -
    Section Properties
    -
    ' . "\n"; +
    +
    + +
    +
    ' . $this->Application->Phrase('la_btn_SectionTemplate', false) . '
    +
    ' . "\n"; + } + if ($display_mode == 'start') { // button with border around the page $edit_code .= '
    ' . $edit_btn . '
    '; @@ -1477,6 +1543,26 @@ return $edit_code; } + function _getThemeFileId() + { + $template = $this->Application->GetVar('t'); + + if (!$this->Application->TemplatesCache->TemplateExists($template) && !$this->Application->IsAdmin()) { + $cms_handler =& $this->Application->recallObject($this->Prefix . '_EventHandler'); + /* @var $cms_handler CategoriesEventHandler */ + + $template = ltrim($cms_handler->GetDesignTemplate(), '/'); + } + + $file_path = dirname($template) == '.' ? '' : '/' . dirname($template); + $file_name = basename($template); + + $sql = 'SELECT FileId + FROM ' . TABLE_PREFIX . 'ThemeFiles + WHERE (FilePath = ' . $this->Conn->qstr($file_path) . ') AND (FileName = ' . $this->Conn->qstr($file_name . '.tpl') . ')'; + return $this->Conn->GetOne($sql); + } + /** * Builds cached menu version * @@ -1736,10 +1822,18 @@ { $object =& $this->getObject($params); - $template = $object->GetDBField('NamedParentPath'); - $url_params = Array ('admin' => 1, 'pass' => 'm', 'm_cat_id' => $object->GetID(), 'index_file' => 'index.php'); + $themes_helper =& $this->Application->recallObject('ThemesHelper'); + /* @var $themes_helper kThemesHelper */ - return $this->Application->HREF($template, '_FRONT_END_', $url_params); + $url_params = Array ( + 'm_cat_id' => $object->GetID(), + 'm_theme' => $themes_helper->getCurrentThemeId(), + 'pass' => 'm', + 'admin' => 1, + 'index_file' => 'index.php' + ); + + return $this->Application->HREF($object->GetDBField('NamedParentPath'), '_FRONT_END_', $url_params); } /** @@ -1941,8 +2035,12 @@ $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); - $language = $this->Application->GetVar('m_lang'); + $language = (int)$this->Application->GetVar('m_lang'); + if (!$language) { + $language = 1; + } + $sql = 'SELECT l'.$language.'_Name AS Name, NamedParentPath FROM '.$table_name.' WHERE '.$id_field.' IN ('.implode(',', $category_ids).')'; Index: branches/5.1.x/core/admin_templates/img/icons/icon24_structure.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/admin/index.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/admin/index.php (.../index.php) (revision 12127) +++ branches/5.1.x/admin/index.php (.../index.php) (revision 12657) @@ -1,6 +1,6 @@
    It\'s not safe to run with write permissions (777) on "/config.php" file and root folder of In-Portal installation!

    Please change permissions from 777 to 775 (or 755) and try again!
    '); - } - } - $application =& kApplication::Instance(); $application->Init(); $application->Run(); @@ -39,19 +29,4 @@ { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); - } - - //update_memory_check_script(); - - function update_memory_check_script() { - $files = get_included_files(); - $script = '$files = Array('."\n"; - foreach ($files as $file_name) { - $script .= "\t\t'".str_replace(FULL_PATH, '', $file_name)."',\n"; - } - $script .= ");\n"; - echo "
    ";
    -		echo $script;
    -		echo "
    "; - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_spelling_dictionary.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_users_settings.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/themes/template_edit.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/themes/template_edit.tpl (.../template_edit.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/themes/template_edit.tpl (.../template_edit.tpl) (revision 12657) @@ -15,10 +15,19 @@ } ) ); - a_toolbar.AddButton( new ToolBarButton('cancel', '', function() { - submit_event('theme-file', 'OnGoBack'); + a_toolbar.AddButton( + new ToolBarButton( + 'cancel', + '', + function() { + + window_close(); + + submit_event('theme-file', 'OnGoBack'); + } - ) ); + ) + ); a_toolbar.Render(); @@ -39,7 +48,13 @@ - + + + + + + +
    Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_agent.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/general/libchart/classes/view/caption/Caption.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/general/libchart/classes/view/caption/Caption.php (.../Caption.php) (revision 12127) +++ branches/5.1.x/core/units/general/libchart/classes/view/caption/Caption.php (.../Caption.php) (revision 12657) @@ -17,6 +17,8 @@ * */ + defined('FULL_PATH') or die('restricted access!'); + /** * Caption. * @@ -108,5 +110,4 @@ public function setColorSet($colorSet) { $this->colorSet = $colorSet; } - } -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_theme_f3.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_theme_primary.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/admin_templates/img/icons/icon24_visits.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/kernel/utility/debugger/debugger_responce.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/utility/debugger/debugger_responce.php (.../debugger_responce.php) (revision 12127) +++ branches/5.1.x/core/kernel/utility/debugger/debugger_responce.php (.../debugger_responce.php) (revision 12657) @@ -1,6 +1,6 @@ \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/admin_templates/img/icons/icon24_link_editor.gif =================================================================== diff -u -N -r12127 -r12657 Binary files differ Index: branches/5.1.x/core/units/files/files_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/files/files_config.php (.../files_config.php) (revision 12127) +++ branches/5.1.x/core/units/files/files_config.php (.../files_config.php) (revision 12657) @@ -1,6 +1,6 @@ '#file', 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), @@ -83,14 +85,12 @@ 'Grids' => Array ( 'Default' => Array ( - 'Icons' => Array (1 => 'icon16_file.gif', 0 => 'icon16_file_disabled.gif'), + 'Icons' => Array (1 => 'icon16_item.png', 0 => 'icon16_disabled.png'), 'Fields' => Array( 'FileId' => Array ('title' => 'la_col_Id' , 'data_block' => 'grid_checkbox_td', 'module' => 'In-Portal', 'filter_block' => 'grid_range_filter'), 'FileName' => Array ('title' => 'la_col_FileName', 'filter_block' => 'grid_like_filter'), 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'), ), ), ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/js/uploader/uploader.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/uploader/uploader.js (.../uploader.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/uploader/uploader.js (.../uploader.js) (revision 12657) @@ -207,7 +207,7 @@ this.swf.addVariable('debugEnabled', escape('true')); // flash var } - if (this.params.buttonPlaceholderId === false) { + if (this.params.buttonPlaceholderId === false || !UploadsManager.useTransparency) { // only write flash, when button placeholder is not used this.swf.write(holder); this.flash = document.getElementById(this.flash_id); @@ -234,7 +234,7 @@ Uploader.prototype.moveOutside = function() { // move flash outside scroll_container, but keeps it's position on screen - if (!UploadsManager.useTransparency) { + if (!UploadsManager.useTransparency || this._moved) { // moving only needed when transparency us used (e.g. in admin) return ; } @@ -364,7 +364,7 @@ this._prepareFiles(); // sync position of all uploaders below current, because file queue height change will not affect their positions - UploadsManager.iterate('syncBrowseButton'); + UploadsManager.iterate('syncBrowseButton', 0); } Uploader.prototype.removeFile = function (file) { Index: branches/5.1.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12127) +++ branches/5.1.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Array('self' => 'view', 'subitem' => 'view'), 'OnItemBuild' => Array('self' => 'view', 'subitem' => 'view'), + 'OnSuggestValues' => Array('self' => 'view', 'subitem' => 'view'), 'OnBuild' => Array('self' => true), @@ -267,9 +270,17 @@ $ids = $event->getEventParam('ids'); if (isset($direct_ids) || ($ids !== false)) { - // save ids directly if they given - $this->Application->StoreVar($session_name, implode(',', $direct_ids ? $direct_ids : $ids)); - return $direct_ids ? $direct_ids : $ids; + // save ids directly if they given + reset array indexes + $resulting_ids = $direct_ids ? array_values($direct_ids) : ($ids ? array_values($ids) : false); + if ($resulting_ids) { + $this->Application->SetVar($event->getPrefixSpecial() . '_selected_ids', implode(',', $resulting_ids)); + $this->Application->LinkVar($event->getPrefixSpecial() . '_selected_ids', $session_name); + $this->Application->SetVar($event->getPrefixSpecial() . '_id', $resulting_ids[0]); + + return $resulting_ids; + } + + return Array (); } $ret = Array(); @@ -298,7 +309,7 @@ $ret = array_unique(array_merge($ret, $ids)); $this->Application->SetVar($event->getPrefixSpecial().'_selected_ids', implode(',',$ret)); - $this->Application->LinkVar($event->getPrefixSpecial().'_selected_ids', $session_name); + $this->Application->LinkVar($event->getPrefixSpecial().'_selected_ids', $session_name, '', !$ret); // optional when IDs are missing // This is critical - otherwise getPassedID will return last ID stored in session! (not exactly true) // this smells... needs to be refactored @@ -465,6 +476,8 @@ $this->Application->SetVar('t', $error_template); $this->Application->SetVar('m_cat_id', $themes_helper->getPageByTemplate($error_template)); + // in case if missing item is recalled first from event (not from template) + $this->Application->InitParser(); $this->Application->HTML = $this->Application->ParseBlock( Array ('name' => $error_template) ); $this->Application->Done(); exit; @@ -499,7 +512,10 @@ $this->LoadItem($event); $status_checked = true; - if ($user_id != -1 && !$this->Application->IsAdmin() && !$this->checkItemStatus($event)) { + $editing_mode = defined('EDITING_MODE') ? EDITING_MODE : false; + + if ($user_id != -1 && !$this->Application->IsAdmin() && !($editing_mode || $this->checkItemStatus($event))) { + // non-root user AND on front-end AND (not editing mode || incorrect status) $perm_status = false; } } @@ -699,7 +715,7 @@ $object =& $event->getObject(); $object->SetPerPage($per_page); - $this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1); + $this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1, true); // true for optional $page = $this->Application->GetVar($event->getPrefixSpecial().'_Page'); if (!$page) { @@ -1144,27 +1160,25 @@ $object =& $event->getObject( Array('skip_autoload' => true) ); $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if($items_info) - { - foreach($items_info as $id => $field_values) - { + if ($items_info) { + foreach ($items_info as $id => $field_values) { $object->Load($id); $object->SetFieldsFromHash($field_values); $this->customProcessing($event, 'before'); - if( $object->Update($id) ) - { + + if ( $object->Update($id) ) { $this->customProcessing($event, 'after'); - $event->status=erSUCCESS; + $event->status = erSUCCESS; } - else - { - $event->status=erFAIL; - $event->redirect=false; + else { + $event->status = erFAIL; + $event->redirect = false; break; } } } - $event->redirect_params = Array('opener'=>'u'); + + $event->SetRedirectParam('opener', 'u'); } /** @@ -2304,7 +2318,7 @@ return ; } - $tmp_path = defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/'; + $tmp_path = WRITEABLE . '/tmp/'; $fname = $value['name']; $id = $this->Application->GetVar('id'); if ($id) { @@ -2385,18 +2399,28 @@ */ function OnViewFile(&$event) { - if (strpos($this->Application->GetVar('file'), '../') !== false) return ; + $file = $this->Application->GetVar('file'); + if ((strpos($file, '../') !== false) || (trim($file) !== $file)) { + // when relative paths or special chars are found template names from url, then it's hacking attempt + return ; + } + if ($this->Application->GetVar('tmp')) { - $path = (defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/').$this->Application->GetVar('id').'_'.$this->Application->GetVar('file'); + $path = WRITEABLE . '/tmp/' . $this->Application->GetVar('id') . '_' . $this->Application->GetVar('file'); } else { $object =& $event->getObject(array('skip_autoload'=>true)); $options = $object->GetFieldOptions($this->Application->GetVar('field')); - $path = FULL_PATH.$options['upload_dir'].$this->Application->GetVar('file'); + $path = FULL_PATH.$options['upload_dir'].$file; } $path = str_replace('/', DIRECTORY_SEPARATOR, $path); + + if (!file_exists($path)) { + exit; + } + $type = mime_content_type($path); header('Content-Length: '.filesize($path)); @@ -2428,35 +2452,44 @@ */ function OnSuggestValues(&$event) { - $this->Application->XMLHeader(); + if (!$this->Application->IsAdmin() || !$this->Application->LoggedIn()) { + // very careful here, because this event allows to + // view every object field -> limit only to logged-in admins + return ; + } + $event->status = erSTOP; + $field = $this->Application->GetVar('field'); $cur_value = $this->Application->GetVar('cur_value'); - if (!$field || !$cur_value) { - exit; + + $object =& $event->getObject(); + + if (!$field || !$cur_value || !array_key_exists($field, $object->Fields)) { + return ; } $limit = $this->Application->GetVar('limit'); if (!$limit) { $limit = 20; } - $object =& $event->getObject(); $sql = 'SELECT DISTINCT '.$field.' FROM '.$object->TableName.' WHERE '.$field.' LIKE '.$this->Conn->qstr($cur_value.'%').' ORDER BY '.$field.' LIMIT 0,' . $limit; - $data = $this->Conn->GetCol($sql); + $this->Application->XMLHeader(); + echo ''; + foreach ($data as $item) { echo '' . htmlspecialchars($item) . ''; } - echo ''; - $event->status = erSTOP; + echo ''; } /** @@ -2495,7 +2528,4 @@ // abstract, for hooking } - } - - -?> \ No newline at end of file + } \ No newline at end of file Index: branches/5.1.x/core/units/form_fields/form_fields_config.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/form_fields/form_fields_config.php (.../form_fields_config.php) (revision 12127) +++ branches/5.1.x/core/units/form_fields/form_fields_config.php (.../form_fields_config.php) (revision 12657) @@ -1,6 +1,6 @@ 'formflds', 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), @@ -62,7 +64,11 @@ 'FieldLabel' => Array('type' => 'string', 'required' => 1, 'default' => null), 'Heading' => Array('type' => 'string', 'default' => null), 'Prompt' => Array('type' => 'string', 'default' => null, 'required' => 1), - 'ElementType' => Array('required'=>'1', 'type'=>'string', 'not_null '=> 1, 'default'=>'', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array('' => 'la_EmptyValue', 'text' => 'la_type_text', 'select' => 'la_type_select', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_SingleCheckbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea', 'label' => 'la_type_label')), + 'ElementType' => Array( + 'type' => 'string', + 'formatter' => 'kOptionsFormatter', 'options' => Array ('' => 'la_EmptyValue', 'text' => 'la_type_text', 'select' => 'la_type_select', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_SingleCheckbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea', 'label' => 'la_type_label'), 'use_phrases' => 1, + 'required' => 1, 'not_null' => 1, 'default' => '', + ), 'ValueList' => Array('type' => 'string','default' => null), 'Priority' => Array('type' => 'int','not_null' => 1, 'default' => 0), 'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), @@ -80,18 +86,16 @@ ), 'Grids' => Array( 'Default' => Array( - 'Icons' => Array('default'=>'icon16_custom.gif'), + 'Icons' => Array('default'=>'icon16_item.png'), 'Fields' => Array( - 'FormFieldId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'), - 'FieldName' => Array( 'title'=>'la_prompt_FieldName', 'filter_block' => 'grid_like_filter'), - 'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'label_grid_data_td', 'filter_block' => 'grid_like_filter'), - 'Priority' => Array('title' => 'la_prompt_Priority', 'filter_block' => 'grid_range_filter'), + 'FormFieldId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60 ), + 'FieldName' => Array( 'title'=>'la_prompt_FieldName', 'filter_block' => 'grid_like_filter', 'width' => 100 ), + 'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'label_grid_data_td', 'filter_block' => 'grid_like_filter', 'width' => 150 ), + 'Priority' => Array('title' => 'la_prompt_Priority', 'filter_block' => 'grid_range_filter', 'width' => 80 ), 'ElementType' => Array('title' => 'la_prompt_ElementType', 'filter_block' => 'grid_options_filter'), 'Required' => Array('title' => 'la_prompt_Required', 'filter_block' => 'grid_options_filter'), - 'DisplayInGrid' => Array('title' => 'la_prompt_DisplayInGrid', 'filter_block' => 'grid_options_filter'), + 'DisplayInGrid' => Array('title' => 'la_prompt_DisplayInGrid', 'filter_block' => 'grid_options_filter', 'width' => 150 ), ), ), ), - ); - -?> \ No newline at end of file + ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/regional/languages_list.tpl =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/regional/languages_list.tpl (.../languages_list.tpl) (revision 12127) +++ branches/5.1.x/core/admin_templates/regional/languages_list.tpl (.../languages_list.tpl) (revision 12657) @@ -15,7 +15,7 @@ } var a_toolbar = new ToolBar(); - a_toolbar.AddButton( new ToolBarButton('new_language', '::', + a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { std_precreate_item('lang', 'regional/languages_edit') } ) ); @@ -29,18 +29,18 @@ a_toolbar.AddButton( new ToolBarSeparator('sep1') ); - a_toolbar.AddButton( new ToolBarButton('primary_language', '::', function() { + a_toolbar.AddButton( new ToolBarButton('setprimary', '', function() { submit_event('lang','OnSetPrimary'); } ) ); - a_toolbar.AddButton( new ToolBarButton('import_language', '::', function() { + a_toolbar.AddButton( new ToolBarButton('import', '