Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1164759
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Sep 22, 3:13 AM
Size
45 KB
Mime Type
text/x-diff
Expires
Wed, Sep 24, 3:13 AM (1 h, 50 m)
Engine
blob
Format
Raw Data
Handle
754007
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.10.2/core/units/custom_data/custom_data_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/core/units/custom_data/custom_data_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/core/units/custom_data/custom_data_config.php (revision 8106)
@@ -0,0 +1,83 @@
+<?php
+
+ $config = Array(
+ 'Prefix' => 'cdata',
+
+ 'Clones' => Array(
+ 'u-cdata' => Array(
+ 'TableName' => TABLE_PREFIX.'PortalUserCustomData',
+ 'ParentPrefix' => 'u',
+ ),
+
+ 'c-cdata' => Array(
+ 'TableName' => TABLE_PREFIX.'CategoryCustomData',
+ 'ParentPrefix' => 'c',
+ ),
+
+ 'l-cdata' => Array(
+ 'TableName' => TABLE_PREFIX.'LinkCustomData',
+ 'ParentPrefix' => 'l',
+ ),
+
+ 'n-cdata' => Array(
+ 'TableName' => TABLE_PREFIX.'NewsCustomData',
+ 'ParentPrefix' => 'n',
+ ),
+
+ 'bb-cdata' => Array(
+ 'TableName' => TABLE_PREFIX.'TopicCustomData',
+ 'ParentPrefix' => 'bb',
+ ),
+
+ 'p-cdata' => Array(
+ 'TableName' => TABLE_PREFIX.'ProductsCustomData',
+ 'ParentPrefix' => 'p',
+ ),
+ ),
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'event',
+ ),
+
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '','build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '','build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => '#PARENT#', //self
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterConfigRead'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnCreateCustomFields',
+ ),
+ ),
+
+ 'IDField' => 'CustomDataId',
+
+ 'ParentTableKey' => 'ResourceId',
+ 'ForeignKey' => 'ResourceId',
+ 'AutoDelete' => true,
+ 'AutoClone' => false,
+
+ 'CalculatedFields' => Array(
+ '' => Array(),
+ ),
+
+ 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
+ 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'),
+
+ 'Fields' => Array(
+ 'CustomDataId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+ );
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/core/units/custom_data/custom_data_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/core/units/email_events/email_events_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/core/units/email_events/email_events_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/core/units/email_events/email_events_config.php (revision 8106)
@@ -0,0 +1,101 @@
+<?php
+
+$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'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'EventId',
+
+ 'StatusField' => Array('Enabled'),
+
+ 'TitleField' => 'Event',
+
+ 'TitlePresets' => Array(
+ 'email_settings_list' => Array('prefixes' => Array('emailevents.module_List'), 'format' => '!la_title_EmailSettings! (#emailevents.module_recordcount#)'),
+ ),
+
+ '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' ),
+ )
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Events',
+
+ 'CalculatedFields' => Array(
+ '' => Array (
+ 'FromUser' => 'u.Login',
+ )
+ ),
+
+ '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),
+
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s'),
+
+ 'ListSortings' => Array(
+ '' => Array('Sorting' => Array('Module' => 'asc', 'Description' => 'asc') ),
+
+ 'module' => Array('Sorting' => Array('Description' => 'asc') ),
+ ),
+
+ 'Fields' => Array(
+ 'EventId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Event' => Array('type' => 'string','not_null' => '1','default' => ''),
+ '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','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(),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td'),
+ 'Event' => Array( 'title'=>'la_col_Event'),
+ 'Module' => Array( 'title'=>'la_col_Module'),
+ 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
+ 'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
+ ),
+
+ ),
+
+ 'EmailSettings' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'Description' => Array('title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td' ),
+ 'Type' => Array('title'=>'la_col_Type'),
+ 'Enabled' => Array('title'=>'la_col_Status'),
+ 'FromUser' => Array('title'=>'la_col_FromToUser'),
+ ),
+ ),
+ ),
+ );
+
+ if (defined('DEBUG_MODE') && DEBUG_MODE) {
+ $config['Grids']['EmailSettings']['Fields']['EventId'] = Array('title' => 'la_col_Id');
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/core/units/email_events/email_events_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/core/admin_templates/js/script.js
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/core/admin_templates/js/script.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/core/admin_templates/js/script.js (revision 8106)
@@ -0,0 +1,1399 @@
+if ( !( isset($init_made) && $init_made ) ) {
+ var Grids = new Array();
+ var Toolbars = new Array();
+ var $Menus = new Array();
+ var $ViewMenus = new Array();
+ var $nls_menus = new Array();
+ var $MenuNames = new Array();
+
+ var $form_name = 'kernel_form';
+ if(!$fw_menus) var $fw_menus = new Array();
+
+ var $env = '';
+ var submitted = false;
+ var $edit_mode = false;
+ var $init_made = true; // in case of double inclusion of script.js :)
+
+ // hook processing
+ var hBEFORE = 1; // this is const, but including this twice causes errors
+ var hAFTER = 2; // this is const, but including this twice causes errors
+ var $hooks = new Array();
+ replaceFireBug();
+}
+
+function use_popups($prefix_special, $event) {
+ return $use_popups;
+}
+
+function getArrayValue()
+{
+ var $value = arguments[0];
+ var $current_key = 0;
+ $i = 1;
+ while ($i < arguments.length) {
+ $current_key = arguments[$i];
+ if (isset($value[$current_key])) {
+ $value = $value[$current_key];
+ }
+ else {
+ return false;
+ }
+ $i++;
+ }
+ return $value;
+}
+
+function setArrayValue()
+{
+ // first argument - array, other arguments - keys (arrays too), last argument - value
+ var $array = arguments[0];
+ var $current_key = 0;
+ $i = 1;
+ while ($i < arguments.length - 1) {
+ $current_key = arguments[$i];
+ if (!isset($array[$current_key])) {
+ $array[$current_key] = new Array();
+ }
+ $array = $array[$current_key];
+ $i++;
+ }
+ $array[$array.length] = arguments[arguments.length - 1];
+}
+
+function processHooks($function_name, $hook_type, $prefix_special)
+{
+ var $i = 0;
+ var $local_hooks = getArrayValue($hooks, $function_name, $hook_type);
+
+ while($i < $local_hooks.length) {
+ $local_hooks[$i]($function_name, $prefix_special);
+ $i++;
+ }
+}
+
+function registerHook($function_name, $hook_type, $hook_body)
+{
+ setArrayValue($hooks, $function_name, $hook_type, $hook_body);
+}
+
+function resort_grid($prefix_special, $field, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_Sort1', $field);
+ submit_event($prefix_special, 'OnSetSorting', null, null, $ajax);
+}
+
+function direct_sort_grid($prefix_special, $field, $direction, $field_pos, $ajax)
+{
+ if(!isset($field_pos)) $field_pos = 1;
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special+'_Sort'+$field_pos,$field);
+ set_hidden_field($prefix_special+'_Sort'+$field_pos+'_Dir',$direction);
+ set_hidden_field($prefix_special+'_SortPos',$field_pos);
+ submit_event($prefix_special,'OnSetSortingDirect', null, null, $ajax);
+}
+
+function reset_sorting($prefix_special)
+{
+ submit_event($prefix_special,'OnResetSorting');
+}
+
+function set_per_page($prefix_special, $per_page, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_PerPage', $per_page);
+ submit_event($prefix_special, 'OnSetPerPage', null, null, $ajax);
+}
+
+function submit_event(prefix_special, event, t, form_action, $ajax)
+{
+ if ($ajax) {
+ return $Catalog.submit_event(prefix_special, event, t);
+ }
+
+ if (event) {
+ set_hidden_field('events[' + prefix_special + ']', event);
+ }
+ if (t) set_hidden_field('t', t);
+
+ if (form_action) {
+ var old_env = '';
+ if (!form_action.match(/\?/)) {
+ document.getElementById($form_name).action.match(/.*(\?.*)/);
+ old_env = RegExp.$1;
+ }
+ document.getElementById($form_name).action = form_action + old_env;
+ }
+ submit_kernel_form();
+}
+
+function submit_action($url, $action)
+{
+ $form = document.getElementById($form_name);
+ $form.action = $url;
+ set_hidden_field('Action', $action);
+ submit_kernel_form();
+}
+
+function show_form_data()
+{
+ var $kf = document.getElementById($form_name);
+ $ret = '';
+ for(var i in $kf.elements)
+ {
+ $elem = $kf.elements[i];
+ $ret += $elem.id + ' = ' + $elem.value + "\n";
+ }
+ alert($ret);
+}
+
+function submit_kernel_form()
+{
+ if (submitted) {
+ return;
+ }
+ submitted = true;
+
+ var $form = document.getElementById($form_name);
+ processHooks('SubmitKF', hBEFORE);
+ if (typeof $form.onsubmit == "function") {
+ $form.onsubmit();
+ }
+
+ $form.submit();
+ processHooks('SubmitKF', hAFTER);
+ $form.target = '';
+ set_hidden_field('t', t);
+
+ window.setTimeout(function() {submitted = false}, 500);
+}
+
+function set_event(prefix_special, event)
+{
+ var event_field=document.getElementById('events[' + prefix_special + ']');
+ if(isset(event_field))
+ {
+ event_field.value = event;
+ }
+}
+
+function isset(variable)
+{
+ if(variable==null) return false;
+ return (typeof(variable)=='undefined')?false:true;
+}
+
+function in_array(needle, haystack)
+{
+ return array_search(needle, haystack) != -1;
+}
+
+function array_search(needle, haystack)
+{
+ for (var i=0; i<haystack.length; i++)
+ {
+ if (haystack[i] == needle) return i;
+ }
+ return -1;
+}
+
+function print_pre(variable, msg)
+{
+ if (!isset(msg)) msg = '';
+ var s = msg;
+ for (prop in variable) {
+ s += prop+" => "+variable[prop] + "\n";
+ }
+ alert(s);
+}
+
+function go_to_page($prefix_special, $page, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field($prefix_special + '_Page', $page);
+ submit_event($prefix_special, null, null, null, $ajax);
+}
+
+function go_to_list(prefix_special, tab)
+{
+ set_hidden_field(prefix_special+'_GoTab', tab);
+ submit_event(prefix_special,'OnUpdateAndGoToTab',null);
+}
+
+function go_to_tab(prefix_special, tab)
+{
+ set_hidden_field(prefix_special+'_GoTab', tab);
+ submit_event(prefix_special,'OnPreSaveAndGoToTab',null);
+}
+
+function go_to_id(prefix_special, id)
+{
+ set_hidden_field(prefix_special+'_GoId', id);
+ submit_event(prefix_special,'OnPreSaveAndGo')
+}
+
+// in-portal compatibility functions: begin
+function getScriptURL($script_name, tpl)
+{
+ tpl = tpl ? '-'+tpl : '';
+ var $asid = get_hidden_field('sid');
+ return base_url+$script_name+'?env='+( isset($env)&&$env?$env:$asid )+tpl+'&en=0';
+}
+
+function OpenEditor(extra_env,TargetForm,TargetField)
+{
+// var $url = getScriptURL('admin/editor/editor_new.php');
+ var $url = getScriptURL('admin/index.php', 'popups/editor');
+// alert($url);
+ $url = $url+'&TargetForm='+TargetForm+'&TargetField='+TargetField+'&destform=popup';
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'html_edit',800,575);
+}
+
+function OpenUserSelector(extra_env,TargetForm,TargetField)
+{
+ var $url = getScriptURL('admin/users/user_select.php');
+ $url += '&destform='+TargetForm+'&Selector=radio&destfield='+TargetField+'&IdField=Login';
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'user_select',800,575);
+ return false;
+}
+
+function OpenCatSelector(extra_env)
+{
+ var $url = getScriptURL('admin/cat_select.php');
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'catselect',750,400);
+}
+
+function OpenItemSelector(extra_env,$TargetForm)
+{
+ var $url = getScriptURL('admin/relation_select.php') + '&destform='+$TargetForm;
+ if(extra_env.length>0) $url += extra_env;
+ openwin($url,'groupselect',750,400);
+}
+
+function OpenUserEdit($user_id, $extra_env)
+{
+ var $url = getScriptURL('admin/users/adduser.php') + '&direct_id=' + $user_id;
+ if( isset($extra_env) ) $url += $extra_env;
+ window.location.href = $url;
+}
+
+function OpenLinkEdit($link_id, $extra_env)
+{
+ var $url = getScriptURL('in-link/admin/addlink.php') + '&item=' + $link_id;
+ if( isset($extra_env) ) $url += $extra_env;
+ window.location.href = $url;
+}
+
+function OpenHelp($help_link)
+{
+
+// $help_link.match('http://(.*).lv/in-commerce/admin(.*)');
+// alert(RegExp.$2);
+ openwin($help_link,'HelpPopup',750,400);
+}
+
+function openEmailSend($url, $type, $prefix_special)
+{
+ var $kf = document.getElementById($form_name);
+ var $prev_action = $kf.action;
+ var $prev_opener = get_hidden_field('m_opener');
+
+ $kf.action = $url;
+ set_hidden_field('m_opener', 'p');
+ $kf.target = 'sendmail';
+ set_hidden_field('idtype', 'group');
+ set_hidden_field('idlist', Grids[$prefix_special].GetSelected().join(',') );
+ openwin('','sendmail',750,400);
+ submit_kernel_form();
+
+ $kf.action = $prev_action;
+ set_hidden_field('m_opener', $prev_opener);
+}
+// in-portal compatibility functions: end
+
+function InitTranslator(prefix, field, t, multi_line)
+{
+ var $kf = document.getElementById($form_name);
+ var $window_name = 'select_'+t.replace(/(\/|-)/g, '_');
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
+
+ $regex = $regex.exec($kf.action);
+// set_hidden_field('return_m', $regex[4]);
+ var $prev_opener = get_hidden_field('m_opener');
+ if (!isset(multi_line)) multi_line = 0;
+ openwin('', $window_name, 750, 400);
+// set_hidden_field('return_template', $kf.elements['t'].value); // where should return after popup is done
+ set_hidden_field('m_opener', 'p');
+
+ set_hidden_field('translator_wnd_name', $window_name);
+ set_hidden_field('translator_field', field);
+ set_hidden_field('translator_t', t);
+ set_hidden_field('translator_prefixes', prefix);
+ set_hidden_field('translator_multi_line', multi_line);
+ $kf.target = $window_name;
+
+ return $prev_opener;
+}
+
+function PreSaveAndOpenTranslator(prefix, field, t, multi_line)
+{
+ var $prev_opener = InitTranslator(prefix, field, t, multi_line);
+
+ var split_prefix = prefix.split(',');
+ submit_event(split_prefix[0], 'OnPreSaveAndOpenTranslator');
+
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+
+function PreSaveAndOpenTranslatorCV(prefix, field, t, resource_id, multi_line)
+{
+ var $prev_opener = InitTranslator(prefix, field, t, multi_line);
+ set_hidden_field('translator_resource_id', resource_id);
+
+ var split_prefix = prefix.split(',');
+ submit_event(split_prefix[0],'OnPreSaveAndOpenTranslator');
+
+ set_hidden_field('m_opener', $prev_opener);
+}
+
+function openTranslator(prefix,field,url,wnd)
+{
+ var $kf = document.getElementById($form_name);
+
+ set_hidden_field('trans_prefix', prefix);
+ set_hidden_field('trans_field', field);
+ set_hidden_field('events[trans]', 'OnLoad');
+
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(.*)');
+ var $t = $regex.exec(url)[3];
+ $kf.target = wnd;
+ submit_event(prefix,'',$t,url);
+}
+
+function openwin($url,$name,$width,$height)
+{
+ // prevent window from opening larger, then screen resolution on user's computer (to Kostja)
+
+ // alert('openwin: name = ['+$name+']');
+ var left = Math.round((screen.width - $width)/2);
+ var top = Math.round((screen.height - $height)/2);
+
+ cur_x = is.ie ? window.screenLeft : window.screenX;
+ cur_y = is.ie ? window.screenTop : window.screenY;
+
+// alert('current X,Y: '+cur_x+','+cur_y+' target x,y: '+left+','+top);
+ var $window_params = 'left='+left+',top='+top+',width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
+ return window.open($url,$name,$window_params);
+}
+
+function OnResizePopup(e) {
+ if (!document.all) {
+ var $winW = window.innerWidth;
+ var $winH = window.innerHeight;
+ }
+ else {
+ var $winW = window.document.body.offsetWidth;
+ var $winH = window.document.body.offsetHeight;
+ }
+
+ window.status = '[width: ' + $winW + '; height: ' + $winH + ']';
+}
+
+function opener_action(new_action)
+{
+ var $prev_opener = get_hidden_field('m_opener');
+ set_hidden_field('m_opener', new_action);
+ return $prev_opener;
+}
+
+function open_popup($prefix_special, $event, $t, $window_size) {
+ if (!$window_size) {
+ // if no size given, then query it from ajax
+ var $default_size = '750x400';
+ var $pm = getFrame('head').$popup_manager;
+ if ($pm) {
+ // popup manager was found in head frame
+ $pm.ResponceFunction = function ($responce) {
+ if (!$responce.match(/([\d]+)x([\d]+)/)) {
+ // invalid responce was received, may be php fatal error during AJAX request
+ $responce = $default_size;
+ }
+ open_popup($prefix_special, $event, $t, $responce);
+ }
+ $pm.GetSize($t);
+ return ;
+ }
+ $window_size = $default_size;
+ }
+ var $kf = document.getElementById($form_name);
+
+ var $window_name = $t.replace(/(\/|-)/g, '_'); // replace "/" and "-" with "_"
+ $window_size = $window_size.split('x');
+
+ openwin('', $window_name, $window_size[0], $window_size[1]);
+ $kf.target = $window_name;
+
+ var $prev_opener = opener_action('p');
+ event_bak = get_hidden_field('events[' + $prefix_special + ']')
+ if (!event_bak) event_bak = '';
+ submit_event($prefix_special, $event, $t);
+ opener_action($prev_opener); // restore opener in parent window
+ set_hidden_field('events[' + $prefix_special + ']', event_bak); // restore event
+}
+
+function openSelector($prefix, $url, $dst_field, $window_size, $event)
+{
+ // if url has additional params - store it and make hidden fields from it (later, below)
+ var $additional = [];
+ if ($url.match('(.*?)&(.*)')) {
+ $url = RegExp.$1;
+ var tmp = RegExp.$2;
+ var pairs = tmp.split('&');
+
+ for (var i in pairs) {
+ var data = pairs[i].split('=');
+ $additional[data[0]] = data[1];
+ }
+ }
+
+ // get template name from url
+ var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)');
+ $regex = $regex.exec($url);
+ var $t = $regex[3];
+
+ // substitute form action with selector's url
+ var $kf = document.getElementById($form_name);
+ var $prev_action = $kf.action;
+ $kf.action = $url;
+
+ // check parameter values
+ if (!isset($event)) $event = '';
+
+ // set variables need for selector to work
+ processHooks('openSelector', hBEFORE);
+ set_hidden_field('main_prefix', $prefix);
+ set_hidden_field('dst_field', $dst_field);
+
+ for (var i in $additional)
+ {
+ set_hidden_field(i, $additional[i]);
+ }
+
+ open_popup($prefix, $event, $t);
+
+ // restore form action back
+ processHooks('openSelector', hAFTER);
+ $kf.action = $prev_action;
+}
+
+function translate_phrase($label, $template) {
+ set_hidden_field('phrases_label', $label);
+ open_popup('phrases', 'OnNew', $template);
+}
+
+function std_precreate_item(prefix_special, edit_template)
+{
+ set_hidden_field(prefix_special+'_mode', 't');
+ if (use_popups(prefix_special, 'OnPreCreate')) {
+ open_popup(prefix_special, 'OnPreCreate', edit_template);
+ }
+ else {
+ opener_action('d');
+ submit_event(prefix_special,'OnPreCreate', edit_template);
+ }
+ set_hidden_field(prefix_special+'_mode', '');
+}
+
+function std_new_item(prefix_special, edit_template)
+{
+ if (use_popups(prefix_special, 'OnNew')) {
+ open_popup(prefix_special, 'OnNew', edit_template);
+ }
+ else {
+ opener_action('d');
+ submit_event(prefix_special,'OnNew', edit_template);
+ }
+}
+
+function std_edit_item(prefix_special, edit_template)
+{
+ set_hidden_field(prefix_special+'_mode', 't');
+ if (use_popups(prefix_special, 'OnEdit')) {
+ open_popup(prefix_special, 'OnEdit', edit_template);
+ }
+ else {
+ opener_action('d');
+ submit_event(prefix_special,'OnEdit',edit_template);
+ }
+ set_hidden_field(prefix_special+'_mode', '');
+}
+
+function std_edit_temp_item(prefix_special, edit_template)
+{
+ if (use_popups(prefix_special, '')) {
+ open_popup(prefix_special, '', edit_template);
+ }
+ else {
+ opener_action('d');
+ submit_event(prefix_special,'',edit_template);
+ }
+}
+
+function std_delete_items(prefix_special, t, $ajax)
+{
+ if (inpConfirm('Are you sure you want to delete selected items?')) {
+ submit_event(prefix_special, 'OnMassDelete', t, null, $ajax);
+ }
+}
+
+// set current form base on ajax
+function set_form($prefix_special, $ajax)
+{
+ if ($ajax) {
+ $form_name = $Catalog.queryTabRegistry('prefix', $prefix_special, 'tab_id') + '_form';
+ }
+}
+
+// sets hidden field value
+// if the field does not exist - creates it
+function set_hidden_field($field_id, $value)
+{
+ var $kf = document.getElementById($form_name);
+ var $field = $kf.elements[$field_id];
+ if ($field) {
+ $field.value = $value;
+ return true;
+ }
+
+ $field = document.createElement('INPUT');
+ $field.type = 'hidden';
+ $field.name = $field_id;
+ $field.id = $field_id;
+ $field.value = $value;
+
+ $kf.appendChild($field);
+ return false;
+}
+
+// sets hidden field value
+// if the field does not exist - creates it
+function setInnerHTML($field_id, $value)
+{
+ var $element = document.getElementById($field_id);
+ if (!$element) return false;
+ $element.innerHTML = $value;
+}
+
+function get_hidden_field($field)
+{
+ var $kf = document.getElementById($form_name);
+ return $kf.elements[$field] ? $kf.elements[$field].value : false;
+}
+
+function search($prefix_special, $grid_name, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('grid_name', $grid_name);
+ submit_event($prefix_special, 'OnSearch', null, null, $ajax);
+}
+
+function search_reset($prefix_special, $grid_name, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('grid_name', $grid_name);
+ submit_event($prefix_special, 'OnSearchReset', null, null, $ajax);
+}
+
+function search_keydown($event, $prefix_special, $grid, $ajax)
+{
+ $event = $event ? $event : event;
+
+ if (window.event) {// IE
+ var $key_code = $event.keyCode;
+ }
+ else if($event.which) { // Netscape/Firefox/Opera
+ var $key_code = $event.which;
+ }
+
+ switch ($key_code) {
+ case 13:
+ search($prefix_special, $grid, parseInt($ajax));
+ break;
+
+ case 27:
+ search_reset($prefix_special, $grid, parseInt($ajax));
+ break;
+
+ }
+}
+
+function getRealLeft(el)
+{
+ if (typeof(el) == 'string') {
+ el = document.getElementById(el);
+ }
+ xPos = el.offsetLeft;
+ tempEl = el.offsetParent;
+ while (tempEl != null)
+ {
+ xPos += tempEl.offsetLeft;
+ tempEl = tempEl.offsetParent;
+ }
+ // if (obj.x) return obj.x;
+ return xPos;
+}
+
+function getRealTop(el)
+{
+ if (typeof(el) == 'string') {
+ el = document.getElementById(el);
+ }
+ yPos = el.offsetTop;
+ tempEl = el.offsetParent;
+ while (tempEl != null)
+ {
+ yPos += tempEl.offsetTop;
+ tempEl = tempEl.offsetParent;
+ }
+
+// if (obj.y) return obj.y;
+ return yPos;
+}
+
+function show_viewmenu_old($toolbar, $button_id)
+{
+ var $img = $toolbar.GetButtonImage($button_id);
+ var $pos_x = getRealLeft($img) - ((document.all) ? 6 : -2);
+ var $pos_y = getRealTop($img) + 32;
+
+ var $prefix_special = '';
+ window.triedToWriteMenus = false;
+
+ if($ViewMenus.length == 1)
+ {
+ $prefix_special = $ViewMenus[$ViewMenus.length-1];
+ $fw_menus[$prefix_special+'_view_menu']();
+ $Menus[$prefix_special+'_view_menu'].writeMenus('MenuContainers['+$prefix_special+']');
+ window.FW_showMenu($Menus[$prefix_special+'_view_menu'], $pos_x, $pos_y);
+ }
+ else
+ {
+ // prepare menus
+ for(var $i in $ViewMenus)
+ {
+ $prefix_special = $ViewMenus[$i];
+ $fw_menus[$prefix_special+'_view_menu']();
+ }
+ $Menus['mixed'] = new Menu('ViewMenu_mixed');
+
+ // merge menus into new one
+ for(var $i in $ViewMenus)
+ {
+ $prefix_special = $ViewMenus[$i];
+ $Menus['mixed'].addMenuItem( $Menus[$prefix_special+'_view_menu'] );
+ }
+
+ $Menus['mixed'].writeMenus('MenuContainers[mixed]');
+ window.FW_showMenu($Menus['mixed'], $pos_x, $pos_y);
+ }
+}
+
+var nlsMenuRendered = false;
+function show_viewmenu($toolbar, $button_id)
+{
+ if($ViewMenus.length == 1) {
+ $prefix_special = $ViewMenus[$ViewMenus.length-1];
+ menu_to_show = $prefix_special+'_view_menu';
+ }
+ else
+ {
+ mixed_menu = menuMgr.createMenu(rs('mixed_menu'));
+ mixed_menu.applyBorder(false, false, false, false);
+ mixed_menu.dropShadow("none");
+ mixed_menu.showIcon = true;
+
+ // merge menus into new one
+ for(var $i in $ViewMenus)
+ {
+ $prefix_special = $ViewMenus[$i];
+ mixed_menu.addItem( rs($prefix_special+'.view.menu.mixed'),
+ $MenuNames[$prefix_special+'_view_menu'],
+ 'javascript:void()', null, true, null,
+ rs($prefix_special+'.view.menu'),$MenuNames[$prefix_special+'_view_menu'] );
+ }
+
+ menu_to_show = 'mixed_menu';
+ }
+
+ renderMenus();
+
+ nls_showMenu(rs(menu_to_show), $toolbar.GetButtonImage($button_id))
+}
+
+function renderMenus()
+{
+ menuMgr.renderMenus('nlsMenuPlace');
+ nlsMenuRendered = true;
+}
+
+function set_window_title($title)
+{
+ var $window = window;
+ if($window.parent) $window = $window.parent;
+ $window.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
+}
+
+function set_filter($prefix_special, $filter_id, $filter_value, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ set_hidden_field('filter_id', $filter_id);
+ set_hidden_field('filter_value', $filter_value);
+ submit_event($prefix_special, 'OnSetFilter', null, null, $ajax);
+}
+
+function filters_remove_all($prefix_special, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ submit_event($prefix_special,'OnRemoveFilters', null, null, $ajax);
+}
+
+function filters_apply_all($prefix_special, $ajax)
+{
+ set_form($prefix_special, $ajax);
+ submit_event($prefix_special,'OnApplyFilters', null, null, $ajax);
+}
+
+function RemoveTranslationLink($string, $escaped)
+{
+ if (!isset($escaped)) $escaped = true;
+
+ if ($escaped) {
+ return $string.replace(/<a href="(.*?)">(.*?)<\/a>/g, '$2');
+ }
+
+ return $string.replace(/<a href="(.*?)">(.*?)<\/a>/g, '$2');
+}
+
+function redirect($url)
+{
+ window.location.href = $url;
+}
+
+function update_checkbox_options($cb_mask, $hidden_id)
+{
+ var $kf = document.getElementById($form_name);
+ var $tmp = '';
+ for (var i = 0; i < $kf.elements.length; i++)
+ {
+ if ( $kf.elements[i].id.match($cb_mask) )
+ {
+ if ($kf.elements[i].checked) $tmp += '|'+$kf.elements[i].value;
+ }
+ }
+ if($tmp.length > 0) $tmp += '|';
+ document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
+}
+
+function update_multiple_options($hidden_id) {
+ var $select = document.getElementById($hidden_id + '_select');
+ var $result = '';
+
+ for (var $i = 0; $i < $select.options.length; $i++) {
+ if ($select.options[$i].selected) {
+ $result += $select.options[$i].value + '|';
+ }
+ }
+ document.getElementById($hidden_id).value = $result ? '|' + $result : '';
+}
+
+// related to lists operations (moving)
+
+ function move_selected($from_list, $to_list)
+ {
+ if (typeof($from_list) != 'object') $from_list = document.getElementById($from_list);
+ if (typeof($to_list) != 'object') $to_list = document.getElementById($to_list);
+
+ if (has_selected_options($from_list))
+ {
+ var $from_array = select_to_array($from_list);
+ var $to_array = select_to_array($to_list);
+ var $new_from = Array();
+ var $cur = null;
+
+ for (var $i = 0; $i < $from_array.length; $i++)
+ {
+ $cur = $from_array[$i];
+ if ($cur[2]) // If selected - add to To array
+ {
+ $to_array[$to_array.length] = $cur;
+ }
+ else //Else - keep in new From
+ {
+ $new_from[$new_from.length] = $cur;
+ }
+ }
+
+ $from_list = array_to_select($new_from, $from_list);
+ $to_list = array_to_select($to_array, $to_list);
+ }
+ else
+ {
+ alert('Please select items to perform moving!');
+ }
+ }
+
+ function select_to_array($aSelect)
+ {
+ var $an_array = new Array();
+ var $cur = null;
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ $an_array[$an_array.length] = new Array($cur.text, $cur.value, $cur.selected);
+ }
+ return $an_array;
+ }
+
+ function array_to_select($anArray, $aSelect)
+ {
+ var $initial_length = $aSelect.length;
+ for (var $i = $initial_length - 1; $i >= 0; $i--)
+ {
+ $aSelect.options[$i] = null;
+ }
+
+ for (var $i = 0; $i < $anArray.length; $i++)
+ {
+ $cur = $anArray[$i];
+ $aSelect.options[$aSelect.length] = new Option($cur[0], $cur[1]);
+ }
+ }
+
+ function select_compare($a, $b)
+ {
+ if ($a[0] < $b[0])
+ return -1;
+ if ($a[0] > $b[0])
+ return 1;
+ return 0;
+ }
+
+ function select_to_string($aSelect)
+ {
+ var $result = '';
+ var $cur = null;
+
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $result += $aSelect.options[$i].value + '|';
+ }
+
+ return $result.length ? '|' + $result : '';
+ }
+
+ function selected_to_string($aSelect)
+ {
+ var $result = '';
+ var $cur = null;
+
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ if ($cur.selected && $cur.value != '')
+ {
+ $result += $cur.value + '|';
+ }
+ }
+
+ return $result.length ? '|' + $result : '';
+ }
+
+ function string_to_selected($str, $aSelect)
+ {
+ var $cur = null;
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ $cur = $aSelect.options[$i];
+ $aSelect.options[$i].selected = $str.match('\\|' + $cur.value + '\\|') ? true : false;
+ }
+ }
+
+ function set_selected($selected_options, $aSelect)
+ {
+ if (!$selected_options.length) return false;
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ for (var $k = 0; $k < $selected_options.length; $k++)
+ {
+ if ($aSelect.options[$i].value == $selected_options[$k])
+ {
+ $aSelect.options[$i].selected = true;
+ }
+ }
+ }
+ }
+
+ function get_selected_count($theList)
+ {
+ var $count = 0;
+ var $cur = null;
+ for (var $i = 0; $i < $theList.length; $i++)
+ {
+ $cur = $theList.options[$i];
+ if ($cur.selected) $count++;
+ }
+ return $count;
+ }
+
+ function get_selected_index($aSelect, $typeIndex)
+ {
+ var $index = 0;
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ if ($aSelect.options[$i].selected)
+ {
+ $index = $i;
+ if ($typeIndex == 'firstSelected') break;
+ }
+ }
+ return $index;
+ }
+
+ function has_selected_options($theList)
+ {
+ var $ret = false;
+ var $cur = null;
+
+ for (var $i = 0; $i < $theList.length; $i++)
+ {
+ $cur = $theList.options[$i];
+ if ($cur.selected) $ret = true;
+ }
+ return $ret;
+ }
+
+ function select_sort($aSelect)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ var $to_array = select_to_array($aSelect);
+ $to_array.sort(select_compare);
+ array_to_select($to_array, $aSelect);
+ }
+
+ function move_options_up($aSelect, $interval)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ if (has_selected_options($aSelect))
+ {
+ var $selected_options = Array();
+ var $first_selected = get_selected_index($aSelect, 'firstSelected');
+
+ for (var $i = 0; $i < $aSelect.length; $i++)
+ {
+ if ($aSelect.options[$i].selected && ($first_selected > 0) )
+ {
+ swap_options($aSelect, $i, $i - $interval);
+ $selected_options[$selected_options.length] = $aSelect.options[$i - $interval].value;
+ }
+ else if ($first_selected == 0)
+ {
+ //alert('Begin of list');
+ break;
+ }
+ }
+ set_selected($selected_options, $aSelect);
+ }
+ else
+ {
+ //alert('Check items from moving');
+ }
+ }
+
+ function move_options_down($aSelect, $interval)
+ {
+ if (typeof($aSelect) != 'object') $aSelect = document.getElementById($aSelect);
+
+ if (has_selected_options($aSelect))
+ {
+ var $last_selected = get_selected_index($aSelect, 'lastSelected');
+ var $selected_options = Array();
+
+ for (var $i = $aSelect.length - 1; $i >= 0; $i--)
+ {
+ if ($aSelect.options[$i].selected && ($aSelect.length - ($last_selected + 1) > 0))
+ {
+ swap_options($aSelect, $i, $i + $interval);
+ $selected_options[$selected_options.length] = $aSelect.options[$i + $interval].value;
+ }
+ else if ($last_selected + 1 == $aSelect.length)
+ {
+ //alert('End of list');
+ break;
+ }
+ }
+ set_selected($selected_options, $aSelect);
+ }
+ else
+ {
+ //alert('Check items from moving');
+ }
+ }
+
+ function swap_options($aSelect, $src_num, $dst_num)
+ {
+ var $src_html = $aSelect.options[$src_num].innerHTML;
+ var $dst_html = $aSelect.options[$dst_num].innerHTML;
+ var $src_value = $aSelect.options[$src_num].value;
+ var $dst_value = $aSelect.options[$dst_num].value;
+
+ var $src_option = document.createElement('OPTION');
+ var $dst_option = document.createElement('OPTION');
+
+ $aSelect.remove($src_num);
+ $aSelect.options.add($dst_option, $src_num);
+ $dst_option.innerText = $dst_html;
+ $dst_option.value = $dst_value;
+ $dst_option.innerHTML = $dst_html;
+
+ $aSelect.remove($dst_num);
+ $aSelect.options.add($src_option, $dst_num);
+ $src_option.innerText = $src_html;
+ $src_option.value = $src_value;
+ $src_option.innerHTML = $src_html;
+ }
+
+ function getXMLHTTPObject(content_type)
+ {
+ if (!isset(content_type)) content_type = 'text/plain';
+ var http_request = false;
+ if (window.XMLHttpRequest) { // Mozilla, Safari,...
+ http_request = new XMLHttpRequest();
+ if (http_request.overrideMimeType) {
+ http_request.overrideMimeType(content_type);
+ // See note below about this line
+ }
+ } else if (window.ActiveXObject) { // IE
+ try {
+ http_request = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ http_request = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e) {}
+ }
+ }
+ return http_request;
+ }
+
+ function str_repeat($symbol, $count)
+ {
+ var $i = 0;
+ var $ret = '';
+ while($i < $count) {
+ $ret += $symbol;
+ $i++;
+ }
+ return $ret;
+ }
+
+ function getDocumentFromXML(xml)
+ {
+ if (window.ActiveXObject) {
+ var doc = new ActiveXObject("Microsoft.XMLDOM");
+ doc.async=false;
+ doc.loadXML(xml);
+ }
+ else {
+ var parser = new DOMParser();
+ var doc = parser.parseFromString(xml,"text/xml");
+ }
+ return doc;
+ }
+
+ function set_persistant_var($var_name, $var_value, $t, $form_action)
+ {
+ set_hidden_field('field', $var_name);
+ set_hidden_field('value', $var_value);
+ submit_event('u', 'OnSetPersistantVariable', $t, $form_action);
+ }
+
+ /*functionremoveEvent(el, evname, func) {
+ if (Calendar.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+ };*/
+
+ function setCookie($Name, $Value)
+ {
+ // set cookie
+ if(getCookie($Name) != $Value)
+ {
+ document.cookie = $Name+'='+escape($Value)+'; path=' + $base_path + '/';
+ }
+ }
+
+ function getCookie($Name)
+ {
+ // get cookie
+ var $cookieString = document.cookie;
+ var $index = $cookieString.indexOf($Name+'=');
+ if($index == -1) return null;
+
+ $index = $cookieString.indexOf('=',$index)+1;
+ var $endstr = $cookieString.indexOf(';',$index);
+ if($endstr == -1) $endstr = $cookieString.length;
+ return unescape($cookieString.substring($index, $endstr));
+ }
+
+ function deleteCookie($Name)
+ {
+ // deletes cookie
+ if (getCookie($Name))
+ {
+ document.cookie = $Name+'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
+ }
+ }
+
+ function addElement($dst_element, $tag_name) {
+ var $new_element = document.createElement($tag_name.toUpperCase());
+ $dst_element.appendChild($new_element);
+ return $new_element;
+ }
+
+ Math.sum = function($array) {
+ var $i = 0;
+ var $total = 0;
+ while ($i < $array.length) {
+ $total += $array[$i];
+ $i++;
+ }
+ return $total;
+ }
+
+ Math.average = function($array) {
+ return Math.sum($array) / $array.length;
+ }
+
+ // remove spaces and underscores from a string, used for nls_menu
+ function rs(str)
+ {
+ return str.replace(/[ _\']+/g, '.');
+ }
+
+ function getFrame($name)
+ {
+ var $main_window = window;
+
+ // 1. cycle through popups to get main window
+ try {
+ // will be error, when other site is opened in parent window
+ while ($main_window.opener) {
+ $main_window = $main_window.opener;
+ }
+ }
+ catch (err) {
+ // catch Access/Permission Denied error
+// alert('getFrame.Error: [' + err.description + ']');
+ return window;
+ }
+
+ var $frameset = $main_window.parent.frames;
+ for ($i = 0; $i < $frameset.length; $i++) {
+ if ($frameset[$i].name == $name) {
+ return $frameset[$i];
+ }
+ }
+ return $main_window.parent;
+ }
+
+ function ClearBrowserSelection()
+ {
+ if (window.getSelection) {
+ // removeAllRanges will be supported by Opera from v 9+, do nothing by now
+ var selection = window.getSelection();
+ if (selection.removeAllRanges) { // Mozilla & Opera 9+
+// alert('clearing FF')
+ window.getSelection().removeAllRanges();
+ }
+ } else if (document.selection && !is.opera) { // IE
+// alert('clearing IE')
+ document.selection.empty();
+ }
+ }
+
+ function reset_form(prefix, event, msg)
+ {
+ if (confirm(RemoveTranslationLink(msg, true))) {
+ submit_event(prefix, event)
+ }
+ }
+
+ function cancel_edit(prefix, cancel_ev, save_ev, msg)
+ {
+ if (confirm(RemoveTranslationLink(msg, true))) {
+ submit_event(prefix, save_ev)
+ }
+ else {
+ submit_event(prefix, cancel_ev)
+ }
+ }
+
+
+
+function execJS(node)
+{
+ var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
+ var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
+ var bMoz = (navigator.appName == 'Netscape');
+
+ if (!node) return;
+
+ /* IE wants it uppercase */
+ var st = node.getElementsByTagName('SCRIPT');
+ var strExec;
+
+ for(var i=0;i<st.length; i++)
+ {
+ if (bSaf) {
+ strExec = st[i].innerHTML;
+ st[i].innerHTML = "";
+ } else if (bOpera) {
+ strExec = st[i].text;
+ st[i].text = "";
+ } else if (bMoz) {
+ strExec = st[i].textContent;
+ st[i].textContent = "";
+ } else {
+ strExec = st[i].text;
+ st[i].text = "";
+ }
+
+ try {
+ var x = document.createElement("script");
+ x.type = "text/javascript";
+
+ /* In IE we must use .text! */
+ if ((bSaf) || (bOpera) || (bMoz))
+ x.innerHTML = strExec;
+ else x.text = strExec;
+
+ document.getElementsByTagName("head")[0].appendChild(x);
+ } catch(e) {
+ alert(e);
+ }
+ }
+};
+
+function NumberFormatter() {}
+
+NumberFormatter.ThousandsSep = '\'';
+NumberFormatter.DecimalSep = '.';
+
+NumberFormatter.Parse = function(num)
+{
+ if (num == '') return 0;
+ return parseFloat( num.toString().replace(this.ThousandsSep, '').replace(this.DecimalSep, '.') );
+}
+
+NumberFormatter.Format = function(num)
+{
+ num += '';
+ x = num.split('.');
+ x1 = x[0];
+ x2 = x.length > 1 ? this.DecimalSep + x[1] : '';
+ var rgx = /(\d+)(\d{3})/;
+ while (rgx.test(x1)) {
+ x1 = x1.replace(rgx, '$1' + this.ThousandsSep + '$2');
+ }
+ return x1 + x2;
+}
+
+function getDimensions(obj) {
+ var style
+ if (obj.currentStyle) {
+ style = obj.currentStyle;
+ }
+ else {
+ style = getComputedStyle(obj,'');
+ }
+ padding = [parseInt(style.paddingTop), parseInt(style.paddingRight), parseInt(style.paddingBottom), parseInt(style.paddingLeft)]
+ border = [parseInt(style.borderTopWidth), parseInt(style.borderRightWidth), parseInt(style.borderBottomWidth), parseInt(style.borderLeftWidth)]
+ for (var i in padding) if ( isNaN( padding[i] ) ) padding[i] = 0
+ for (var i in border) if ( isNaN( border[i] ) ) border[i] = 0
+
+ var result = new Object();
+ result.innerHeight = obj.clientHeight - padding[0] - padding[2];
+ result.innerWidth = obj.clientWidth - padding[1] - padding[3];
+ result.padding = padding;
+ result.borders = border;
+
+ return result;
+}
+
+function findPos(obj) {
+ var curleft = curtop = 0;
+ if (obj.offsetParent) {
+ curleft = obj.offsetLeft
+ curtop = obj.offsetTop
+ while (obj = obj.offsetParent) {
+ curleft += obj.offsetLeft
+ curtop += obj.offsetTop
+ }
+ }
+ return [curleft,curtop];
+}
+
+function addEvent(el, evname, func, traditional) {
+ if (traditional) {
+ eval('el.on'+evname+'='+func);
+ return;
+ }
+
+ if (is.ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+function addLoadEvent(func, wnd) {
+ if (!wnd) wnd = window
+ var oldonload = wnd.onload;
+ if (typeof wnd.onload != 'function') {
+ wnd.onload = func;
+ } else {
+ wnd.onload = function() {
+ if (oldonload) {
+ oldonload();
+ }
+ func();
+ }
+ }
+}
+
+function replaceFireBug() {
+ if (!window.console || !console.firebug) {
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
+ "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
+
+ window.console = {};
+ for (var i = 0; i < names.length; ++i) {
+ window.console[names[i]] = function() {
+ alert('FireBug console object methods are not available outside Firefox!');
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/core/admin_templates/js/script.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment