Index: trunk/kernel/admin_templates/img/toolbar/tool_place_order_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_conf_regional.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/in-link/icon16_link_denied.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default/img/american_express.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/s.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/save_redirect.php
===================================================================
diff -u
--- trunk/admin/save_redirect.php (revision 0)
+++ trunk/admin/save_redirect.php (revision 1566)
@@ -0,0 +1,98 @@
+Logout();
+ header("Location: ".$adminURL."/index.php?logout=1");
+ exit;
+
+ }
+
+ /*$m = GetModuleArray();
+ foreach($m as $key=>$value)
+ {
+ $path = $pathtoroot.$value.'admin/include/parser.php';
+ if( file_exists($path) ) include_once($path);
+ }*/
+
+ $rootURL = 'http://'.ThisDomain().$objConfig->Get('Site_Path');
+ $location = $rootURL.GetVar('do').'?env='.GetVar('env');
+ header('Location: '.$location);
+ exit;
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_process_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_settings_email.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/is.js
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/is.js (revision 0)
+++ trunk/kernel/admin_templates/incs/is.js (revision 1566)
@@ -0,0 +1,211 @@
+// Ultimate client-side JavaScript client sniff. Version 3.03
+// (C) Netscape Communications 1999. Permission granted to reuse and distribute.
+// Revised 17 May 99 to add is.nav5up and is.ie5up (see below).
+// Revised 21 Nov 00 to add is.gecko and is.ie5_5 Also Changed is.nav5 and is.nav5up to is.nav6 and is.nav6up
+// Revised 22 Feb 01 to correct Javascript Detection for IE 5.x, Opera 4,
+// correct Opera 5 detection
+// add support for winME and win2k
+// synch with browser-type-oo.js
+// Revised 26 Mar 01 to correct Opera detection
+// Revised 02 Oct 01 to add IE6 detection
+
+// Everything you always wanted to know about your JavaScript client
+// but were afraid to ask ... "Is" is the constructor function for "is" object,
+// which has properties indicating:
+// (1) browser vendor:
+// is.nav, is.ie, is.opera, is.hotjava, is.webtv, is.TVNavigator, is.AOLTV
+// (2) browser version number:
+// is.major (integer indicating major version number: 2, 3, 4 ...)
+// is.minor (float indicating full version number: 2.02, 3.01, 4.04 ...)
+// (3) browser vendor AND major version number
+// is.nav2, is.nav3, is.nav4, is.nav4up, is.nav6, is.nav6up, is.gecko, is.ie3,
+// is.ie4, is.ie4up, is.ie5, is.ie5up, is.ie5_5, is.ie5_5up, is.ie6, is.ie6up, is.hotjava3, is.hotjava3up
+// (4) JavaScript version number:
+// is.js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
+// (5) OS platform and version:
+// is.win, is.win16, is.win32, is.win31, is.win95, is.winnt, is.win98, is.winme, is.win2k
+// is.os2
+// is.mac, is.mac68k, is.macppc
+// is.unix
+// is.sun, is.sun4, is.sun5, is.suni86
+// is.irix, is.irix5, is.irix6
+// is.hpux, is.hpux9, is.hpux10
+// is.aix, is.aix1, is.aix2, is.aix3, is.aix4
+// is.linux, is.sco, is.unixware, is.mpras, is.reliant
+// is.dec, is.sinix, is.freebsd, is.bsd
+// is.vms
+//
+// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
+// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
+// for detailed lists of userAgent strings.
+//
+// Note: you don't want your Nav4 or IE4 code to "turn off" or
+// stop working when Nav5 and IE5 (or later) are released, so
+// in conditional code forks, use is.nav4up ("Nav4 or greater")
+// and is.ie4up ("IE4 or greater") instead of is.nav4 or is.ie4
+// to check version in code which you want to work on future
+// versions.
+
+function Is ()
+{ // convert all characters to lowercase to simplify testing
+ var agt=navigator.userAgent.toLowerCase();
+
+ // *** BROWSER VERSION ***
+ // Note: On IE5, these return 4, so use is.ie5up to detect IE5.
+
+ this.major = parseInt(navigator.appVersion);
+ this.minor = parseFloat(navigator.appVersion);
+
+ // Note: Opera and WebTV spoof Navigator. We do strict client detection.
+ // If you want to allow spoofing, take out the tests for opera and webtv.
+ this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
+ && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
+ && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
+ this.nav2 = (this.nav && (this.major == 2));
+ this.nav3 = (this.nav && (this.major == 3));
+ this.nav4 = (this.nav && (this.major == 4));
+ this.nav4up = (this.nav && (this.major >= 4));
+ this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) ||
+ (agt.indexOf("; nav") != -1)) );
+ this.nav6 = (this.nav && (this.major == 5));
+ this.nav6up = (this.nav && (this.major >= 5));
+ this.gecko = (agt.indexOf('gecko') != -1);
+
+
+ this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
+ this.ie3 = (this.ie && (this.major < 4));
+ this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) );
+ this.ie4up = (this.ie && (this.major >= 4));
+ this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
+ this.ie5_5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
+ this.ie5up = (this.ie && !this.ie3 && !this.ie4);
+ this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);
+ this.ie6 = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) );
+ this.ie6up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
+
+ // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
+ // or if this is the first browser window opened. Thus the
+ // variables is.aol, is.aol3, and is.aol4 aren't 100% reliable.
+ this.aol = (agt.indexOf("aol") != -1);
+ this.aol3 = (this.aol && this.ie3);
+ this.aol4 = (this.aol && this.ie4);
+ this.aol5 = (agt.indexOf("aol 5") != -1);
+ this.aol6 = (agt.indexOf("aol 6") != -1);
+
+ this.opera = (agt.indexOf("opera") != -1);
+ this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
+ this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
+ this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
+ this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
+ this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);
+
+ this.webtv = (agt.indexOf("webtv") != -1);
+
+ this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1));
+ this.AOLTV = this.TVNavigator;
+
+ this.hotjava = (agt.indexOf("hotjava") != -1);
+ this.hotjava3 = (this.hotjava && (this.major == 3));
+ this.hotjava3up = (this.hotjava && (this.major >= 3));
+
+ // *** JAVASCRIPT VERSION CHECK ***
+ if (this.nav2 || this.ie3) this.js = 1.0;
+ else if (this.nav3) this.js = 1.1;
+ else if (this.opera5up) this.js = 1.3;
+ else if (this.opera) this.js = 1.1;
+ else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
+ else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
+ else if (this.hotjava3up) this.js = 1.4;
+ else if (this.nav6 || this.gecko) this.js = 1.5;
+ // NOTE: In the future, update this code when newer versions of JS
+ // are released. For now, we try to provide some upward compatibility
+ // so that future versions of Nav and IE will show they are at
+ // *least* JS 1.x capable. Always check for JS version compatibility
+ // with > or >=.
+ else if (this.nav6up) this.js = 1.5;
+ // note ie5up on mac is 1.4
+ else if (this.ie5up) this.js = 1.3
+
+ // HACK: no idea for other browsers; always check for JS version with > or >=
+ else this.js = 0.0;
+
+ // *** PLATFORM ***
+ this.win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
+ // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
+ // Win32, so you can't distinguish between Win95 and WinNT.
+ this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
+
+ // is this a 16 bit compiled version?
+ this.win16 = ((agt.indexOf("win16")!=-1) ||
+ (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
+ (agt.indexOf("windows 16-bit")!=-1) );
+
+ this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
+ (agt.indexOf("windows 16-bit")!=-1));
+
+ // NOTE: Reliable detection of Win98 may not be possible. It appears that:
+ // - On Nav 4.x and before you'll get plain "Windows" in userAgent.
+ // - On Mercury client, the 32-bit version will return "Win98", but
+ // the 16-bit version running on Win98 will still return "Win95".
+ this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
+ this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
+ this.win32 = (this.win95 || this.winnt || this.win98 ||
+ ((this.major >= 4) && (navigator.platform == "Win32")) ||
+ (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
+
+ this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
+ this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));
+
+ this.os2 = ((agt.indexOf("os/2")!=-1) ||
+ (navigator.appVersion.indexOf("OS/2")!=-1) ||
+ (agt.indexOf("ibm-webexplorer")!=-1));
+
+ this.mac = (agt.indexOf("mac")!=-1);
+ // hack ie5 js version for mac
+ if (this.mac && this.ie5up) this.js = 1.4;
+ this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) ||
+ (agt.indexOf("68000")!=-1)));
+ this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) ||
+ (agt.indexOf("powerpc")!=-1)));
+
+ this.sun = (agt.indexOf("sunos")!=-1);
+ this.sun4 = (agt.indexOf("sunos 4")!=-1);
+ this.sun5 = (agt.indexOf("sunos 5")!=-1);
+ this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
+ this.irix = (agt.indexOf("irix") !=-1); // SGI
+ this.irix5 = (agt.indexOf("irix 5") !=-1);
+ this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
+ this.hpux = (agt.indexOf("hp-ux")!=-1);
+ this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
+ this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
+ this.aix = (agt.indexOf("aix") !=-1); // IBM
+ this.aix1 = (agt.indexOf("aix 1") !=-1);
+ this.aix2 = (agt.indexOf("aix 2") !=-1);
+ this.aix3 = (agt.indexOf("aix 3") !=-1);
+ this.aix4 = (agt.indexOf("aix 4") !=-1);
+ this.linux = (agt.indexOf("inux")!=-1);
+ this.sco = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
+ this.unixware = (agt.indexOf("unix_system_v")!=-1);
+ this.mpras = (agt.indexOf("ncr")!=-1);
+ this.reliant = (agt.indexOf("reliantunix")!=-1);
+ this.dec = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
+ (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
+ (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
+ this.sinix = (agt.indexOf("sinix")!=-1);
+ this.freebsd = (agt.indexOf("freebsd")!=-1);
+ this.bsd = (agt.indexOf("bsd")!=-1);
+ this.unix = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux ||
+ this.sco ||this.unixware || this.mpras || this.reliant ||
+ this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);
+
+ this.vms = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
+}
+
+var is;
+var isIE3Mac = false;
+// this section is designed specifically for IE3 for the Mac
+
+if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1) &&
+(parseInt(navigator.appVersion)==3))
+ isIE3Mac = true;
+else is = new Is();
Index: trunk/themes/default/img/my_orders_s.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_template.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/include/adodb/adodb.inc.php
===================================================================
diff -u -r965 -r1566
--- trunk/kernel/include/adodb/adodb.inc.php (.../adodb.inc.php) (revision 965)
+++ trunk/kernel/include/adodb/adodb.inc.php (.../adodb.inc.php) (revision 1566)
@@ -723,7 +723,7 @@
ADOConnection::outp( "=----\n($this->databaseType): ".($sqlTxt)." \n-----\n",false);
flush();
- $profileSQLs = defined('SQL_PROFILE')&&(SQL_PROFILE==1);
+ $profileSQLs = defined('DBG_SQL_PROFILE')&&DBG_SQL_PROFILE;
if($profileSQLs)
{
$isSkipTable = isSkipTable($sql);
@@ -752,7 +752,7 @@
$e = $this->ErrorNo();
$m = $this->ErrorMsg();
- $errorLevel = defined('SQL_ERROR_DIE')&&SQL_ERROR_DIE ? E_USER_ERROR : E_USER_WARNING;
+ $errorLevel = defined('DBG_SQL_FAILURE')&&DBG_SQL_FAILURE ? E_USER_ERROR : E_USER_WARNING;
$debugger->dumpVars($_REQUEST);
$debugger->appendTrace();
Index: trunk/core/units/languages/languages_event_handler.php
===================================================================
diff -u
--- trunk/core/units/languages/languages_event_handler.php (revision 0)
+++ trunk/core/units/languages/languages_event_handler.php (revision 1566)
@@ -0,0 +1,311 @@
+Application->getUnitOption($event->Prefix,'TableName');
+ $languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name);
+ $languages_count = $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 );
+
+ $sqls = Array();
+
+ $unit_config_reader =& $this->Application->recallObject('kUnitConfigReader');
+ foreach($unit_config_reader->configData as $prefix => $config_data)
+ {
+ $table_name = getArrayValue($config_data,'TableName');
+ $fields = getArrayValue($config_data,'Fields');
+ if(!($table_name && $fields) ) continue;
+
+ foreach($fields as $field_name => $field_options)
+ {
+ if( isset($field_options['formatter']) && $field_options['formatter'] == 'kMultiLanguage' )
+ {
+ $describe = $this->Conn->Query('DESCRIBE '.$table_name.' \'l%_'.$field_name.'\'');
+ $field_mask = 'l%s_'.$field_name.' '.$describe[0]['Type'];
+ $create_count = $languages_count - count($describe);
+ if($create_count)
+ {
+ $sqls[] = 'ALTER TABLE '.$table_name.( $this->generateAlterSQL($field_mask, count($describe) + 1, $create_count) );
+ }
+ }
+ }
+ }
+ if($sqls) $this->Conn->Query( implode("\n",$sqls) );
+ }
+
+ /**
+ * Returns ALTER statement part for adding required fields to table
+ *
+ * @param string $field_mask sql mask for creating field with correct definition (type & size)
+ * @param int $start_index add new fields starting from this index
+ * @param int $create_count create this much new multilingual field translations
+ * @return string
+ */
+ function generateAlterSQL($field_mask, $start_index, $create_count)
+ {
+ $i_count = $start_index + $create_count;
+ $ret = '';
+ while($start_index < $i_count)
+ {
+ list($prev_field,$type) = explode(' ', sprintf($field_mask, $start_index-1) );
+ $ret .= ' ADD COLUMN '.sprintf($field_mask,$start_index).' AFTER '.$prev_field.', ';
+ $start_index++;
+ }
+ return preg_replace('/, $/',';',$ret);
+ }
+
+ /**
+ * Copy labels from another language
+ *
+ * @param kEvent $event
+ */
+ function OnCopyLabels(&$event)
+ {
+ $object =& $event->getObject();
+ $from_lang_id = $object->GetDBField('CopyFromLanguage');
+
+ if( ($event->MasterEvent->status == erSUCCESS) && $object->GetDBField('CopyLabels') == 1 && ($from_lang_id > 0) )
+ {
+ $lang_id = $object->GetID();
+
+ // 1. phrases import
+ $phrases_live = $this->Application->getUnitOption('phrases','TableName');
+ $phrases_temp = kTempTablesHandler::GetTempName($phrases_live);
+ $sql = 'INSERT INTO '.$phrases_temp.'
+ SELECT Phrase, Translation, PhraseType, 0-PhraseId, '.$lang_id.'
+ FROM '.$phrases_live.'
+ WHERE LanguageId='.$from_lang_id;
+ $this->Conn->Query($sql);
+
+ // 2. events import
+ $em_table_live = $this->Application->getUnitOption('emailmessages','TableName');
+ $em_table_temp = kTempTablesHandler::GetTempName($em_table_live);
+
+ $sql = 'SELECT * FROM '.$em_table_live.' WHERE LanguageId = '.$from_lang_id;
+ $email_messages = $this->Conn->Query($sql);
+ if($email_messages)
+ {
+ $id = $this->Conn->GetOne('SELECT MIN(EmailMessageId) FROM '.$em_table_live);
+ if($id > 0) $id = 0;
+ $id--;
+
+ $sqls = Array();
+ foreach($email_messages as $email_message)
+ {
+ $sqls[] = $id.','.$this->Conn->qstr($email_message['Template']).','.$this->Conn->qstr($email_message['MessageType']).','.$lang_id.','.$email_message['EventId'];
+ $id--;
+ }
+ $sql = 'INSERT INTO '.$em_table_temp.'(EmailMessageId,Template,MessageType,LanguageId,EventId) VALUES ('.implode('),(',$sqls).')';
+ $this->Conn->Query($sql);
+ }
+
+ $object->SetDBField('CopyLabels', 0);
+ }
+ }
+
+ /**
+ * Prepare temp tables for creating new item
+ * but does not create it. Actual create is
+ * done in OnPreSaveCreated
+ *
+ * @param kEvent $event
+ */
+ function OnPreCreate(&$event)
+ {
+ parent::OnPreCreate($event);
+
+ $object =& $event->getObject();
+ $object->SetDBField('CopyLabels', 1);
+
+ $live_table = kTempTablesHandler::GetLiveName($object->TableName);
+ $primary_lang_id = $this->Conn->GetOne('SELECT '.$object->IDField.' FROM '.$live_table.' WHERE PrimaryLang = 1');
+
+ $object->SetDBField('CopyFromLanguage', $primary_lang_id);
+ }
+
+
+ function OnChangeLanguage(&$event)
+ {
+ $this->Application->SetVar('m_lang', $this->Application->GetVar('language'));
+
+ $this->Application->LinkVar('language', 'm_lang');
+ }
+
+ /**
+ * Parse language XML file into temp tables and redirect to progress bar screen
+ *
+ * @param kEvent $event
+ */
+ function OnImportLanguage(&$event)
+ {
+ $items_info = $this->Application->GetVar('phrases_import');
+ if($items_info)
+ {
+ list($id,$field_values) = each($items_info);
+
+ $lang_xml =& $this->Application->recallObject('LangXML');
+ $lang_xml->Parse($field_values['LangFile']['tmp_name'], $field_values['PhraseType'], $field_values['Module']);
+ }
+ $event->redirect = 'dummy';
+ $event->SetRedirectParam('lang_event', 'OnImportProgress');
+ $event->SetRedirectParam('pass', 'all,lang');
+ }
+
+ /**
+ * Copies imported from xml file from temp table to live table
+ *
+ * @param kEvent $event
+ */
+ function OnImportProgress(&$event)
+ {
+ define('IMPORT_BY', 300); // import this much records per step
+ $template_name = 'in-commerce/regional/languages_import_step2';
+
+ $import_source = (int)$this->Application->GetVar('source');
+ $import_steps = Array(0 => 'lang', 1 => 'phrases', 2 => 'emailmessages', 3 => 'finish');
+ $import_titles = Array(0 => 'la_ImportingLanguages', 1 => 'la_ImportingPhrases', 2 => 'la_ImportingEmailEvents', 3 => 'la_Done');
+
+ // --- BEFORE ---
+ $import_prefix = $import_steps[$import_source];
+ $import_start = (int)$this->Application->GetVar('start');
+ $dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
+ $src_table = kTempTablesHandler::GetTempName($dst_table);
+
+ $import_total = $this->Application->GetVar('total');
+ if(!$import_total) $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
+ // --- AFTER ---
+
+ if($import_start == $import_total)
+ {
+ $import_source++;
+ $import_prefix = $import_steps[$import_source];
+ if($import_prefix == 'finish')
+ {
+ $event->SetRedirectParam('opener','u');
+ return true;
+ }
+
+ $import_start = 0;
+ $dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
+ $src_table = kTempTablesHandler::GetTempName($dst_table);
+ $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
+ }
+
+ $done_percent = ($import_start * 100) / $import_total;
+ $block_params = Array( 'name' => $template_name,
+ 'title' => $import_titles[$import_source],
+ 'percent_done' => $done_percent,
+ 'percent_left' => 100 - $done_percent);
+
+ $this->Application->InitParser();
+ $this->Application->setUnitOption('phrases','AutoLoad',false);
+ echo $this->Application->ParseBlock($block_params);
+ flush();
+
+ $fields = array_keys( $this->Application->getUnitOption($import_prefix,'Fields') );
+
+ $sql = 'SELECT * FROM %s LIMIT %s,%s';
+ $rows = $this->Conn->Query( sprintf($sql,$src_table,$import_start,IMPORT_BY) );
+
+ $fields_sql = '';
+ foreach($fields as $field_name)
+ {
+ $fields_sql .= '`'.$field_name.'`,';
+ }
+ $fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
+ $values_sql = '';
+
+ foreach($rows as $row)
+ {
+ $values_sql .= '(';
+ foreach($row as $field_value)
+ {
+ $values_sql .= $this->Conn->qstr($field_value).',';
+ }
+ $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql).'),';
+ }
+ $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
+
+ $sql = sprintf('INSERT INTO %s (%s) VALUES %s', $dst_table, $fields_sql, $values_sql);
+ $this->Conn->Query($sql);
+
+ $event->setRedirectParams( Array('lang_event' => 'OnImportProgress', 'pass' => 'all,lang', 'start' => $import_start += count($rows), 'total' => $import_total, 'source' => $import_source) );
+ }
+
+ /**
+ * Stores ids of selected languages and redirects to export language step 1
+ *
+ * @param kEvent $event
+ */
+ function OnExportLanguage(&$event)
+ {
+ $this->Application->setUnitOption('phrases','AutoLoad',false);
+
+ $this->StoreSelectedIDs($event);
+ $this->Application->StoreVar('export_language_ids', implode(',', $this->getSelectedIDs($event)) );
+
+ $event->setRedirectParams( Array('m_opener'=>'d','phrases.export_event'=>'OnNew','pass'=>'all,phrases.export') );
+ $event->redirect = 'in-commerce/regional/languages_export';
+ }
+
+ /**
+ * Saves selected languages to xml file passed
+ *
+ * @param kEvent $event
+ */
+ function OnExportProgress(&$event)
+ {
+ $this->Application->setUnitOption('phrases','AutoLoad',false);
+ $object =& $this->Application->recallObject('phrases.export');
+
+ $items_info = $this->Application->GetVar('phrases_export');
+ if($items_info)
+ {
+ list($id,$field_values) = each($items_info);
+
+ $lang_ids = explode(',', $this->Application->RecallVar('export_language_ids') );
+
+ if( !getArrayValue($field_values,'LangFile') )
+ {
+ $object->SetError('LangFile', 'required');
+ $event->redirect = false;
+ return false;
+ }
+ if( !is_writable(EXPORT_PATH) )
+ {
+ $object->SetError('LangFile', 'write_error', 'la_ExportFolderNotWritable');
+ $event->redirect = false;
+ return false;
+ }
+ $field_values['LangFile'] .= '.lang';
+ $filename = EXPORT_PATH.'/'.$field_values['LangFile'];
+
+ $lang_xml =& $this->Application->recallObject('LangXML');
+ $lang_xml->Create($filename, $field_values['PhraseType'], $lang_ids, $field_values['Module']);
+
+ }
+
+ $event->redirect = 'in-commerce/regional/languages_export_step2';
+ $event->SetRedirectParam('export_file', $field_values['LangFile']);
+ }
+
+ /**
+ * Returns to previous template in opener stack
+ *
+ * @param kEvent $event
+ */
+ function OnGoBack(&$event)
+ {
+ $event->redirect_params['opener'] = 'u';
+ }
+
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/icons/icon46_settings_in-link.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/include/elements.php
===================================================================
diff -u -r1510 -r1566
--- trunk/admin/include/elements.php (.../elements.php) (revision 1510)
+++ trunk/admin/include/elements.php (.../elements.php) (revision 1566)
@@ -269,7 +269,7 @@
print $onLoad;
}
else
- print " onload=\"if (clear_checkboxes) clear_checkboxes();\"";
+ print " onload=\"if (clear_checkboxes) clear_checkboxes(); if (typeof(theMainScript) != 'undefined') theMainScript.ProcessOnload(); \"";
print ">";
global $b_header_addon;
Index: trunk/kernel/admin_templates/img/toolbar/tool_editcat.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_search.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_tool_import.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/config_general/config_general_event_handler.php
===================================================================
diff -u
--- trunk/kernel/units/config_general/config_general_event_handler.php (revision 0)
+++ trunk/kernel/units/config_general/config_general_event_handler.php (revision 1566)
@@ -0,0 +1,90 @@
+getObject();
+ $object->addFilter('by_name', '%1$s.Name = "In-Commerce"');
+
+ }
+
+ function OnSelectItems(&$event){
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object =& $event->getObject();
+
+ $selected_cat=$this->Application->GetVar("c");
+ reset($selected_cat);
+ //print_r($selected_cat);
+ foreach($selected_cat as $cat_resource_id=>$val){}
+
+
+ if ($cat_resource_id){
+ $category_id = $this->Conn->GetOne('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ResourceId='.$cat_resource_id);
+ $this->Application->StoreVar("StoredRootCatId", $category_id);
+ }
+
+ $event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf,confg');
+
+ $this->finalizePopup($event,'confg','in-commerce/config/config_general.tpl');
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+
+
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+
+ function OnAfterItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ }
+
+ function OnUpdate(&$event)
+ {
+ parent::OnUpdate($event);
+ $event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
+ }
+
+ function OnCancel(&$event)
+ {
+ parent::OnCancel($event);
+ $event->redirect_params = Array('opener' => 's', 'pass'=>'all,confg'); //stay!
+ }
+
+ /*
+ function myUrlDecode($str){
+ $str=str_replace(';',':', $str);
+ $str=str_replace('!','-', $str);
+ return $str;
+ }
+
+ function myUrlEncode($str){
+ $str=str_replace('-', '!', $str);
+ $str=str_replace(':', ';', $str);
+ return $str;
+ }
+ */
+
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/icons/icon46_list_banlist.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_cat_new.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/general/inp_login_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/icons/icon24_conf_general.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_paymenttype_f2.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/general_config.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/tools/debug_sample.php
===================================================================
diff -u -r874 -r1566
--- trunk/tools/debug_sample.php (.../debug_sample.php) (revision 874)
+++ trunk/tools/debug_sample.php (.../debug_sample.php) (revision 1566)
@@ -1,114 +1,39 @@
Affected_Rows().'] '.$after;
+
}
- if($newline) $msg .= "
\n";
- if( defined('SQL_TO_SCREEN') && SQL_TO_SCREEN == 1 ) echo $msg;
- if( defined('SQL_TO_FILE') && SQL_TO_FILE == 1 )
+ function isSkipTable($sql)
{
- if($file_reset == false && defined('SQL_OVERWRITE') && SQL_OVERWRITE)
- {
- if( file_exists(SQL_OUTPUT) ) unlink(SQL_OUTPUT);
- $file_reset = true;
- }
- $msg = str_replace(Array("
\n",'
','<','>','"'),Array('','','<','>','"'),$msg);
- $fp = fopen(SQL_OUTPUT, 'a');
- fwrite($fp,$msg);
- fclose($fp);
+ static $skipTables = Array( 'Modules','Language','PermissionConfig','PermCache',
+ 'SessionData','ConfigurationValues','Events','Phrase',
+ 'PersistantSessionData','EmailQueue','UserSession',
+ 'Permissions','ThemeFiles');
+
+ foreach($skipTables as $table) if( tableMatch($table,$sql) ) return true;
+ return false;
}
- }
-
- /**
- * @return string
- * @desc Returnts trace results to place where called from
- */
- function trace()
- {
- die('Error: Depricated call. Use $debugger->appendTrace(); instead');
- /*$trace_results = debug_backtrace();
- array_shift($trace_results);
- echo 'Called from ['.$trace_results[0]['function'].']
';
- print_pre($trace_results);*/
- }
-
- function DebugByFile()
- {
- $ScriptName = basename( $_SERVER['PHP_SELF'] );
- switch ($ScriptName)
+
+ function tableMatch($table_name,$sql)
{
- case 'step3.php':
- global $objSession;
- $objSession->SetVariable('import_sql_type', 'mysql');
- $objSession->SetVariable('import_server', 'localhost');
- $objSession->SetVariable('import_db', 'alex_in_portal'); //maris_inlink');
- $objSession->SetVariable('import_user', 'dev');
- $objSession->SetVariable('import_pass', 'dev-25-sql');
-
- $objSession->SetVariable('categoryid', 101); // resource id
- $objSession->SetVariable('import_category_id', 1); // category id
- $objSession->SetVariable('catnavbar', 'Home>Directory (debug_auto_complete)');
- $objSession->SetVariable('user_admin_names','admin');
- $objSession->SetVariable('user_admin_values', 11);
- $objSession->SetVariable('user_regular_names','Member');
- $objSession->SetVariable('user_regular_values', 13);
- break;
+ static $prefix = '';
+ $prefix = defined('TABLE_PREFIX')?TABLE_PREFIX:GetTablePrefix();
+ return strpos($sql,$prefix.$table_name)!==false;
}
}
-
?>
\ No newline at end of file
Index: trunk/themes/default/img/btn_continue_shopping.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_foldersearch.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_manufacturer_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_reset_to_user.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_currency.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/include/parseditem.php
===================================================================
diff -u -r1462 -r1566
--- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 1462)
+++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 1566)
@@ -273,7 +273,7 @@
{
if($this->IsPopItem())
{
- $ret = $element->attributes["_label"];
+ $ret = $element->GetAttributeByName('_label');
if(!strlen($ret))
$ret = "lu_pop";
$ret = language($ret);
@@ -923,6 +923,7 @@
$n = new $this->classname();
$n->tablename = $this->SourceTable;
$n->LoadFromDatabase($ID);
+ $n->Set( $n->IdField(), $ID ); // in case if no loaded set ID anyway
$index = array_push($this->Items, $n);
$i =& $this->Items[count($this->Items)-1];
}
@@ -1662,7 +1663,7 @@
echo "Items Queries: ".$this->QueryItemCount."
";
echo "=====
";
*/
- if($this->Page > $NumPages && $PerPage != -1)
+ if( ($this->Page > $NumPages || $this->Page == 0) && $PerPage != -1)
{
switch($fix_method)
{
@@ -2076,29 +2077,22 @@
return $ret;
}
- function SqlGlobalCount($attribs=array())
- {
- global $objSession;
-
- $p = $this->BasePermission.".VIEW";
- $t = $this->SourceTable;
- if($attribs["_today"])
- {
- $today = mktime(0,0,0,date("m"),date("d"),date("Y"));
- $where = "($t.CreatedOn>=$today)";
- }
+ function SqlGlobalCount($attribs=array())
+ {
+ global $objSession;
+
+ $p = $this->BasePermission.".VIEW";
+ $t = $this->SourceTable;
+ if( getArrayValue($attribs,'_today') )
+ {
+ $today = mktime(0,0,0,date("m"),date("d"),date("Y"));
+ $where = "($t.CreatedOn>=$today)";
+ }
- if($attribs["_grouponly"])
- {
- $GroupList = $objSession->Get("GroupList");
- }
- else
- $GroupList = NULL;
-
- $sql = $this->GetCountSQL($p,NULL,$GroupList,$where);
-
- return $sql;
- }
+ $GroupList = getArrayValue($attribs,'_grouponly') ? $objSession->Get('GroupList') : null;
+ $sql = $this->GetCountSQL($p,NULL,$GroupList);
+ return $sql;
+ }
function DoGlobalCount($attribs)
{
Index: trunk/kernel/admin_templates/img/toolbar/tool_deny_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/blocks2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_listing_types.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_payment_primary.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_validate_continue_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_reset_to_base.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/include/portalgroup.php
===================================================================
diff -u -r955 -r1566
--- trunk/kernel/include/portalgroup.php (.../portalgroup.php) (revision 955)
+++ trunk/kernel/include/portalgroup.php (.../portalgroup.php) (revision 1566)
@@ -32,7 +32,7 @@
function HasSystemPermission($PermissionName)
{
- $GroupId = $this->Get("GroupId");
+ $GroupId = (int)$this->Get("GroupId");
$sql = "SELECT * FROM ".GetTablePrefix()."Permissions WHERE GroupId=$GroupId AND Permission='$PermissionName' AND type=1";
$result = $this->adodbConnection->Execute($sql);
if($result && !$result->EOF)
Index: trunk/kernel/admin_templates/img/toolbar/tool_arrange_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default/my_account.tpl
===================================================================
diff -u -r601 -r1566
--- trunk/themes/default/my_account.tpl (.../my_account.tpl) (revision 601)
+++ trunk/themes/default/my_account.tpl (.../my_account.tpl) (revision 1566)
@@ -212,6 +212,9 @@

|
+
+
+

|
Index: trunk/kernel/admin_templates/img/old/menu_check_in.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_orders.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_modules.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_select_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_cat_settings.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_cat_denied.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/category_items/category_items_dbitem.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/in-link/toolbar/tool_new_link.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/cat_dbitem.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/icons/icon24_link_editor.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_option_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/icon16_search_reset_f2.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/category_items/category_items_tag_processor.php'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/custom_fields.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/icons/icon46_list_validate.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_cat_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_primary_currency_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_cat_hot.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_language.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_tools.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_theme_disabled.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_search_b_f2.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/cat_dblist.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/toolbar/tool_archive.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/script.js
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/script.js (revision 0)
+++ trunk/kernel/admin_templates/incs/script.js (revision 1566)
@@ -0,0 +1,418 @@
+var Grids = new Array();
+var Toolbars = new Array();
+var $Menus = new Array();
+var $ViewMenus = new Array();
+if(!$fw_menus) var $fw_menus = new Array();
+
+var $env = '';
+var submitted = false;
+
+function resort_grid(prefix_special,field,form_action)
+{
+ document.getElementById(prefix_special+'_Sort1').value = field;
+ submit_event(prefix_special,'OnSetSorting',null,form_action);
+}
+
+function direct_sort_grid($prefix_special,$field,$direction,$field_pos)
+{
+ if(!isset($field_pos)) $field_pos = 1;
+ 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');
+}
+
+function reset_sorting($prefix_special)
+{
+ submit_event($prefix_special,'OnResetSorting');
+}
+
+function set_per_page($prefix_special,$per_page)
+{
+ set_hidden_field($prefix_special+'_PerPage',$per_page);
+ submit_event($prefix_special,'OnSetPerPage');
+}
+
+function submit_event(prefix_special,event,t,form_action)
+{
+ if (isset(event)) {
+ set_hidden_field('events['+prefix_special+']', event);
+ }
+
+ if(isset(t)) document.getElementById('t').value = t;
+ if(isset(form_action)) {
+ var old_env = '';
+ if ( !form_action.match(/\?/) ) {
+ document.getElementById('kernel_form').action.match(/.*(\?.*)/);
+ old_env = RegExp.$1;
+ }
+ document.getElementById('kernel_form').action = form_action+old_env;
+ }
+ submit_kernel_form();
+}
+
+function show_form_data()
+{
+ var $kf = document.getElementById('kernel_form');
+ $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('kernel_form');
+
+ if (typeof $form.onsubmit == "function") {
+ $form.onsubmit();
+ }
+
+ $form.submit();
+ $form.target = '';
+ $form.t.value = 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 print_pre(variable)
+{
+ var s = "";
+ for (prop in variable) {
+ s += prop+" => "+variable[prop] + "";
+ }
+ alert(s);
+}
+
+function go_to_page(prefix_special, page)
+{
+ set_hidden_field(prefix_special+'_Page', page);
+ submit_event(prefix_special);
+}
+
+function go_to_list(prefix_special, tab)
+{
+ document.getElementById(prefix_special+'_GoTab').value = tab;
+ submit_event(prefix_special,'OnUpdateAndGoToTab',null);
+}
+
+function go_to_tab(prefix_special, tab)
+{
+ document.getElementById(prefix_special+'_GoTab').value = tab;
+ submit_event(prefix_special,'OnPreSaveAndGoToTab',null);
+}
+
+function go_to_id(prefix_special, id)
+{
+ document.getElementById(prefix_special+'_GoId').value = id;
+ submit_event(prefix_special,'OnPreSaveAndGo')
+}
+
+// in-portal compatibility functions: begin
+function getScriptURL($script_name)
+{
+ var $asid = document.getElementById('sid').value;
+ return base_url+$script_name+'?env='+( isset($env)&&$env?$env:$asid )+'&en=0';
+}
+
+function OpenEditor(extra_env,TargetForm,TargetField)
+{
+ var $url = getScriptURL('admin/editor/editor_new.php');
+ $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);
+}
+// in-portal compatibility functions: end
+
+
+function PreSaveAndOpenTranslator(prefix,field,t,$width,$height)
+{
+ if(!isset($window_name)) var $window_name = 'select_'+t.replace(/(\/|-)/g, '_');
+ if(!isset($width)) $width=750;
+ if(!isset($height)) $height=400;
+ openwin('',$window_name,$width,$height);
+ set_hidden_field('translator_wnd_name', $window_name);
+ set_hidden_field('translator_field', field);
+ set_hidden_field('translator_t', t);
+ document.kernel_form.target=$window_name;
+ submit_event(prefix,'OnPreSaveAndOpenTranslator');
+}
+
+function openTranslator(prefix,field,url,wnd)
+{
+ 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)[2];
+ document.kernel_form.target = wnd;
+ submit_event(prefix,'',$t,url);
+}
+
+function openSelector($prefix,$url,$window_name,$width,$height,$event)
+{
+ var $regex = new RegExp('(.*)\?env=' + document.getElementById('sid').value + '-(.*?):(.*)');
+ var $t = $regex.exec($url)[2];
+ if(!isset($window_name)) var $window_name = 'select_'+$t.replace(/(\/|-)/g, '_');
+ if(!isset($width)) $width=750;
+ if(!isset($height)) $height=400;
+ if(!isset($event)) $event='';
+ set_hidden_field('m_opener','s');
+ openwin('',$window_name,$width,$height);
+ set_hidden_field('main_prefix', $prefix);
+ document.kernel_form.target=$window_name;
+ var old_action = document.kernel_form.action;
+ document.kernel_form.action = $url;
+ submit_event($prefix,$event,$t);
+ document.kernel_form.action = old_action;
+}
+
+function openwin($url,$name,$width,$height)
+{
+ var $window_params = 'width='+$width+',height='+$height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no';
+ return window.open($url,$name,$window_params);
+}
+
+function opener_action(new_action)
+{
+ document.getElementById('m_opener').value=new_action;
+}
+
+function std_precreate_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ set_hidden_field(prefix_special+'_mode', 't');
+ submit_event(prefix_special,'OnPreCreate', edit_template)
+}
+
+function std_new_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ submit_event(prefix_special,'OnNew', edit_template)
+}
+
+function std_edit_item(prefix_special, edit_template)
+ {
+ opener_action('d');
+ set_hidden_field(prefix_special+'_mode', 't');
+ submit_event(prefix_special,'OnEdit',edit_template)
+}
+
+function std_edit_temp_item(prefix_special, edit_template)
+{
+ opener_action('d');
+ submit_event(prefix_special,'',edit_template)
+}
+
+function std_delete_items(prefix_special)
+{
+ if (inpConfirm('Are you sure you want to delete selected items?'))
+ submit_event(prefix_special,'OnMassDelete')
+}
+
+// sets hidden field value
+// if the field does not exist - creates it
+function set_hidden_field($field_id, $value)
+{
+ var $field = document.getElementById($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;
+ document.kernel_form.appendChild($field);
+ return false;
+}
+
+function search($prefix_special, $grid_name)
+{
+ set_hidden_field('grid_name', $grid_name);
+ submit_event($prefix_special,'OnSearch');
+}
+
+function search_reset($prefix_special)
+{
+ submit_event($prefix_special,'OnSearchReset');
+}
+
+function search_keydown($event)
+{
+ if(!$event && window.event) $event = window.event;
+ if($event.keyCode == 13)
+ {
+ var $prefix_special = this.getAttribute('PrefixSpecial');
+ var $grid = this.getAttribute('Grid');
+ search($prefix_special,$grid);
+ }
+}
+
+function getRealLeft(el)
+{
+ xPos = el.offsetLeft;
+ tempEl = el.offsetParent;
+ while (tempEl != null)
+ {
+ xPos += tempEl.offsetLeft;
+ tempEl = tempEl.offsetParent;
+ }
+ return xPos;
+}
+
+function getRealTop(el)
+{
+ yPos = el.offsetTop;
+ tempEl = el.offsetParent;
+ while (tempEl != null)
+ {
+ yPos += tempEl.offsetTop;
+ tempEl = tempEl.offsetParent;
+ }
+ return yPos;
+}
+
+function show_viewmenu($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);
+ }
+}
+
+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)
+{
+ set_hidden_field('filter_id',$filter_id);
+ set_hidden_field('filter_value',$filter_value);
+ submit_event($prefix_special,'OnSetFilter');
+}
+
+function filters_remove_all($prefix_special)
+{
+ submit_event($prefix_special,'OnRemoveFilters');
+}
+
+function filters_apply_all($prefix_special)
+{
+ submit_event($prefix_special,'OnApplyFilters');
+}
+
+function RemoveTranslationLink($string)
+{
+ return $string.match(/(.*)<\/a>/) ? RegExp.$2 : $string;
+}
+
+function redirect($url)
+{
+ window.location.href = $url;
+}
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/icons/icon24_settings_email.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_currency_disabled.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/translator/translator_config.php
===================================================================
diff -u
--- trunk/core/units/translator/translator_config.php (revision 0)
+++ trunk/core/units/translator/translator_config.php (revision 1566)
@@ -0,0 +1,52 @@
+ 'trans',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'TranslatorEventHandler','file'=>'translator_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'AutoLoad' => false,
+ 'hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'prefix',
+ 2 => 'field',
+ 3 => 'event',
+ ),
+ 'IDField' => 'N/A',
+
+ 'TitleField' => 'Translator',
+
+ 'TitlePhrase' => 'la_text_Translation',
+
+ 'TitlePresets' => Array(
+ 'default' => Array(
+ 'new_status_labels' => Array('trans'=>'!la_title_Adding_Order!'),
+ 'edit_status_labels' => Array('trans'=>'!la_title_Editing_Order!'),
+ 'new_titlefield' => Array('trans'=>'!la_title_New_Order!'),
+ ),
+
+ 'trans_edit' => Array('prefixes' => Array('trans'), 'format' => '!la_title_EditingTranslation!'),
+
+ ),
+ /*
+ 'TableName' => 'N/A',
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',),
+
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',),*/
+
+ 'Fields' => Array(
+ ),
+
+ 'VirtualFields' => Array(
+ 'Original' => Array(),
+ 'Language' => Array(),
+ 'SwitchLanguage' => Array('formatter'=>'kOptionsFormatter',
+ 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'Language', 'option_key_field'=>'LanguageId','option_title_field'=>'PackName'),
+ 'Translation' => Array(),
+ ),
+ 'Grids' => Array(),
+ );
+
+?>
\ No newline at end of file
Index: trunk/themes/default/img/ic_head_incommerce.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tab.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tab_active_back2.jpg
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/inp1_parser.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/icons/icon46_list_summary_logs.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/in-link/icon46_settings_in-link.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_validate_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/browse.php
===================================================================
diff -u -r1510 -r1566
--- trunk/admin/browse.php (.../browse.php) (revision 1510)
+++ trunk/admin/browse.php (.../browse.php) (revision 1566)
@@ -14,11 +14,35 @@
##############################################################
//$pathtoroot="";
+
+//KERNEL4 STARTUP - FOR ACTIONS HANDLING
+
+function k4getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+
+$start = k4getmicrotime();
+
+define('ADMIN', 1);
+define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
+define('APPLICATION_CLASS', 'MyApplication');
+define('ADMINS_LIST','/in-portal/users/users.php');
+include_once(FULL_PATH."/kernel/kernel4/startup.php");
+
+$application =& kApplication::Instance();
+$application->Init();
+$application->ProcessRequest();
+if($application->GetVar('Action') == 'm_paste') define('REDIRECT_REQUIRED',1); // this script can issue redirect header
+
+//KERNEL4 END
+
define('REQUIRE_LAYER_HEADER', 1);
$b_topmargin = "0";
//$b_header_addon = "

";
-if(!strlen($pathtoroot))
+if( !(isset($pathtoroot) && $pathtoroot) )
{
$path=dirname(realpath(__FILE__));
if(strlen($path))
@@ -134,6 +158,20 @@
@include_once($path);
}
}
+
+
+$application->InitParser();
+
+$cat_templates = $objModules->ExecuteFunction('GetModuleInfo', 'catalog_template');
+foreach ($cat_templates as $a_mod => $a_template) {
+ if (!$a_template) continue;
+ $a_var = $a_mod.'_TAB_HTML';
+ $$a_var = $application->ParseBlock(Array('name'=>$a_template), 0, true);
+}
+
+//$application->SetVar('t', 'in-commerce/products/products_catalog');
+
+
if(!defined('IS_INSTALL'))define('IS_INSTALL',0);
if(!IS_INSTALL)
{
@@ -177,11 +215,16 @@
// where should all edit popups submit changes
$objSession->SetVariable("ReturnScript", basename($_SERVER['PHP_SELF']) );
$charset = GetRegionalOption('Charset');
+
+$m_tag_processor =& $application->recallObject('m_TagProcessor');
+$base_href = $m_tag_processor->Base_Ref();
+
/* page header */
print <<
In-portal
+ $base_href
+
+
+
+
+
+
+
+
+
+
+
+
+
+>
+
+
+
+
Reload frame ||
Show debugger
+
+
+
+
+
+
+
+
+
+
">
+
">
+
+
+
+
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_move_down.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin/include/toolbar/catselect.php
===================================================================
diff -u -r407 -r1566
--- trunk/kernel/admin/include/toolbar/catselect.php (.../catselect.php) (revision 407)
+++ trunk/kernel/admin/include/toolbar/catselect.php (.../catselect.php) (revision 1566)
@@ -277,7 +277,7 @@
catch(err)
{
}
- bf.$destfield.value = CheckList('categories');
+ bf.elements['$destfield'].value = CheckList('categories');
bf.submit();
window.close();
}
@@ -366,7 +366,7 @@
function check_submit(page,actionValue)
{
- if (actionValue.match(/delete$/)) {
+ if (actionValue.match(/delete$/)) {
if (!theMainScript.Confirm(lang_DeleteConfirm)) return;
}
Index: trunk/kernel/admin_templates/img/toolbar/tool_archive_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_template_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_cat_disabled.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/include/fw_menu.js
===================================================================
diff -u -r13 -r1566
--- trunk/admin/include/fw_menu.js (.../fw_menu.js) (revision 13)
+++ trunk/admin/include/fw_menu.js (.../fw_menu.js) (revision 1566)
@@ -50,15 +50,22 @@
this.onMenuItemAction = onMenuItemAction;
this.hideMenu = hideMenu;
this.hideChildMenu = hideChildMenu;
-
+
+ label = RemoveTranslationLink(label);
if (!window.menus) window.menus = new Array();
this.label = label || "menuLabel" + window.menus.length;
window.menus[this.label] = this;
window.menus[window.menus.length] = this;
if (!window.activeMenus) window.activeMenus = new Array();
}
+function RemoveTranslationLink($string)
+{
+ return $string.match(/
(.*)<\/a>/) ? RegExp.$2 : $string;
+}
+
function addMenuItem(label, action, type) {
+ if( typeof(label) == 'string' ) label = RemoveTranslationLink(label);
this.items[this.items.length] = label;
this.actions[this.actions.length] = action;
if (type == 1) this.types[this.types.length] = this.imagePath+"check_on.gif";
Index: trunk/kernel/admin_templates/img/toolbar/tool_clone_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/list_horiz_propagate.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/help/help_tag_processor.php
===================================================================
diff -u
--- trunk/kernel/units/help/help_tag_processor.php (revision 0)
+++ trunk/kernel/units/help/help_tag_processor.php (revision 1566)
@@ -0,0 +1,62 @@
+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 = $this->Application->GetVar('h_title_preset');
+
+ $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;
+
+ $ret = parent::SectionTitle($params);
+
+
+
+ return $ret;
+ }
+
+ function ShowHelp($params)
+ {
+ $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( strtolower($module) );
+ $module_path = $this->Conn->GetOne($sql);
+
+ $help_file = FULL_PATH.'/'.$module_path.'module_help/'.$title_preset.'.txt';
+
+ if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_EDIT_HELP') )
+ {
+ global $debugger;
+ $ret = 'Help file: '.$debugger->getLocalFile($help_file).'
';
+ }
+ else
+ {
+ $ret = '';
+ }
+
+ if( file_exists($help_file) )
+ {
+ $ret .= file_get_contents($help_file);
+ }
+ else
+ {
+ $ret .= $this->Application->Phrase('la_section_help_file_missing');
+ }
+ return $ret;
+ }
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_next_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_validate.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_refresh.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/install/inportal_data.sql
===================================================================
diff -u -r1384 -r1566
--- trunk/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 1384)
+++ trunk/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 1566)
@@ -39,6 +39,7 @@
INSERT INTO ConfigurationAdmin VALUES ('SocketBlockingMode', 'la_Text_Website', 'la_prompt_socket_blocking_mode', 'checkbox', NULL, NULL, 11, 0);
INSERT INTO ConfigurationAdmin VALUES ('Min_UserName', 'la_Text_General', 'la_text_min_username', 'text', '', '', 1, 0);
INSERT INTO ConfigurationAdmin VALUES ('Min_Password', 'la_Text_General', 'la_text_min_password', 'text', '', '', 2, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Email_As_Login', 'la_Text_General', 'la_use_emails_as_login', 'checkbox', NULL, NULL, 1, 0);
INSERT INTO ConfigurationValues VALUES ('Columns_Category', '2', 'In-Portal', 'Categories')
INSERT INTO ConfigurationValues VALUES ('DomainSelect','1','In-Portal','in-portal:configure_general')
@@ -153,6 +154,7 @@
INSERT INTO ConfigurationValues VALUES ('Perpage_CustomData', '20', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES ('Search_MinKeyword_Length', '3', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES ('Users_AllowReset', '180', 'In-Portal:Users', 'in-portal:configure_users');
+INSERT INTO ConfigurationValues VALUES ('Email_As_Login', '1', 'In-Portal:Users', 'in-portal:configure_users');
INSERT INTO Events VALUES (30, 'USER.ADD', 1, 0, 'In-Portal:Users', 'la_event_user.add', 0)
INSERT INTO Events VALUES (32, 'USER.ADD', 2, 0, 'In-Portal:Users', 'la_event_user.add', 1)
Index: trunk/kernel/admin_templates/img/itemicons/icon16_review_disabled.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_archives.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default/img/backordered.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_catsearch.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_import_language_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tab_back.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_search_reset.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_settings_email.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_manufacturers.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/configuration/configuration_tag_processor.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/toolbar/tool_view_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_user_denied.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_stop_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/action.php
===================================================================
diff -u -r1381 -r1566
--- trunk/kernel/action.php (.../action.php) (revision 1381)
+++ trunk/kernel/action.php (.../action.php) (revision 1566)
@@ -1224,7 +1224,7 @@
if(!(int)$_POST["enabled"])
$Primary = 0;
$t = $objEditItems->AddTheme($_POST["name"],$_POST["description"],(int)$_POST["enabled"],$Primary,
- (int)$_POST["CacheTimeout"]);
+ (int)$_POST["CacheTimeout"],GetVar('StylesheetId'));
$t->Files->ThemeId=$t->Get("ThemeId");
$rs = $ado->Execute("SELECT MIN(ThemeId) as MinValue FROM ".$objEditItems->SourceTable);
@@ -1244,7 +1244,7 @@
$Primary = 0;
$objEditItems->EditTheme($_POST["ThemeId"],$_POST["name"],$_POST["description"],
- (int)$_POST["enabled"],$Primary,(int)$_POST["CacheTimeout"]);
+ (int)$_POST["enabled"],$Primary,(int)$_POST["CacheTimeout"], GetVar('StylesheetId'));
// if ($Primary==1)
// {
// $objEditItems->SetPrimaryTheme($_POST["ThemeId"]);
Index: trunk/kernel/admin_templates/img/icons/icon24_users.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_tool_backup.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_image_disabled.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/inp_login_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_order.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_ship_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/languages/languages_tag_processor.php
===================================================================
diff -u
--- trunk/kernel/units/languages/languages_tag_processor.php (revision 0)
+++ trunk/kernel/units/languages/languages_tag_processor.php (revision 1566)
@@ -0,0 +1,61 @@
+Application->GetVar('phrases_label');
+
+ $top_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
+ if( $this->Application->GetVar($top_prefix.'_mode') == 't' && !$edit_direct )
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params);
+ return $object->GetDBField('Charset');
+ }
+ $lang_current =& $this->Application->recallObject('lang.current');
+ return $lang_current->GetDBField('Charset');
+ }
+
+ function ListLanguages($params)
+ {
+ $this->Special = 'list';
+ return $this->PrintList2($params);
+ }
+
+ function SelectedLanguage($params)
+ {
+ $object =& $this->Application->recallObject($this->getPrefixSpecial());
+
+ return $object->GetDBField('LanguageId') == $this->Application->RecallVar('m_lang');
+ }
+
+ /**
+ * Returns path where exported languages should be saved
+ *
+ * @param unknown_type $params
+ */
+ function ExportPath($params)
+ {
+ $admin_folder = $this->Application->ConfigValue('AdminDirectory');
+ if(!$admin_folder) $admin_folder = 'admin';
+ $ret = DOC_ROOT.BASE_PATH.'/'.$admin_folder.'/export/';
+
+ if( getArrayValue($params,'as_url') )
+ {
+ $ret = str_replace( DOC_ROOT.BASE_PATH.'/', $this->Application->BaseURL(), $ret);
+ }
+ return $ret;
+ }
+
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_primary_paymenttype_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_conf_general.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/smicon6.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_preview_template_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/help/help_tag_processor.php
===================================================================
diff -u
--- trunk/core/units/help/help_tag_processor.php (revision 0)
+++ trunk/core/units/help/help_tag_processor.php (revision 1566)
@@ -0,0 +1,62 @@
+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 = $this->Application->GetVar('h_title_preset');
+
+ $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;
+
+ $ret = parent::SectionTitle($params);
+
+
+
+ return $ret;
+ }
+
+ function ShowHelp($params)
+ {
+ $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( strtolower($module) );
+ $module_path = $this->Conn->GetOne($sql);
+
+ $help_file = FULL_PATH.'/'.$module_path.'module_help/'.$title_preset.'.txt';
+
+ if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_EDIT_HELP') )
+ {
+ global $debugger;
+ $ret = 'Help file: '.$debugger->getLocalFile($help_file).'
';
+ }
+ else
+ {
+ $ret = '';
+ }
+
+ if( file_exists($help_file) )
+ {
+ $ret .= file_get_contents($help_file);
+ }
+ else
+ {
+ $ret .= $this->Application->Phrase('la_section_help_file_missing');
+ }
+ return $ret;
+ }
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_return_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_usertogroup_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_conf_regional.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_custom.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/configuration/configuration_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/units/languages/languages_item.php
===================================================================
diff -u
--- trunk/kernel/units/languages/languages_item.php (revision 0)
+++ trunk/kernel/units/languages/languages_item.php (revision 1566)
@@ -0,0 +1,12 @@
+IDField.') FROM '.kTempTablesHandler::GetLiveName($this->TableName);
+ return $this->Conn->GetOne($sql) + 1;
+ }
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/tab_back.jpg
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_settings_output.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_move_down_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_search_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/progress_bar_segment.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_cat_pending.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/icon16_search_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_summary.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/button_back.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/languages/languages_config.php
===================================================================
diff -u
--- trunk/core/units/languages/languages_config.php (revision 0)
+++ trunk/core/units/languages/languages_config.php (revision 1566)
@@ -0,0 +1,140 @@
+ 'lang',
+ 'ItemClass' => Array('class'=>'LanguagesItem','file'=>'languages_item.php','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'LanguagesEventHandler','file'=>'languages_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'LanguagesTagProcessor','file'=>'languages_tag_processor.php','build_event'=>'OnBuild'),
+
+ 'RegisterClasses' => Array(
+ Array('pseudo'=>'LangXML','class'=>'LangXML_Parser','file'=>'import_xml.php'),
+ ),
+
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnReflectMultiLingualFields',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnPreSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnCopyLabels',
+ ),
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+ 'IDField' => 'LanguageId',
+
+ 'StatusField' => Array('Enabled','PrimaryLang'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'PackName', // field, used in bluebar when editing existing item
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('lang'=>'!la_title_Adding_Language!'),
+ 'edit_status_labels' => Array('lang'=>'!la_title_Editing_Language!'),
+ 'new_titlefield' => Array('lang'=>'!la_title_New_Language!'),
+ ),
+
+ 'languages_list' => Array( 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks! (#lang_recordcount#)"),
+
+ 'languages_edit_general' => Array( 'prefixes' => Array('lang'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_General!"),
+
+ 'phrases_list' => Array( 'prefixes' => Array('lang','phrases_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_Labels! (#phrases_recordcount#)"),
+
+ 'import_language' => Array( 'prefixes' => Array('phrases.import'), 'format' => "!la_title_InstallLanguagePackStep1!"),
+
+ 'import_language_step2' => Array( 'prefixes' => Array('phrases.import'), 'format' => "!la_title_InstallLanguagePackStep2!"),
+
+ 'export_language' => Array( 'prefixes' => Array('phrases.export'), 'format' => "!la_title_ExportLanguagePackStep1!"),
+
+ 'export_language_results' => Array( 'prefixes' => Array('phrases.export'), 'format' => "!la_title_ExportLanguagePackResults!"),
+
+ 'events_list' => Array( 'prefixes' => Array('lang','emailevents_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EmailEvents! (#emailevents_recordcount#)"),
+
+ 'event_edit' => Array( 'prefixes' => Array('emailevents'),
+ 'edit_status_labels' => Array('emailevents' => '!la_title_Editing_EmailEvent!'),
+ 'format' => '#emailevents_status# - #emailevents_titlefield#'),
+
+ 'email_messages_edit' => Array( 'prefixes' => Array('lang','emailmessages'),
+ 'new_titlefield' => Array('emailmessages' => '!la_NoSubject!'),
+ 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EditingEmailEvent! '#emailmessages_titlefield#'"),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Language',
+ 'SubItems' => Array('phrases','emailmessages'),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array(0,1), 'type' => WHERE_FILTER),
+ ),
+
+ 'Filters' => Array(
+ 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
+ 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
+ )
+ ),
+
+ 'AutoDelete' => true,
+
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('PackName' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'LanguageId' => Array(),
+ 'PackName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'LocalName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => '1', 'default' => '0'),
+ 'PrimaryLang' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'IconURL' => Array('type' => 'string','default' => ''),
+ 'DateFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'TimeFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'DecimalPoint' => Array('type' => 'string','not_null' => '1','default' => '.'),
+ 'ThousandSep' => Array('type' => 'string','not_null' => '1','default' => ','),
+ 'Charset' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ ),
+
+ 'VirtualFields' => Array(
+ 'CopyLabels' => Array('type' => 'int', 'default' => 0),
+ 'CopyFromLanguage' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Language ORDER BY PackName', 'option_title_field' => 'PackName', 'option_key_field' => 'LanguageId'),
+ ),
+
+ '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'),
+ 'Fields' => Array(
+ 'PackName' => Array( 'title'=>'la_col_PackName', 'data_block' => 'grid_checkbox_td'),
+ 'LocalName' => Array( 'title'=>'la_col_LocalName' ),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/old/menu_edit_cat.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/arrow16.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_back.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_frontend_mail_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_tool_import.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_relation_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_reset_to_shipping_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_cat_settings.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_primary_group_f2.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/general/cat_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/units/users/users_config.php
===================================================================
diff -u
--- trunk/kernel/units/users/users_config.php (revision 0)
+++ trunk/kernel/units/users/users_config.php (revision 1566)
@@ -0,0 +1,94 @@
+ 'u',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'UsersEventHandler','file'=>'users_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'UsersTagProcessor','file'=>'users_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'u',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnAfterItemLoad', 'OnBeforeItemCreate', 'OnBeforeItemUpdate', 'OnUpdateAddress'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnPrepareStates',
+ ),
+ ),
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'PortalUserId',
+ 'TableName' => TABLE_PREFIX.'PortalUser',
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('Login' => 'asc'),
+ )
+ ),
+
+ 'SubItems' => Array('addr'),
+
+ 'Fields' => Array
+ (
+ 'PortalUserId' => Array(),
+ 'Login' => Array('type' => 'string', 'unique'=>Array('Login'), 'default' => '','required'=>1),
+ 'Password' => Array('type' => 'string', 'formatter' => 'kPasswordFormatter', 'encryption_method' => 'md5', 'verify_field' => 'VerifyPassword', 'skip_empty' => 1, 'default' => md5('') ),
+ 'FirstName' => Array('type' => 'string','default' => ''),
+ 'LastName' => Array('type' => 'string','default' => ''),
+ 'Email' => Array('type' => 'string', 'formatter'=>'kFormatter', 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/', 'unique'=>Array('Email'), 'not_null' => '1', 'required'=>1, 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!') ),
+ 'CreatedOn' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'default'=>time(), 'not_null' => '1' ),
+ 'Phone' => Array('type' => 'string','default' => ''),
+ 'Street' => Array('type' => 'string','default' => ''),
+ 'City' => Array('type' => 'string','default' => ''),
+ 'State' => Array('formatter'=>'kOptionsFormatter',
+ 'options' => Array(),
+ 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
+ 'not_null' => '1','default' => ''),
+ 'Zip' => Array('type' => 'string','default' => ''),
+ 'Country' => Array('formatter'=>'kOptionsFormatter',
+ 'options_sql'=>'SELECT %s
+ FROM '.TABLE_PREFIX.'StdDestinations
+ LEFT JOIN '.TABLE_PREFIX.'Phrase
+ ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
+ WHERE
+ DestType=1
+ AND
+ LanguageId = 1
+ ORDER BY Translation',
+ 'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
+ 'not_null' => '1','default' => ''),
+ 'ResourceId' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(1=>'la_Enabled', 0=>'la_Disabled', 2=>'la_Pending'), 'use_phrases'=>1, 'not_null' => '1','default' => 2),
+ 'Modified' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1', 'default' => time() ),
+ 'dob' => Array('type'=>'int', 'formatter' => 'kDateFormatter', 'not_null' => '1', 'default' => '', 'required'=>1),
+ 'tz' => Array('type' => 'int','default' => ''),
+ 'ip' => Array('type' => 'string','default' => ''),
+ 'IsBanned' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'PassResetTime' => Array('type' => 'int','default' => ''),
+ 'PwResetConfirm' => Array('type' => 'string','default' => ''),
+ 'PwRequestTime' => Array('type' => 'int','default' => ''),
+ 'MinPwResetDelay' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array('300' => '5', '600' => '10', '900' => '15', '1800' => '30', '3600' => '60'), 'use_phrases' => 0, 'not_null' => '1', 'default' => 30),
+ ),
+
+ 'VirtualFields' => Array(
+ 'ValidateLogin' => Array('type'=>'string','default'=>''),
+ 'SubscribeEmail' => Array('type'=>'string','default'=>''),
+ ),
+
+ 'Grids' => Array(),
+
+ );
+
+?>
\ No newline at end of file
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/custom_fields/custom_fields_config.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/toolbar/tool_refresh_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_prev_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_primary_cat.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_upcat_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/include/modules.php
===================================================================
diff -u -r1462 -r1566
--- trunk/kernel/include/modules.php (.../modules.php) (revision 1462)
+++ trunk/kernel/include/modules.php (.../modules.php) (revision 1566)
@@ -44,16 +44,19 @@
if(strlen($key))
{
$parsed=FALSE;
+
$parser_name = $key . "_ParseEnv";
for($i=1; $i\n";
- if(($objConfig->Get("CookieSessions")==0 || !$FrontEnd || ($objConfig->Get("CookieSessions")==2 && $SessionQueryString==TRUE)))
- {
- if(!$objSession->UseTempKeys)
- {
- $sessionkey = $objSession->GetSessionKey();
- }
- else
- $sessionkey = $objSession->Get("CurrentTempKey");
- $env = $sessionkey;
- }
- $env .= "-";
-
- if (isset($var_list_update["t"]))
- {
- if($var_list_update["t"]=="_referer_")
- {
- $var_list_update["t"] =$objSession->GetVariable("Template_Referer");
- }
-
- $t = $var_list_update["t"];
- if(!is_numeric($t))
- {
- if(!is_object($theme))
- $theme = $objThemes->GetItem($m_var_list["theme"]);
- $id = $theme->GetTemplateId($t);
- $var_list_update["t"] = $id;
- }
- $env .= $var_list_update["t"];
- }
+ static $theme;
+
+ $env = "";
+ //echo "Query String: $SessionQueryString
\n";
+ if(($objConfig->Get("CookieSessions")==0 || !$FrontEnd || ($objConfig->Get("CookieSessions")==2 && $SessionQueryString==TRUE)))
+ {
+ if(!$objSession->UseTempKeys)
+ {
+ $sessionkey = $objSession->GetSessionKey();
+ }
+ else
+ $sessionkey = $objSession->Get("CurrentTempKey");
+ $env = $sessionkey;
+ }
+ $env .= "-";
+
+ if (isset($var_list_update["t"]))
+ {
+ if($var_list_update["t"]=="_referer_")
+ {
+ $var_list_update["t"] =$objSession->GetVariable("Template_Referer");
+ }
+
+ $t = $var_list_update["t"];
+
+ if (substr($t, 0, strlen('kernel4:')) == 'kernel4:')
+ {
+ $t = substr($t, strlen('kernel4:'));
+ $env .= $t;
+ }
+ else {
+ if(!is_numeric($t))
+ {
+ if(!is_object($theme))
+ $theme = $objThemes->GetItem($m_var_list["theme"]);
+ $id = $theme->GetTemplateId($t);
+ $var_list_update["t"] = $id;
+ }
+ $env .= $var_list_update["t"];
+ }
+ }
else
- {
- $t = isset($var_list['t']) ? $var_list['t'] : '';
- if(!is_numeric($t))
- {
- if(!is_object($theme))
- $theme = $objThemes->GetItem($m_var_list["theme"]);
- $id = $theme->GetTemplateId($t);
- $t = $id;
- }
- $env .= $t;
- }
+ {
+ $t = isset($var_list['t']) ? $var_list['t'] : '';
+ if(!is_numeric($t))
+ {
+ if(!is_object($theme))
+ $theme = $objThemes->GetItem($m_var_list["theme"]);
+ $id = $theme->GetTemplateId($t);
+ $t = $id;
+ }
+ $env .= $t;
+ }
- if(is_array($mod_prefix))
- {
- foreach($mod_prefix as $key => $value)
- {
- $builder_name = $key . "_BuildEnv";
- if(function_exists($builder_name))
- {
- $GLOBALS[$key.'_var_list_update']['test'] = 'test';
- $env .= $builder_name();
- }
- }
- }
-
- $extra = "";
- $keys = array_keys($ExtraVars);
- if(is_array($keys))
- {
- for($i=0;$i $value)
+ {
+ $builder_name = $key . "_BuildEnv";
+ if(function_exists($builder_name))
+ {
+ $GLOBALS[$key.'_var_list_update']['test'] = 'test';
+ $env .= $builder_name();
+ }
+ }
+ }
- $e = "&".$key."=".$ExtraVars[$key];
- $extra .= $e;
- $e = "";
- }
- }
- $env .= $extra;
-
+ $extra = "";
+ $keys = array_keys($ExtraVars);
+ if(is_array($keys))
+ {
+ for($i=0;$i $folder_name)
{
+ $var_to_global = $key.'_var_list';
+ global $$var_to_global;
+
if( $FrontEnd==0 || !is_numeric($FrontEnd) || $FrontEnd==2)
{
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
Index: trunk/kernel/admin_templates/img/toolbar/tool_next.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/stylesheets/stylesheets_event_handler.php
===================================================================
diff -u
--- trunk/core/units/stylesheets/stylesheets_event_handler.php (revision 0)
+++ trunk/core/units/stylesheets/stylesheets_event_handler.php (revision 1566)
@@ -0,0 +1,66 @@
+Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object =& $event->getObject();
+ $object->SwitchToLive();
+
+ $ids = explode(',', $event->MasterEvent->getEventParam('ids') );
+
+ if($ids)
+ {
+ $this->Application->setUnitOption('selectors','AutoLoad',false);
+ $selector_item =& $this->Application->recallObject('selectors.item', 'selectors', Array('live_table'=>true) );
+ $parent_field = $this->Application->getUnitOption($selector_item->Prefix,'ForeignKey');
+
+ $sql_template = 'SELECT '.$selector_item->IDField.' FROM '.$selector_item->TableName.' WHERE '.$parent_field.' = %s';
+
+ foreach($ids as $id)
+ {
+ $object->Load($id);
+ $selectors_ids = $this->Conn->GetCol( sprintf($sql_template,$id) );
+ $ret = '/* This file is generated automatically. Don\'t edit it manually ! */'."\n\n";
+
+ foreach($selectors_ids as $selector_id)
+ {
+ $selector_item->Load($selector_id);
+ $ret .= $selector_item->CompileStyle()."\n";
+ }
+
+ $ret .= $object->GetDBField('AdvancedCSS');
+
+ $compile_ts = time();
+ $css_path = DOC_ROOT.BASE_PATH.'/kernel/stylesheets/';
+
+ $css_file = $css_path.strtolower($object->GetDBField('Name')).'-'.$compile_ts.'.css';
+
+ $fp = fopen($css_file,'w');
+ if($fp)
+ {
+ $prev_css = $css_path.strtolower($object->GetDBField('Name')).'-'.$object->GetDBField('LastCompiled').'.css';
+ if( file_exists($prev_css) ) unlink($prev_css);
+
+ fwrite($fp, $ret);
+ fclose($fp);
+
+ $object->SetDBField('LastCompiled_date', $compile_ts);
+ $object->SetDBField('LastCompiled_time', $compile_ts);
+ $object->Update();
+ }
+ }
+ }
+ }
+
+
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_shipping_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/languages/languages_item.php
===================================================================
diff -u
--- trunk/core/units/languages/languages_item.php (revision 0)
+++ trunk/core/units/languages/languages_item.php (revision 1566)
@@ -0,0 +1,12 @@
+IDField.') FROM '.kTempTablesHandler::GetLiveName($this->TableName);
+ return $this->Conn->GetOne($sql) + 1;
+ }
+ }
+
+?>
\ No newline at end of file
Index: trunk/admin/users/adduser_images.php
===================================================================
diff -u -r1015 -r1566
--- trunk/admin/users/adduser_images.php (.../adduser_images.php) (revision 1015)
+++ trunk/admin/users/adduser_images.php (.../adduser_images.php) (revision 1566)
@@ -133,9 +133,12 @@
$ListForm = "imagelistform";
$CheckClass = "ImageChecks";
/* ------------------------------------- Configure the toolbar ------------------------------------------- */
+
+$saveURL = $admin."/".$objSession->GetVariable('ReturnScript');
+
$objListToolBar = new clsToolBar();
-$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".$admin."/users/user_list.php',1);","tool_select.gif");
-$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".$admin."/users/user_list.php',2);","tool_cancel.gif");
+$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".$saveURL."',1);","tool_select.gif");
+$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".$saveURL."',2);","tool_cancel.gif");
if($itemcount == 1) $objListToolBar->Add("divider");
$objListToolBar->Set("section",$section);
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_paymenttype.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_catsearch.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin/include/toolbar/advanced_view.php
===================================================================
diff -u -r1333 -r1566
--- trunk/kernel/admin/include/toolbar/advanced_view.php (.../advanced_view.php) (revision 1333)
+++ trunk/kernel/admin/include/toolbar/advanced_view.php (.../advanced_view.php) (revision 1566)
@@ -225,6 +225,14 @@
form_name = activeTab.id;
action_prefix = activeTab.getAttribute("ActionPrefix");
if(page.length == 0) page = activeTab.getAttribute("EditURL");
+
+ if ( action_prefix.match("k4:(.*)") )
+ {
+ act = RegExp.$1;
+ act = act.replace('$\$event$$', actionValue);
+ eval(act);
+ return;
+ }
}
var f = document.getElementsByName(form_name+'_form')[0];
Index: trunk/kernel/admin_templates/img/toolbar/tool_reset_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/grid.js
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/grid.js (revision 0)
+++ trunk/kernel/admin_templates/incs/grid.js (revision 1566)
@@ -0,0 +1,315 @@
+function GridItem(grid, an_element, cb, item_id, class_on, class_off)
+{
+ this.Grid = grid;
+ this.selected = false;
+ this.id = an_element.id;
+ this.ItemId = item_id;
+ this.sequence = parseInt(an_element.getAttribute('sequence'));
+ this.class_on = class_on;
+ if (class_off == ':original') {
+ this.class_off = an_element.className;
+ }
+ else
+ this.class_off = class_off;
+ this.HTMLelement = an_element;
+ this.CheckBox = cb;
+
+ this.value = this.ItemId;
+ this.ItemType = 11;
+}
+
+GridItem.prototype.Init = function ()
+{
+ this.HTMLelement.GridItem = this;
+ this.HTMLelement.onclick = function(ev) {
+ this.GridItem.Click(ev);
+ };
+ this.HTMLelement.ondblclick = function(ev) {
+ this.GridItem.DblClick(ev);
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.GridItem = this;
+ this.CheckBox.onclick = function(ev) {
+ this.GridItem.cbClick(ev);
+ };
+ this.CheckBox.ondblclick = function(ev) {
+ this.GridItem.DblClick(ev);
+ }
+ }
+}
+
+GridItem.prototype.DisableClicking = function ()
+{
+ this.HTMLelement.onclick = function(ev) {
+ return false;
+ };
+ this.HTMLelement.ondblclick = function(ev) {
+ return false;
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.onclick = function(ev) {
+ return false;
+ };
+ }
+}
+
+GridItem.prototype.Select = function ()
+{
+ if (this.selected) return;
+ this.selected = true;
+ this.HTMLelement.className = this.class_on;
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.checked = true;
+ }
+ this.Grid.LastSelectedId = this.ItemId;
+ this.Grid.SelectedCount++;
+
+ // this is for in-portal only (used in relation select)
+ LastCheckedItem = this;
+}
+
+GridItem.prototype.UnSelect = function ( force )
+{
+ if ( !this.selected && !force) return;
+ this.selected = false;
+ this.HTMLelement.className = this.class_off;
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.checked = false;
+ }
+ this.Grid.SelectedCount--;
+}
+
+GridItem.prototype.Click = function (ev)
+{
+ if (!is.ie) {
+ var e = ev;
+ window.getSelection().removeAllRanges(); //Other browsers
+ }
+ else {
+ var e = window.event;
+ document.selection.empty() //IE
+ }
+
+ this.Grid.ClearAlternativeGridsSelection();
+
+ if (e.shiftKey && !this.Grid.RadioMode) {
+ this.Grid.SelectRangeUpTo(this.sequence);
+ }
+ else {
+ if (e.ctrlKey && !this.Grid.RadioMode) {
+ this.Toggle()
+ }
+ else {
+ this.Grid.ClearSelection(null,'GridItem.Click');
+ this.Toggle();
+ }
+ }
+ this.Grid.CheckDependencies();
+ e.cancelBubble = true;
+}
+
+GridItem.prototype.cbClick = function (ev)
+{
+ var e = is.ie ? window.event : ev;
+ if (this.Grid.RadioMode) this.Grid.ClearSelection(null,'GridItem.cbClick');
+ this.Grid.ClearAlternativeGridsSelection();
+ this.Toggle();
+ this.Grid.CheckDependencies();
+ e.cancelBubble = true;
+}
+
+GridItem.prototype.DblClick = function (ev)
+{
+ var e = is.ie ? window.event : ev;
+ this.Grid.Edit();
+}
+
+GridItem.prototype.Toggle = function ()
+{
+ if (this.selected) this.UnSelect()
+ else {
+ this.Grid.LastSelectedSequence = this.sequence;
+ this.Select();
+ }
+}
+
+GridItem.prototype.FallsInRange = function (from, to)
+{
+ return (from <= to) ?
+ (this.sequence >= from && this.sequence <= to) :
+ (this.sequence >= to && this.sequence <= from);
+}
+
+
+function Grid(class_on, class_off, dbl_click, toolbar)
+{
+ this.class_on = class_on;
+ this.class_off = class_off;
+ this.Items = new Array();
+ this.LastSelectedSequence = 1;
+ this.LastSelectedId = null;
+ this.DblClick = dbl_click;
+ this.ToolBar = toolbar;
+ this.SelectedCount = 0;
+ this.AlternativeGrids = new Array();
+ this.DependantButtons = new Array();
+ this.RadioMode = false;
+}
+
+Grid.prototype.AddItem = function( an_item ) {
+ this.Items[an_item.id] = an_item;
+}
+
+Grid.prototype.AddItemsByIdMask = function ( tag, mask, cb_mask ) {
+ var $item_id=0;
+ elements = document.getElementsByTagName(tag.toUpperCase());
+ for (var i=0; i < elements.length; i++) {
+ if ( typeof(elements[i].id) == 'undefined') {
+ continue;
+ }
+ if ( !elements[i].id.match(mask)) continue;
+ $item_id=RegExp.$1;
+
+ cb_name = cb_mask.replace('$$ID$$',$item_id);
+
+ cb = document.getElementById(cb_name);
+ if (typeof(cb) == 'undefined') alert ('No Checkbox defined for item '+elements[i].id);
+
+ this.AddItem( new GridItem( this, elements[i], cb, $item_id, this.class_on, this.class_off ) );
+ }
+}
+
+Grid.prototype.InitItems = function() {
+ for (var i in this.Items) {
+ this.Items[i].Init();
+ }
+ this.ClearSelection( true,'Grid.InitItems' );
+}
+
+Grid.prototype.DisableClicking = function() {
+ for (var i in this.Items) {
+ this.Items[i].DisableClicking();
+ }
+ this.ClearSelection( true, 'Grid.DisableClicking' );
+}
+
+Grid.prototype.ClearSelection = function( force, called_from ) {
+ if (typeof(force) == 'undefined') force = false;
+ if (this.CountSelected() == 0 && !force) return;
+ for (var i in this.Items) {
+ this.Items[i].UnSelect(force);
+ }
+ this.SelectedCount = 0;
+ this.CheckDependencies();
+}
+
+Grid.prototype.InvertSelection = function() {
+ for (var i in this.Items)
+ {
+ if( this.Items[i].selected )
+ {
+ this.Items[i].UnSelect();
+ }
+ else
+ {
+ this.Items[i].Select();
+ }
+ }
+ this.CheckDependencies();
+}
+
+Grid.prototype.SelectAll = function() {
+ for (var i in this.Items) {
+ this.Items[i].Select();
+ }
+ this.CheckDependencies();
+ this.ClearAlternativeGridsSelection();
+}
+
+Grid.prototype.SelectRangeUpTo = function( last_sequence ) {
+ for (var i in this.Items) {
+ if (this.Items[i].FallsInRange(this.LastSelectedSequence, last_sequence)) {
+ this.Items[i].Select();
+ }
+ }
+}
+
+Grid.prototype.CountSelected = function ()
+{
+ return this.SelectedCount;
+}
+
+Grid.prototype.Edit = function() {
+ if ( this.CountSelected() == 0 ) return;
+ this.DblClick();
+}
+
+Grid.prototype.SetDependantToolbarButtons = function( buttons, mode )
+{
+ if (typeof(mode) == 'undefined') mode = 1; //direct (use 0 for invert mode)
+ for (var i in buttons) {
+ this.DependantButtons.push(new Array(buttons[i], mode));
+ }
+ //this.DependantButtons = buttons;
+ this.CheckDependencies();
+}
+
+Grid.prototype.CheckDependencies = function()
+{
+ var enabling = (this.CountSelected() > 0)
+ for (var i in this.DependantButtons) {
+ if (this.DependantButtons[i][0].match("portal:(.*)")) {
+ button_name = RegExp.$1;
+ if (toolbar) {
+ if (enabling == this.DependantButtons[i][1]) {
+ toolbar.enableButton(button_name, true);
+ }
+ else
+ {
+ toolbar.disableButton(button_name, true);
+ }
+ }
+ }
+ else {
+ if (enabling == this.DependantButtons[i][1]) {
+ this.ToolBar.EnableButton(this.DependantButtons[i][0]);
+ }
+ else {
+ this.ToolBar.DisableButton(this.DependantButtons[i][0]);
+ }
+ }
+ }
+ //if (enabling) this.ClearAlternativeGridsSelection();
+
+}
+
+Grid.prototype.ClearAlternativeGridsSelection = function ()
+{
+ for (var i in this.AlternativeGrids) {
+ this.AlternativeGrids[i].ClearSelection(null,'Grid.ClearAlternativeGridsSelection');
+ }
+}
+
+Grid.prototype.AddAlternativeGrid = function (alt_grid, reciprocal)
+{
+ this.AlternativeGrids.push(alt_grid);
+ if (typeof(reciprocal) != 'undefined' && reciprocal) {
+ alt_grid.AddAlternativeGrid(this);
+ }
+}
+
+Grid.prototype.FirstSelected = function ()
+{
+ min_sequence = null;
+ var res = null
+ for (var i in this.Items) {
+ if (!this.Items[i].selected) continue;
+ if (min_sequence == null)
+ min_sequence = this.Items[i].sequence;
+ if (this.Items[i].sequence <= min_sequence) {
+ res = this.Items[i].ItemId;
+ min_sequence = this.Items[i].sequence;
+ }
+ }
+ return res;
+}
\ No newline at end of file
Index: trunk/themes/default/img/bullet1.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_theme_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/include/tabs.js
===================================================================
diff -u -r1016 -r1566
--- trunk/admin/include/tabs.js (.../tabs.js) (revision 1016)
+++ trunk/admin/include/tabs.js (.../tabs.js) (revision 1566)
@@ -147,7 +147,7 @@
if(full_env.substr(0,3) != "env") full_env = 'env=' + full_env;
f = document.getElementById(formname);
-
+
if(f)
{
var valid = false;
@@ -165,10 +165,12 @@
}
if(valid || save_value==2 || save_value==-1)
{
- var URLPrefix = '';
+ var URLPrefix = '';
if( targetURL.substring(0, rootURL.length) != rootURL ) URLPrefix = rootURL;
- f.action = URLPrefix + targetURL + '?' + full_env;
+ f.action = URLPrefix + targetURL;
+ if( !f.action.match('(.*)?env=(.*)') ) f.action += '?' + full_env;
+
if(status_field.length > 0)
{
f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save
@@ -181,7 +183,9 @@
if(!valid) alert(ErrorMsg);
}
else
+ {
alert('Form '+formname+' was not found.');
+ }
}
//Used when the save or cancel buttin is hit
@@ -195,7 +199,10 @@
f = document.getElementById(formname);
if(f)
{
- f.action = rootURL + targetURL + '?' + full_env;
+ f.action = rootURL + targetURL;
+
+ if( !f.action.match('(.*)?env=(.*)') ) f.action += '?' + full_env;
+
//alert(f.action);
if(status_field.length>0)
{
Index: trunk/kernel/admin_templates/img/icons/icon46_summary_logs.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_e-mail_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_users.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/users/users_tag_processor.php
===================================================================
diff -u
--- trunk/core/units/users/users_tag_processor.php (revision 0)
+++ trunk/core/units/users/users_tag_processor.php (revision 1566)
@@ -0,0 +1,126 @@
+ 'all,m,u', 'u_event' => 'OnLogout');
+ return $this->Application->HREF('', '', $pass);
+ }
+
+ function UseUsernames($params)
+ {
+ return $this->Application->ConfigValue('Email_As_Login') != 1;
+ }
+
+ function RegistrationEnabled($params)
+ {
+ return $this->Application->ConfigValue('User_Allow_New') != 2;
+ }
+
+ function ConfirmPasswordLink($params)
+ {
+ //global $m_var_list_update, $var_list_update, $objSession, $objConfig;
+
+ $template = "forgotpw_reset_result";
+
+ $tmp_user_id = $this->Application->RecallVar("tmp_user_id");
+
+ $saved_denerated_code = $this->Application->GetVar('saved_denerated_code');
+ if ($saved_denerated_code){
+ $code = $saved_denerated_code;
+ }
+ else {
+ $code = md5($this->GenerateCode());
+ $this->Application->SetVar('saved_denerated_code', $code);
+ }
+
+
+
+ $sql = 'UPDATE '.TABLE_PREFIX.'PortalUser SET PwResetConfirm="'.$code.'", PwRequestTime='.mktime().' WHERE PortalUserId='.$tmp_user_id;
+
+ $this->Conn->Query($sql);
+
+ $params = array_merge($params, array('pass'=>'m', 'user_key'=>$code));
+
+ $main_processor =& $this->Application->recallObject('m_TagProcessor');
+
+ return $main_processor->T($params);
+
+ }
+
+ function GenerateCode()
+ {
+ list($usec, $sec) = explode(" ",microtime());
+
+ $id_part_1 = substr($usec, 4, 4);
+ $id_part_2 = mt_rand(1,9);
+ $id_part_3 = substr($sec, 6, 4);
+ $digit_one = substr($id_part_1, 0, 1);
+ if ($digit_one == 0) {
+ $digit_one = mt_rand(1,9);
+ $id_part_1 = ereg_replace("^0","",$id_part_1);
+ $id_part_1=$digit_one.$id_part_1;
+ }
+ return $id_part_1.$id_part_2.$id_part_3;
+ }
+
+ function ForgottenPassword($params){
+ return $this->Application->GetVar('ForgottenPassword');
+ }
+
+ function TestCodeIsValid($param){
+
+ $passed_key = $this->Application->GetVar('user_key');
+
+ $user_object = &$this->Application->recallObject('u.forgot');
+ $user_current_object = &$this->Application->recallObject('u');
+
+ if (strlen(trim($passed_key)) == 0) {
+
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ return false;
+ }
+
+
+ if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
+ {
+ $exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
+ if ($exp_time > mktime())
+ {
+
+
+ } else {
+ $user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
+ return false;
+
+ }
+ } else {
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ return false;
+
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns sitem administrator email
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SiteAdminEmail($params)
+ {
+ return $this->Application->ConfigValue('Smtp_AdminMailFrom');
+ }
+
+ }
+
+
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_arrange.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_go_up.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/list_arrow_no.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/email_events/email_events_event_handler.php
===================================================================
diff -u
--- trunk/kernel/units/email_events/email_events_event_handler.php (revision 0)
+++ trunk/kernel/units/email_events/email_events_event_handler.php (revision 1566)
@@ -0,0 +1,196 @@
+Special == 'module')
+ {
+ $object =& $event->getObject();
+ $object->addFilter('module_filter', '%1$s.Module = \'In-Commerce\'');
+ }
+ }
+
+ /**
+ * Sets status Front-End Only to selected email events
+ *
+ * @param kEvent $event
+ */
+ function OnFrontOnly(&$event)
+ {
+ $this->StoreSelectedIDs($event);
+ $ids = $this->getSelectedIDs($event);
+ $ids = implode(',', $ids);
+
+ $table = $this->Application->getUnitOption($event->Prefix,'TableName');
+ $sql = 'UPDATE '.$table.' SET Enabled = 2 WHERE EventId IN ('.$ids.')';
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Sets selected user to email events selected
+ *
+ * @param kEvent $event
+ */
+ function OnSelectUser(&$event)
+ {
+ $user_name = $this->Application->GetVar( $event->getPrefixSpecial(true).'_PopupSelectedUser' );
+ if( strlen($user_name) > 0 )
+ {
+ $this->StoreSelectedIDs($event);
+ $ids = $this->getSelectedIDs($event);
+ $ids = implode(',', $ids);
+
+ $user_id = $this->Conn->GetOne('SELECT PortalUserId FROM '.TABLE_PREFIX.'PortalUser WHERE Login = '.$this->Conn->qstr($user_name) );
+
+ $table = $this->Application->getUnitOption($event->Prefix,'TableName');
+ $sql = 'UPDATE '.$table.' SET FromUserId = '.$user_id.' WHERE EventId IN ('.$ids.')';
+
+ $this->Conn->Query($sql);
+ }
+ }
+
+ /**
+ * Raised when email message shoul be sent
+ *
+ * @param kEvent $event
+ */
+ function OnEmailEvent(&$event){
+
+ $email_event = $event->getEventParam('EmailEventName');
+ $to_user_id = $event->getEventParam('EmailEventToUserId');
+ $email_event_type = $event->getEventParam('EmailEventType');
+
+ $this->Application->setUnitOption('emailmessages', 'AutoLoad', false);
+ $message_object = &$this->Application->recallObject('emailmessages');
+
+ $event_table = $this->Application->getUnitOption('emailevents', 'TableName');
+
+ $event_object = &$event->getObject();
+ $event_object->Load(array('Event'=>$email_event, 'Type'=>$email_event_type));
+
+ $event_id = $event_object->GetDBField('EventId');
+ $from_user_id = $event_object->GetDBField('FromUserId');
+ $type = $event_object->GetDBField('Type');
+ $enabled = $event_object->GetDBField('Enabled');
+
+ $direct_send_params = $event->getEventParam('DirectSendParams');
+
+ if ($enabled == 0) return; // disabled event
+ if ($enabled == 2 && defined("ADMIN")) return; // event only for front-end
+
+ if ($type == 1){
+ // 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;
+ $from_user_id = -1;
+ }
+
+ if (!($to_user_id > 0) && !$direct_send_params){
+ // if we can not determine recepient we will not send email
+ return;
+ }
+
+ //Parse Message Template
+ $message_object->Load(array('EventId' => $event_id, 'LanguageId' => $this->Application->GetVar('m_lang')));
+ $message_type = $message_object->GetDBField('MessageType');
+ $message_template = $message_object->GetDBField('Template');
+
+ $this->Application->InitParser();
+ $template =& $this->Application->makeClass('Template');
+ $template->SetBody($message_template);
+
+ $template_object = &$this->Application->recallObject('TemplatesCache');
+ $template_object->SetTemplate('EmailTemplate', $template);
+
+
+ $email_object = &$this->Application->recallObject('kEmailMessage');
+
+ $old_autoload = $this->Application->getUnitOption('u', 'AutoLoad');
+ $this->Application->setUnitOption('u', 'AutoLoad', false);
+
+ $from_user_object = &$this->Application->recallObject('u.-item');
+ $from_user_object->Load($from_user_id);
+ // here if we don't have from_user loaded, it takes a default user from config values
+ $from_user_email = $from_user_object->GetDBField('Email')?$from_user_object->GetDBField('Email'):$this->Application->ConfigValue('Smtp_AdminMailFrom');
+ $from_user_name = trim($from_user_object->GetDBField('FirstName').' '.$from_user_object->GetDBField('LastName'));
+
+ $to_user_object = &$this->Application->recallObject('u.-item');
+ $to_user_object->Load($to_user_id);
+ $to_user_email = $to_user_object->GetDBField('Email');
+ $to_user_name = trim($to_user_object->GetDBField('FirstName').' '.$to_user_object->GetDBField('LastName'));
+
+ $this->Application->setUnitOption('u', 'AutoLoad', $old_autoload);
+
+ if($direct_send_params){
+ $to_user_email = ($direct_send_params['to_email']?$direct_send_params['to_email']:$to_user_email);
+ $to_user_name = ($direct_send_params['to_name']?$direct_send_params['to_name']:$to_user_name);
+ $from_user_email = ($direct_send_params['from_email']?$direct_send_params['from_email']:$from_user_email);
+ $from_user_name = ($direct_send_params['from_name']?$direct_send_params['from_name']:$from_user_name);
+ $message_body_additional = $direct_send_params['message'];
+ }
+
+ $params = array_merge( array('name'=>'EmailTemplate', 'message_text'=>$message_body_additional), $direct_send_params );
+ $message_template = $this->Application->ParseBlock($params);
+
+ $message_template = str_replace("\r", "", $message_template);
+
+ list($message_headers, $message_body) = explode("\n\n", $message_template, 2);
+
+
+ $email_object->setFrom($from_user_email, $from_user_name);
+ $email_object->setTo($to_user_email, $to_user_name);
+ $email_object->setSubject('Mail message');
+
+
+ $email_object->setHeaders($message_headers);
+
+ if ($message_type == 'html'){
+ $email_object->setHTMLBody($message_body);
+ }
+ else {
+ $email_object->setTextBody($message_body);
+ }
+
+ $smtp_object = &$this->Application->recallObject('kSmtpClient');
+
+ $smtp_server = $this->Application->ConfigValue('Smtp_Server');
+ $smtp_port = $this->Application->ConfigValue('Smtp_Port');
+
+ $smtp_authenticate = $this->Application->ConfigValue('Smtp_Authenticate');
+ if ($smtp_authenticate){
+ $smtp_user = $this->Application->ConfigValue('Smtp_User');
+ $smtp_pass = $this->Application->ConfigValue('Smtp_Pass');
+ }else{
+ $smtp_user = '';
+ $smtp_pass = '';
+ }
+
+
+ if ($smtp_server){
+ if ($email_object->sendSMTP($smtp_object, $smtp_server, $smtp_user, $smtp_pass, $smtp_authenticate)){
+ $event->status=erSUCCESS;
+ }
+ else {
+ $event->status=erFAIL;
+ }
+ }else{
+ if($email_object->send()){
+ $event->status=erSUCCESS;
+ }
+ else {
+ $event->status=erFAIL;
+ }
+ }
+
+ return $event;
+ }
+ }
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_import_language.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_translate.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_shipping.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_discounts.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/configuration/configuration_config.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/icons/icon46_list_taxes.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_more_brackets_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/sort_2_asc.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/index.tpl
===================================================================
diff -u
--- trunk/kernel/admin_templates/index.tpl (revision 0)
+++ trunk/kernel/admin_templates/index.tpl (revision 1566)
@@ -0,0 +1 @@
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/icons/icon46_settings_output.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_cat_attn.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_help.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/advanced_view.php
===================================================================
diff -u -r1510 -r1566
--- trunk/admin/advanced_view.php (.../advanced_view.php) (revision 1510)
+++ trunk/admin/advanced_view.php (.../advanced_view.php) (revision 1566)
@@ -12,8 +12,32 @@
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
-//$pathtoroot="";
+//KERNEL4 STARTUP - FOR ACTIONS HANDLING
+
+function k4getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
+
+$start = k4getmicrotime();
+
+define('ADMIN', 1);
+define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
+define('APPLICATION_CLASS', 'MyApplication');
+define('ADMINS_LIST','/in-portal/users/users.php');
+include_once(FULL_PATH."/kernel/kernel4/startup.php");
+
+$application =& kApplication::Instance();
+$application->Init();
+
+$application->SetVar('t', 'in-commerce/products/products_advanced_view');
+
+$application->Run();
+
+//KERNEL4 END
+
define('REQUIRE_LAYER_HEADER', 1);
$b_topmargin = "0";
//$b_header_addon = "
";
@@ -255,7 +279,7 @@
print <<
-
+
@@ -348,8 +372,10 @@
include_once($path);
}
}
+ $admin = $objConfig->Get("AdminDirectory");
+ if(!strlen($admin)) $admin = "admin";
?>
-
Index: trunk/kernel/admin_templates/img/ic_new.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_tool_import.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_settings_general.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_archive_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/email_events/email_events_event_handler.php
===================================================================
diff -u
--- trunk/core/units/email_events/email_events_event_handler.php (revision 0)
+++ trunk/core/units/email_events/email_events_event_handler.php (revision 1566)
@@ -0,0 +1,196 @@
+Special == 'module')
+ {
+ $object =& $event->getObject();
+ $object->addFilter('module_filter', '%1$s.Module = \'In-Commerce\'');
+ }
+ }
+
+ /**
+ * Sets status Front-End Only to selected email events
+ *
+ * @param kEvent $event
+ */
+ function OnFrontOnly(&$event)
+ {
+ $this->StoreSelectedIDs($event);
+ $ids = $this->getSelectedIDs($event);
+ $ids = implode(',', $ids);
+
+ $table = $this->Application->getUnitOption($event->Prefix,'TableName');
+ $sql = 'UPDATE '.$table.' SET Enabled = 2 WHERE EventId IN ('.$ids.')';
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Sets selected user to email events selected
+ *
+ * @param kEvent $event
+ */
+ function OnSelectUser(&$event)
+ {
+ $user_name = $this->Application->GetVar( $event->getPrefixSpecial(true).'_PopupSelectedUser' );
+ if( strlen($user_name) > 0 )
+ {
+ $this->StoreSelectedIDs($event);
+ $ids = $this->getSelectedIDs($event);
+ $ids = implode(',', $ids);
+
+ $user_id = $this->Conn->GetOne('SELECT PortalUserId FROM '.TABLE_PREFIX.'PortalUser WHERE Login = '.$this->Conn->qstr($user_name) );
+
+ $table = $this->Application->getUnitOption($event->Prefix,'TableName');
+ $sql = 'UPDATE '.$table.' SET FromUserId = '.$user_id.' WHERE EventId IN ('.$ids.')';
+
+ $this->Conn->Query($sql);
+ }
+ }
+
+ /**
+ * Raised when email message shoul be sent
+ *
+ * @param kEvent $event
+ */
+ function OnEmailEvent(&$event){
+
+ $email_event = $event->getEventParam('EmailEventName');
+ $to_user_id = $event->getEventParam('EmailEventToUserId');
+ $email_event_type = $event->getEventParam('EmailEventType');
+
+ $this->Application->setUnitOption('emailmessages', 'AutoLoad', false);
+ $message_object = &$this->Application->recallObject('emailmessages');
+
+ $event_table = $this->Application->getUnitOption('emailevents', 'TableName');
+
+ $event_object = &$event->getObject();
+ $event_object->Load(array('Event'=>$email_event, 'Type'=>$email_event_type));
+
+ $event_id = $event_object->GetDBField('EventId');
+ $from_user_id = $event_object->GetDBField('FromUserId');
+ $type = $event_object->GetDBField('Type');
+ $enabled = $event_object->GetDBField('Enabled');
+
+ $direct_send_params = $event->getEventParam('DirectSendParams');
+
+ if ($enabled == 0) return; // disabled event
+ if ($enabled == 2 && defined("ADMIN")) return; // event only for front-end
+
+ if ($type == 1){
+ // 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;
+ $from_user_id = -1;
+ }
+
+ if (!($to_user_id > 0) && !$direct_send_params){
+ // if we can not determine recepient we will not send email
+ return;
+ }
+
+ //Parse Message Template
+ $message_object->Load(array('EventId' => $event_id, 'LanguageId' => $this->Application->GetVar('m_lang')));
+ $message_type = $message_object->GetDBField('MessageType');
+ $message_template = $message_object->GetDBField('Template');
+
+ $this->Application->InitParser();
+ $template =& $this->Application->makeClass('Template');
+ $template->SetBody($message_template);
+
+ $template_object = &$this->Application->recallObject('TemplatesCache');
+ $template_object->SetTemplate('EmailTemplate', $template);
+
+
+ $email_object = &$this->Application->recallObject('kEmailMessage');
+
+ $old_autoload = $this->Application->getUnitOption('u', 'AutoLoad');
+ $this->Application->setUnitOption('u', 'AutoLoad', false);
+
+ $from_user_object = &$this->Application->recallObject('u.-item');
+ $from_user_object->Load($from_user_id);
+ // here if we don't have from_user loaded, it takes a default user from config values
+ $from_user_email = $from_user_object->GetDBField('Email')?$from_user_object->GetDBField('Email'):$this->Application->ConfigValue('Smtp_AdminMailFrom');
+ $from_user_name = trim($from_user_object->GetDBField('FirstName').' '.$from_user_object->GetDBField('LastName'));
+
+ $to_user_object = &$this->Application->recallObject('u.-item');
+ $to_user_object->Load($to_user_id);
+ $to_user_email = $to_user_object->GetDBField('Email');
+ $to_user_name = trim($to_user_object->GetDBField('FirstName').' '.$to_user_object->GetDBField('LastName'));
+
+ $this->Application->setUnitOption('u', 'AutoLoad', $old_autoload);
+
+ if($direct_send_params){
+ $to_user_email = ($direct_send_params['to_email']?$direct_send_params['to_email']:$to_user_email);
+ $to_user_name = ($direct_send_params['to_name']?$direct_send_params['to_name']:$to_user_name);
+ $from_user_email = ($direct_send_params['from_email']?$direct_send_params['from_email']:$from_user_email);
+ $from_user_name = ($direct_send_params['from_name']?$direct_send_params['from_name']:$from_user_name);
+ $message_body_additional = $direct_send_params['message'];
+ }
+
+ $params = array_merge( array('name'=>'EmailTemplate', 'message_text'=>$message_body_additional), $direct_send_params );
+ $message_template = $this->Application->ParseBlock($params);
+
+ $message_template = str_replace("\r", "", $message_template);
+
+ list($message_headers, $message_body) = explode("\n\n", $message_template, 2);
+
+
+ $email_object->setFrom($from_user_email, $from_user_name);
+ $email_object->setTo($to_user_email, $to_user_name);
+ $email_object->setSubject('Mail message');
+
+
+ $email_object->setHeaders($message_headers);
+
+ if ($message_type == 'html'){
+ $email_object->setHTMLBody($message_body);
+ }
+ else {
+ $email_object->setTextBody($message_body);
+ }
+
+ $smtp_object = &$this->Application->recallObject('kSmtpClient');
+
+ $smtp_server = $this->Application->ConfigValue('Smtp_Server');
+ $smtp_port = $this->Application->ConfigValue('Smtp_Port');
+
+ $smtp_authenticate = $this->Application->ConfigValue('Smtp_Authenticate');
+ if ($smtp_authenticate){
+ $smtp_user = $this->Application->ConfigValue('Smtp_User');
+ $smtp_pass = $this->Application->ConfigValue('Smtp_Pass');
+ }else{
+ $smtp_user = '';
+ $smtp_pass = '';
+ }
+
+
+ if ($smtp_server){
+ if ($email_object->sendSMTP($smtp_object, $smtp_server, $smtp_user, $smtp_pass, $smtp_authenticate)){
+ $event->status=erSUCCESS;
+ }
+ else {
+ $event->status=erFAIL;
+ }
+ }else{
+ if($email_object->send()){
+ $event->status=erSUCCESS;
+ }
+ else {
+ $event->status=erFAIL;
+ }
+ }
+
+ return $event;
+ }
+ }
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_cut_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_style.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_search.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_clone_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_image_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_homecat_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_clone.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/include/theme.php
===================================================================
diff -u -r1066 -r1566
--- trunk/kernel/include/theme.php (.../theme.php) (revision 1066)
+++ trunk/kernel/include/theme.php (.../theme.php) (revision 1566)
@@ -616,12 +616,12 @@
return $this->Query_Item($sql);
}
- function AddTheme($Name,$Description,$Enabled,$Primary,$CacheTimeout=3600)
+ function AddTheme($Name,$Description,$Enabled,$Primary,$CacheTimeout=3600,$StylesheetId=1)
{
$t = new clsTheme();
$t->tablename = $this->SourceTable;
- $t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout"),
- array($Name,$Description,$Enabled,$Primary,$CacheTimeout));
+ $t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout",'StylesheetId'),
+ array($Name,$Description,$Enabled,$Primary,$CacheTimeout,$StylesheetId));
$t->Create();
$t->Files->ThemeId=$t->Get("ThemeId");
if($Primary==1)
@@ -632,7 +632,7 @@
return $t;
}
- function EditTheme($ThemeId,$Name,$Description,$Enabled,$Primary, $CacheTimeout)
+ function EditTheme($ThemeId,$Name,$Description,$Enabled,$Primary, $CacheTimeout, $StylesheetId)
{
$t = $this->GetItem($ThemeId);
$oldName = $t->Get("Name");
@@ -642,8 +642,8 @@
if(!rename($dir.'/'.$oldName,$dir.'/'.$Name))
$Name=$oldName;
}
- $t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout"),
- array($Name, $Description, $Enabled, $Primary, $CacheTimeout));
+ $t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout", 'StylesheetId'),
+ array($Name, $Description, $Enabled, $Primary, $CacheTimeout,$StylesheetId));
$t->Dirty();
$t->Update();
if($Primary==1)
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/configuration/configuration_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/itemicons/icon16_listing.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/version_bg.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/in-link/icon16_link_disabled.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_import_language_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/globe.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/modules/modules_event_handler.php
===================================================================
diff -u
--- trunk/core/units/modules/modules_event_handler.php (revision 0)
+++ trunk/core/units/modules/modules_event_handler.php (revision 1566)
@@ -0,0 +1,36 @@
+Application->SetVar($this->Prefix."_".$event->Special."_id", $event->Special);
+ parent::OnItemBuild($event);
+ }
+
+ function SetCustomQuery(&$event){
+ $object=&$event->getObject();
+ $object->addFilter("current_module", "Name=".$event->Special);
+
+ }
+
+}
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_edit_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/in-link/icon46_list_settings_in-link.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_custom_disabled.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/languages/import_xml.php
===================================================================
diff -u
--- trunk/core/units/languages/import_xml.php (revision 0)
+++ trunk/core/units/languages/import_xml.php (revision 1566)
@@ -0,0 +1,280 @@
+Conn =& $this->Application->GetADODBConnection();
+
+ $this->Application->SetVar('lang_mode', 't');
+
+ $this->tables['lang'] = $this->prepareTempTable('lang');
+ $this->Application->setUnitOption('lang','AutoLoad',false);
+ $this->lang_object =& $this->Application->recallObject('lang.imp');
+
+ $this->tables['phrases'] = $this->prepareTempTable('phrases');
+ $this->tables['emailmessages'] = $this->prepareTempTable('emailmessages');
+
+ $sql = 'SELECT EventId, CONCAT(Event,"_",Type) AS EventMix FROM '.TABLE_PREFIX.'Events';
+ $this->events_hash = $this->Conn->GetCol($sql, 'EventMix');
+
+ $this->ip_address = getenv('HTTP_X_FORWARDED_FOR') ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR');
+ }
+
+ /**
+ * Create temp table for prefix, if table already exists, then delete it and create again
+ *
+ * @param string $prefix
+ */
+ function prepareTempTable($prefix)
+ {
+ $idfield = $this->Application->getUnitOption($prefix, 'IDField');
+ $table = $this->Application->getUnitOption($prefix,'TableName');
+ $temp_table = kTempTablesHandler::GetTempName($table);
+
+ $sql = 'DROP TABLE IF EXISTS %s';
+ $this->Conn->Query( sprintf($sql, $temp_table) );
+
+ $sql = 'CREATE TABLE %s SELECT * FROM %s WHERE 0';
+ $this->Conn->Query( sprintf($sql, $temp_table, $table) );
+
+ $sql = 'ALTER TABLE %1$s CHANGE %2$s %2$s INT(11) NOT NULL';
+ $this->Conn->Query( sprintf($sql, $temp_table, $idfield) );
+
+ return $temp_table;
+ }
+
+ function Parse($filename, $phrase_types, $module_ids)
+ {
+ // define the XML parsing routines/functions to call based on the handler path
+ if( !file_exists($filename) ) return false;
+
+ $this->phrase_types_allowed = array_flip($phrase_types);
+
+ //if (in_array('In-Portal',)
+
+ $xml_parser = xml_parser_create();
+ xml_set_element_handler( $xml_parser, Array(&$this, 'startElement'), Array(&$this, 'endElement') );
+ xml_set_character_data_handler( $xml_parser, Array(&$this, 'characterData') );
+
+ $fdata = file_get_contents($filename);
+
+ $ret = xml_parse($xml_parser, $fdata);
+ xml_parser_free($xml_parser); // clean up the parser object
+
+ $this->Application->SetVar('lang_mode', '');
+ return $ret;
+ }
+
+ function startElement(&$parser, $element, $attributes)
+ {
+ array_push($this->path, $element);
+ $path = implode(' ',$this->path);
+ //check what path we are in
+
+ switch($path)
+ {
+ case 'LANGUAGES LANGUAGE':
+ $this->current_language = Array('PackName' => $attributes['PACKNAME'], 'LocalName' => $attributes['PACKNAME']);
+ break;
+
+ case 'LANGUAGES LANGUAGE PHRASES':
+ case 'LANGUAGES LANGUAGE EVENTS':
+ if( !getArrayValue($this->current_language,'LanguageId') )
+ {
+ if( !getArrayValue($this->current_language,'Charset') ) $this->current_language['Charset'] = 'iso-8859-1';
+ $this->lang_object->SetFieldsFromHash($this->current_language);
+ if( $this->lang_object->Create() ) $this->current_language['LanguageId'] = $this->lang_object->GetID();
+ }
+ break;
+
+ case 'LANGUAGES LANGUAGE PHRASES PHRASE':
+ $phrase_module = getArrayValue($attributes,'MODULE');
+ if(!$phrase_module) $phrase_module = 'In-Portal';
+
+ $this->current_phrase = Array( 'LanguageId' => $this->current_language['LanguageId'],
+ 'Phrase' => $attributes['LABEL'],
+ 'PhraseType' => $attributes['TYPE'],
+ 'Module' => $phrase_module,
+ 'LastChanged' => time(),
+ 'LastChangeIP' => $this->ip_address );
+ break;
+
+ case 'LANGUAGES LANGUAGE EVENTS EVENT':
+ $this->current_event = Array( 'LanguageId' => $this->current_language['LanguageId'],
+ 'EventId' => $this->events_hash[ $attributes['EVENT'].'_'.$attributes['TYPE'] ],
+ 'MessageType' => $attributes['MESSAGETYPE']);
+ break;
+
+
+ }
+
+ // if($path == 'SHIPMENT PACKAGE')
+ }
+
+ function characterData(&$parser, $line)
+ {
+ $line = trim($line);
+ if(!$line) return ;
+
+ $path = join (' ',$this->path);
+
+ $language_nodes = Array('DATEFORMAT','TIMEFORMAT','DECIMAL','THOUSANDS','CHARSET');
+
+
+ $node_field_map = Array('LANGUAGES LANGUAGE DATEFORMAT' => 'DateFormat',
+ 'LANGUAGES LANGUAGE TIMEFORMAT' => 'TimeFormat',
+ 'LANGUAGES LANGUAGE DECIMAL' => 'DecimalPoint',
+ 'LANGUAGES LANGUAGE THOUSANDS' => 'ThousandSep',
+ 'LANGUAGES LANGUAGE CHARSET' => 'Charset');
+
+ if( in_array( end($this->path), $language_nodes) )
+ {
+ $this->current_language[ $node_field_map[$path] ] = $line;
+ }
+ else
+ {
+ switch($path)
+ {
+ case 'LANGUAGES LANGUAGE PHRASES PHRASE':
+ if( isset($this->phrase_types_allowed[ $this->current_phrase['PhraseType'] ]) )
+ {
+ $this->current_phrase['Translation'] = base64_decode($line);
+ $this->insertRecord($this->tables['phrases'], $this->current_phrase);
+ }
+ break;
+
+ case 'LANGUAGES LANGUAGE EVENTS EVENT':
+ $this->current_event['Template'] = base64_decode($line);
+ $this->insertRecord($this->tables['emailmessages'],$this->current_event);
+ break;
+ }
+ }
+ }
+
+ function endElement(&$parser, $element)
+ {
+ $path = implode(' ',$this->path);
+ array_pop($this->path);
+ }
+
+ function insertRecord($table, $fields_hash)
+ {
+ $fields = '';
+ $values = '';
+
+ foreach($fields_hash as $field_name => $field_value)
+ {
+ $fields .= '`'.$field_name.'`,';
+ $values .= $this->Conn->qstr($field_value).',';
+ }
+
+ $fields = preg_replace('/(.*),$/', '\\1', $fields);
+ $values = preg_replace('/(.*),$/', '\\1', $values);
+
+ $sql = 'INSERT INTO `'.$table.'` ('.$fields.') VALUES ('.$values.')';
+ $this->Conn->Query($sql);
+
+// return $this->Conn->getInsertID(); // no need because of temp table without auto_increment column at all
+ }
+
+ /**
+ * Creates XML file with exported language data
+ *
+ * @param string $filename filename to export into
+ * @param Array $phrase_types phrases types to export from modules passed in $module_ids
+ * @param Array $language_ids IDs of languages to export
+ * @param Array $module_ids IDs of modules to export phrases from
+ */
+ function Create($filename, $phrase_types, $language_ids, $module_ids)
+ {
+ $fp = fopen($filename,'w');
+ if(!$fp || !$phrase_types || !$module_ids || !$language_ids) return false;
+
+ $this->events_hash = array_flip($this->events_hash);
+
+ $lang_table = $this->Application->getUnitOption('lang','TableName');
+ $phrases_table = $this->Application->getUnitOption('phrases','TableName');
+ $emailevents_table = $this->Application->getUnitOption('emailmessages','TableName');
+ $mainevents_table = $this->Application->getUnitOption('emailevents','TableName');
+
+ $phrase_tpl = "\t\t\t".'%s'."\n";
+ $event_tpl = "\t\t\t".'%s'."\n";
+ $sql = 'SELECT * FROM %s WHERE LanguageId = %s';
+ $ret = ''."\n";
+ foreach($language_ids as $language_id)
+ {
+ // languages
+ $row = $this->Conn->GetRow( sprintf($sql, $lang_table, $language_id) );
+ $ret .= "\t".''.$row['DateFormat'].'';
+ $ret .= ''.$row['TimeFormat'].''.$row['DecimalPoint'].'';
+ $ret .= ''.$row['ThousandSep'].''.$row['Charset'].''."\n";
+
+ // phrases
+ $ret .= "\t\t".''."\n";
+ $phrases_sql = 'SELECT * FROM '.$phrases_table.' WHERE LanguageId = %s AND PhraseType IN (%s) AND Module IN (%s)';
+ if( in_array('In-Portal',$module_ids) ) array_push($module_ids, ''); // for old language packs
+ $rows = $this->Conn->Query( sprintf($phrases_sql,$language_id, implode(',',$phrase_types), '\''.implode('\',\'',$module_ids).'\'' ) );
+ foreach($rows as $row)
+ {
+ $ret .= sprintf($phrase_tpl, $row['Phrase'], $row['PhraseType'], base64_encode($row['Translation']) );
+ }
+ $ret .= "\t\t".''."\n";
+
+ // email events
+ $ret .= "\t\t".''."\n";
+ if( in_array('In-Portal',$module_ids) ) unset( $module_ids[array_search('',$module_ids)] ); // for old language packs
+ $module_sql = preg_replace('/(.*) OR $/', '\\1', preg_replace('/(.*),/U', 'INSTR(Module,\'\\1\') OR ', implode(',', $module_ids).',' ) );
+
+ $sql = 'SELECT EventId FROM '.$mainevents_table.' WHERE '.$module_sql;
+ $event_ids = $this->Conn->GetCol($sql);
+
+ $event_sql = 'SELECT * FROM '.$emailevents_table.' WHERE LanguageId = %s AND EventId IN (%s)';
+ $rows = $this->Conn->Query( sprintf($event_sql,$language_id, $event_ids ? implode(',',$event_ids) : '' ) );
+ foreach($rows as $row)
+ {
+ list($event_name, $event_type) = explode('_', $this->events_hash[ $row['EventId'] ] );
+ $ret .= sprintf($event_tpl, $row['MessageType'], $event_name, $event_type, base64_encode($row['Template']) );
+ }
+ $ret .= "\t\t".''."\n";
+ $ret .= "\t".''."\n";
+ }
+
+ $ret .= '';
+ fwrite($fp, $ret);
+ fclose($fp);
+ return true;
+ }
+ }
+
+?>
\ No newline at end of file
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/category_items/category_items_config.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin/include/toolbar/edituser_items.php
===================================================================
diff -u -r979 -r1566
--- trunk/kernel/admin/include/toolbar/edituser_items.php (.../edituser_items.php) (revision 979)
+++ trunk/kernel/admin/include/toolbar/edituser_items.php (.../edituser_items.php) (revision 1566)
@@ -98,8 +98,11 @@
function edit_submit(formname, targetURL)
{
var env_str = '$envar';
+ var url = '$rootURL' + targetURL;
- document.location = '$rootURL' + targetURL + '?' + env_str;
+ if( !url.match('(.*)?env=(.*)') ) url += '?' + env_str;
+
+ document.location = url;
}
@@ -110,7 +113,9 @@
f = document.getElementById(formname);
if(f)
{
- f.action = '$rootURL' + targetURL + '?' + env_str;
+ f.action = '$rootURL' + targetURL;
+ if( !f.action.match('(.*)?env=(.*)') ) f.action += '?' + env_str;
+
f.UserEditStatus.value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save
f.submit();
}
Index: trunk/kernel/admin_templates/img/itemicons/icon16_review.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tab_right.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/languages/languages_event_handler.php
===================================================================
diff -u
--- trunk/kernel/units/languages/languages_event_handler.php (revision 0)
+++ trunk/kernel/units/languages/languages_event_handler.php (revision 1566)
@@ -0,0 +1,311 @@
+Application->getUnitOption($event->Prefix,'TableName');
+ $languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name);
+ $languages_count = $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 );
+
+ $sqls = Array();
+
+ $unit_config_reader =& $this->Application->recallObject('kUnitConfigReader');
+ foreach($unit_config_reader->configData as $prefix => $config_data)
+ {
+ $table_name = getArrayValue($config_data,'TableName');
+ $fields = getArrayValue($config_data,'Fields');
+ if(!($table_name && $fields) ) continue;
+
+ foreach($fields as $field_name => $field_options)
+ {
+ if( isset($field_options['formatter']) && $field_options['formatter'] == 'kMultiLanguage' )
+ {
+ $describe = $this->Conn->Query('DESCRIBE '.$table_name.' \'l%_'.$field_name.'\'');
+ $field_mask = 'l%s_'.$field_name.' '.$describe[0]['Type'];
+ $create_count = $languages_count - count($describe);
+ if($create_count)
+ {
+ $sqls[] = 'ALTER TABLE '.$table_name.( $this->generateAlterSQL($field_mask, count($describe) + 1, $create_count) );
+ }
+ }
+ }
+ }
+ if($sqls) $this->Conn->Query( implode("\n",$sqls) );
+ }
+
+ /**
+ * Returns ALTER statement part for adding required fields to table
+ *
+ * @param string $field_mask sql mask for creating field with correct definition (type & size)
+ * @param int $start_index add new fields starting from this index
+ * @param int $create_count create this much new multilingual field translations
+ * @return string
+ */
+ function generateAlterSQL($field_mask, $start_index, $create_count)
+ {
+ $i_count = $start_index + $create_count;
+ $ret = '';
+ while($start_index < $i_count)
+ {
+ list($prev_field,$type) = explode(' ', sprintf($field_mask, $start_index-1) );
+ $ret .= ' ADD COLUMN '.sprintf($field_mask,$start_index).' AFTER '.$prev_field.', ';
+ $start_index++;
+ }
+ return preg_replace('/, $/',';',$ret);
+ }
+
+ /**
+ * Copy labels from another language
+ *
+ * @param kEvent $event
+ */
+ function OnCopyLabels(&$event)
+ {
+ $object =& $event->getObject();
+ $from_lang_id = $object->GetDBField('CopyFromLanguage');
+
+ if( ($event->MasterEvent->status == erSUCCESS) && $object->GetDBField('CopyLabels') == 1 && ($from_lang_id > 0) )
+ {
+ $lang_id = $object->GetID();
+
+ // 1. phrases import
+ $phrases_live = $this->Application->getUnitOption('phrases','TableName');
+ $phrases_temp = kTempTablesHandler::GetTempName($phrases_live);
+ $sql = 'INSERT INTO '.$phrases_temp.'
+ SELECT Phrase, Translation, PhraseType, 0-PhraseId, '.$lang_id.'
+ FROM '.$phrases_live.'
+ WHERE LanguageId='.$from_lang_id;
+ $this->Conn->Query($sql);
+
+ // 2. events import
+ $em_table_live = $this->Application->getUnitOption('emailmessages','TableName');
+ $em_table_temp = kTempTablesHandler::GetTempName($em_table_live);
+
+ $sql = 'SELECT * FROM '.$em_table_live.' WHERE LanguageId = '.$from_lang_id;
+ $email_messages = $this->Conn->Query($sql);
+ if($email_messages)
+ {
+ $id = $this->Conn->GetOne('SELECT MIN(EmailMessageId) FROM '.$em_table_live);
+ if($id > 0) $id = 0;
+ $id--;
+
+ $sqls = Array();
+ foreach($email_messages as $email_message)
+ {
+ $sqls[] = $id.','.$this->Conn->qstr($email_message['Template']).','.$this->Conn->qstr($email_message['MessageType']).','.$lang_id.','.$email_message['EventId'];
+ $id--;
+ }
+ $sql = 'INSERT INTO '.$em_table_temp.'(EmailMessageId,Template,MessageType,LanguageId,EventId) VALUES ('.implode('),(',$sqls).')';
+ $this->Conn->Query($sql);
+ }
+
+ $object->SetDBField('CopyLabels', 0);
+ }
+ }
+
+ /**
+ * Prepare temp tables for creating new item
+ * but does not create it. Actual create is
+ * done in OnPreSaveCreated
+ *
+ * @param kEvent $event
+ */
+ function OnPreCreate(&$event)
+ {
+ parent::OnPreCreate($event);
+
+ $object =& $event->getObject();
+ $object->SetDBField('CopyLabels', 1);
+
+ $live_table = kTempTablesHandler::GetLiveName($object->TableName);
+ $primary_lang_id = $this->Conn->GetOne('SELECT '.$object->IDField.' FROM '.$live_table.' WHERE PrimaryLang = 1');
+
+ $object->SetDBField('CopyFromLanguage', $primary_lang_id);
+ }
+
+
+ function OnChangeLanguage(&$event)
+ {
+ $this->Application->SetVar('m_lang', $this->Application->GetVar('language'));
+
+ $this->Application->LinkVar('language', 'm_lang');
+ }
+
+ /**
+ * Parse language XML file into temp tables and redirect to progress bar screen
+ *
+ * @param kEvent $event
+ */
+ function OnImportLanguage(&$event)
+ {
+ $items_info = $this->Application->GetVar('phrases_import');
+ if($items_info)
+ {
+ list($id,$field_values) = each($items_info);
+
+ $lang_xml =& $this->Application->recallObject('LangXML');
+ $lang_xml->Parse($field_values['LangFile']['tmp_name'], $field_values['PhraseType'], $field_values['Module']);
+ }
+ $event->redirect = 'dummy';
+ $event->SetRedirectParam('lang_event', 'OnImportProgress');
+ $event->SetRedirectParam('pass', 'all,lang');
+ }
+
+ /**
+ * Copies imported from xml file from temp table to live table
+ *
+ * @param kEvent $event
+ */
+ function OnImportProgress(&$event)
+ {
+ define('IMPORT_BY', 300); // import this much records per step
+ $template_name = 'in-commerce/regional/languages_import_step2';
+
+ $import_source = (int)$this->Application->GetVar('source');
+ $import_steps = Array(0 => 'lang', 1 => 'phrases', 2 => 'emailmessages', 3 => 'finish');
+ $import_titles = Array(0 => 'la_ImportingLanguages', 1 => 'la_ImportingPhrases', 2 => 'la_ImportingEmailEvents', 3 => 'la_Done');
+
+ // --- BEFORE ---
+ $import_prefix = $import_steps[$import_source];
+ $import_start = (int)$this->Application->GetVar('start');
+ $dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
+ $src_table = kTempTablesHandler::GetTempName($dst_table);
+
+ $import_total = $this->Application->GetVar('total');
+ if(!$import_total) $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
+ // --- AFTER ---
+
+ if($import_start == $import_total)
+ {
+ $import_source++;
+ $import_prefix = $import_steps[$import_source];
+ if($import_prefix == 'finish')
+ {
+ $event->SetRedirectParam('opener','u');
+ return true;
+ }
+
+ $import_start = 0;
+ $dst_table = $this->Application->getUnitOption($import_prefix,'TableName');
+ $src_table = kTempTablesHandler::GetTempName($dst_table);
+ $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table);
+ }
+
+ $done_percent = ($import_start * 100) / $import_total;
+ $block_params = Array( 'name' => $template_name,
+ 'title' => $import_titles[$import_source],
+ 'percent_done' => $done_percent,
+ 'percent_left' => 100 - $done_percent);
+
+ $this->Application->InitParser();
+ $this->Application->setUnitOption('phrases','AutoLoad',false);
+ echo $this->Application->ParseBlock($block_params);
+ flush();
+
+ $fields = array_keys( $this->Application->getUnitOption($import_prefix,'Fields') );
+
+ $sql = 'SELECT * FROM %s LIMIT %s,%s';
+ $rows = $this->Conn->Query( sprintf($sql,$src_table,$import_start,IMPORT_BY) );
+
+ $fields_sql = '';
+ foreach($fields as $field_name)
+ {
+ $fields_sql .= '`'.$field_name.'`,';
+ }
+ $fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
+ $values_sql = '';
+
+ foreach($rows as $row)
+ {
+ $values_sql .= '(';
+ foreach($row as $field_value)
+ {
+ $values_sql .= $this->Conn->qstr($field_value).',';
+ }
+ $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql).'),';
+ }
+ $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
+
+ $sql = sprintf('INSERT INTO %s (%s) VALUES %s', $dst_table, $fields_sql, $values_sql);
+ $this->Conn->Query($sql);
+
+ $event->setRedirectParams( Array('lang_event' => 'OnImportProgress', 'pass' => 'all,lang', 'start' => $import_start += count($rows), 'total' => $import_total, 'source' => $import_source) );
+ }
+
+ /**
+ * Stores ids of selected languages and redirects to export language step 1
+ *
+ * @param kEvent $event
+ */
+ function OnExportLanguage(&$event)
+ {
+ $this->Application->setUnitOption('phrases','AutoLoad',false);
+
+ $this->StoreSelectedIDs($event);
+ $this->Application->StoreVar('export_language_ids', implode(',', $this->getSelectedIDs($event)) );
+
+ $event->setRedirectParams( Array('m_opener'=>'d','phrases.export_event'=>'OnNew','pass'=>'all,phrases.export') );
+ $event->redirect = 'in-commerce/regional/languages_export';
+ }
+
+ /**
+ * Saves selected languages to xml file passed
+ *
+ * @param kEvent $event
+ */
+ function OnExportProgress(&$event)
+ {
+ $this->Application->setUnitOption('phrases','AutoLoad',false);
+ $object =& $this->Application->recallObject('phrases.export');
+
+ $items_info = $this->Application->GetVar('phrases_export');
+ if($items_info)
+ {
+ list($id,$field_values) = each($items_info);
+
+ $lang_ids = explode(',', $this->Application->RecallVar('export_language_ids') );
+
+ if( !getArrayValue($field_values,'LangFile') )
+ {
+ $object->SetError('LangFile', 'required');
+ $event->redirect = false;
+ return false;
+ }
+ if( !is_writable(EXPORT_PATH) )
+ {
+ $object->SetError('LangFile', 'write_error', 'la_ExportFolderNotWritable');
+ $event->redirect = false;
+ return false;
+ }
+ $field_values['LangFile'] .= '.lang';
+ $filename = EXPORT_PATH.'/'.$field_values['LangFile'];
+
+ $lang_xml =& $this->Application->recallObject('LangXML');
+ $lang_xml->Create($filename, $field_values['PhraseType'], $lang_ids, $field_values['Module']);
+
+ }
+
+ $event->redirect = 'in-commerce/regional/languages_export_step2';
+ $event->SetRedirectParam('export_file', $field_values['LangFile']);
+ }
+
+ /**
+ * Returns to previous template in opener stack
+ *
+ * @param kEvent $event
+ */
+ function OnGoBack(&$event)
+ {
+ $event->redirect_params['opener'] = 'u';
+ }
+
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/icons/icon24_summary_logs.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icons16_permissions_inherited.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tabnav_left.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default/img/novus.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_ship_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_delete_cat.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_primary_paymenttype_f2.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/cat_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/themes/default/common/footer.tpl
===================================================================
diff -u -r1364 -r1566
--- trunk/themes/default/common/footer.tpl (.../footer.tpl) (revision 1364)
+++ trunk/themes/default/common/footer.tpl (.../footer.tpl) (revision 1566)
@@ -1,4 +1,5 @@
-
+
+

|
@@ -14,5 +15,5 @@
-
+
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/icons/icon24_shipping.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_check_out.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_listings.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_permission.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_discounts.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default/img/btn_checkout.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/general/my_application.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/smicon5.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_cat_pick.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/stylesheets/stylesheets_config.php
===================================================================
diff -u
--- trunk/core/units/stylesheets/stylesheets_config.php (revision 0)
+++ trunk/core/units/stylesheets/stylesheets_config.php (revision 1566)
@@ -0,0 +1,114 @@
+ 'css',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'StylesheetsEventHandler','file'=>'stylesheets_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'css',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnCompileStylesheet',
+ ),
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+ 'IDField' => 'StylesheetId',
+
+ 'StatusField' => Array('Enabled'),
+
+ 'TitleField' => 'Name',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('css'=>'!la_title_Adding_Stylesheet!'),
+ 'edit_status_labels' => Array('css'=>'!la_title_Editing_Stylesheet!'),
+ 'new_titlefield' => Array('css'=>'!la_title_New_Stylesheet!'),
+ ),
+
+ 'styles_list' => Array('prefixes' => Array('css_List'), 'format' => "!la_title_Stylesheets! (#css_recordcount#)"),
+
+ 'stylesheets_edit' => Array('prefixes' => Array('css'), 'format' => "#css_status# '#css_titlefield#' - !la_title_General!"),
+
+ 'base_styles' => Array('prefixes' => Array('css','selectors.base_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BaseStyles! (#selectors.base_recordcount#)"),
+
+ 'block_styles' => Array('prefixes' => Array('css','selectors.block_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BlockStyles! (#selectors.block_recordcount#)"),
+
+ 'base_style_edit' => Array( 'prefixes' => Array('css','selectors'),
+ 'new_status_labels' => Array('selectors'=>'!la_title_Adding_BaseStyle!'),
+ 'edit_status_labels' => Array('selectors'=>'!la_title_Editing_BaseStyle!'),
+ 'new_titlefield' => Array('selectors'=>'!la_title_New_BaseStyle!'),
+ 'format' => "#css_status# '#css_titlefield#' - #selectors_status# '#selectors_titlefield#'"),
+
+ 'block_style_edit' => Array( 'prefixes' => Array('css','selectors'),
+ 'new_status_labels' => Array('selectors'=>'!la_title_Adding_BlockStyle!'),
+ 'edit_status_labels' => Array('selectors'=>'!la_title_Editing_BlockStyle!'),
+ 'new_titlefield' => Array('selectors'=>'!la_title_New_BlockStyle!'),
+ 'format' => "#css_status# '#css_titlefield#' - #selectors_status# '#selectors_titlefield#'"),
+
+ 'style_edit' => Array('prefixes' => Array('selectors'), 'format' => "!la_title_EditingStyle! '#selectors_titlefield#'"),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Stylesheets',
+ 'SubItems' => Array('selectors'),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array(0,1), 'type' => WHERE_FILTER),
+ ),
+
+ 'Filters' => Array(
+ 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
+ 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
+ )
+ ),
+
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('Name' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'StylesheetId' => Array(),
+ 'Name' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'AdvancedCSS' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'LastCompiled' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => '0'),
+ 'Enabled' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => '1','default' => 0),
+ ),
+
+ 'VirtualFields' => Array(),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif',0=>'icon16_style_disabled.gif',1=>'icon16_style.gif'),
+ 'Fields' => Array(
+ 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td'),
+ 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td' ),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ 'LastCompiled' => Array('title' => 'la_col_LastCompiled'),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Index: trunk/kernel/include/category.php
===================================================================
diff -u -r1442 -r1566
--- trunk/kernel/include/category.php (.../category.php) (revision 1442)
+++ trunk/kernel/include/category.php (.../category.php) (revision 1566)
@@ -998,13 +998,12 @@
case "link_selector":
$m_var_list_update["cat"] = $this->Get("CategoryId");
$ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv();
+
- // pass through selector
- if( isset($_REQUEST['Selector']) ) $ret .= '&Selector='.$_REQUEST['Selector'];
+ $tmp = GetVar('Selector'); if($tmp) $ret .= '&Selector='.$tmp;
+ $tmp = GetVar('new'); if($tmp) $ret .= '&new='.$tmp;
+ $tmp = GetVar('destform'); if($tmp) $ret .= '&destform='.$tmp;
- // pass new status
- if( isset($_REQUEST['new']) ) $ret .= '&new='.$_REQUEST['new'];
-
unset($m_var_list_update["cat"]);
return $ret;
break;
@@ -1823,7 +1822,10 @@
$selector = isset($_REQUEST['Selector']) ? '&Selector='.$_REQUEST['Selector'] : '';
$new = isset($_REQUEST['new']) ? '&new='.$_REQUEST['new'] : '';
-
+ $destform = GetVar('destform') !== false ? '&destform='.GetVar('destform') : '';
+
+ $add = $selector.$new.$destform;
+
$nav = "";
$m_var_list_update["p"]=1;
if(strlen($target_template)==0)
@@ -1836,7 +1838,7 @@
if ($LinkRoot)
{
$var_list_update["t"] = strlen($RootTemplate)? $RootTemplate : $target_template;
- $nav = "$cat_name"; }
+ $nav = "$cat_name"; }
else
$nav = "$cat_name";
}
@@ -1866,7 +1868,7 @@
{
if ($admin == 1)
{
- $nav[] = "".$cat_name."";
+ $nav[] = "".$cat_name."";
}
else
{
@@ -1878,7 +1880,7 @@
{
$var_list_update["t"] = $target_template;
}
- $nav[] = "".$cat_name."";
+ $nav[] = "".$cat_name."";
}
}
}
@@ -1895,7 +1897,7 @@
{
if ($admin == 1)
{
- $nav[] = "".$cat_name."";
+ $nav[] = "".$cat_name."";
}
else
{
@@ -1905,7 +1907,7 @@
}
else
$var_list_update["t"] = $target_template;
- $nav[] = "".$cat_name."";
+ $nav[] = "".$cat_name."";
}
}
@@ -1939,12 +1941,12 @@
{
if ($admin == 1)
{
- $nav[] = "".$cat_name."";
+ $nav[] = "".$cat_name."";
}
else
{
$var_list_update["t"] = $t;
- $nav[] = "".$cat_name."";
+ $nav[] = "".$cat_name."";
unset($var_list_update["t"]);
}
}
Index: trunk/kernel/admin_templates/img/toolbar/tool_usertogroup_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/ic_hot.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/arrow.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/ic_pop.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/in-link/icon16_link.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_search_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_export_language.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_help.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/help/help_config.php
===================================================================
diff -u
--- trunk/kernel/units/help/help_config.php (revision 0)
+++ trunk/kernel/units/help/help_config.php (revision 1566)
@@ -0,0 +1,15 @@
+ 'h',
+ 'EventHandlerClass' => Array('class'=>'kEventHandler','file'=>'','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',
+ ),
+ );
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_print_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_settings_censor.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/users/users_tag_processor.php
===================================================================
diff -u
--- trunk/kernel/units/users/users_tag_processor.php (revision 0)
+++ trunk/kernel/units/users/users_tag_processor.php (revision 1566)
@@ -0,0 +1,126 @@
+ 'all,m,u', 'u_event' => 'OnLogout');
+ return $this->Application->HREF('', '', $pass);
+ }
+
+ function UseUsernames($params)
+ {
+ return $this->Application->ConfigValue('Email_As_Login') != 1;
+ }
+
+ function RegistrationEnabled($params)
+ {
+ return $this->Application->ConfigValue('User_Allow_New') != 2;
+ }
+
+ function ConfirmPasswordLink($params)
+ {
+ //global $m_var_list_update, $var_list_update, $objSession, $objConfig;
+
+ $template = "forgotpw_reset_result";
+
+ $tmp_user_id = $this->Application->RecallVar("tmp_user_id");
+
+ $saved_denerated_code = $this->Application->GetVar('saved_denerated_code');
+ if ($saved_denerated_code){
+ $code = $saved_denerated_code;
+ }
+ else {
+ $code = md5($this->GenerateCode());
+ $this->Application->SetVar('saved_denerated_code', $code);
+ }
+
+
+
+ $sql = 'UPDATE '.TABLE_PREFIX.'PortalUser SET PwResetConfirm="'.$code.'", PwRequestTime='.mktime().' WHERE PortalUserId='.$tmp_user_id;
+
+ $this->Conn->Query($sql);
+
+ $params = array_merge($params, array('pass'=>'m', 'user_key'=>$code));
+
+ $main_processor =& $this->Application->recallObject('m_TagProcessor');
+
+ return $main_processor->T($params);
+
+ }
+
+ function GenerateCode()
+ {
+ list($usec, $sec) = explode(" ",microtime());
+
+ $id_part_1 = substr($usec, 4, 4);
+ $id_part_2 = mt_rand(1,9);
+ $id_part_3 = substr($sec, 6, 4);
+ $digit_one = substr($id_part_1, 0, 1);
+ if ($digit_one == 0) {
+ $digit_one = mt_rand(1,9);
+ $id_part_1 = ereg_replace("^0","",$id_part_1);
+ $id_part_1=$digit_one.$id_part_1;
+ }
+ return $id_part_1.$id_part_2.$id_part_3;
+ }
+
+ function ForgottenPassword($params){
+ return $this->Application->GetVar('ForgottenPassword');
+ }
+
+ function TestCodeIsValid($param){
+
+ $passed_key = $this->Application->GetVar('user_key');
+
+ $user_object = &$this->Application->recallObject('u.forgot');
+ $user_current_object = &$this->Application->recallObject('u');
+
+ if (strlen(trim($passed_key)) == 0) {
+
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ return false;
+ }
+
+
+ if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
+ {
+ $exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
+ if ($exp_time > mktime())
+ {
+
+
+ } else {
+ $user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
+ return false;
+
+ }
+ } else {
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ return false;
+
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns sitem administrator email
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SiteAdminEmail($params)
+ {
+ return $this->Application->ConfigValue('Smtp_AdminMailFrom');
+ }
+
+ }
+
+
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/old/sort_2_desc.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_settings_general.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_banlist.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_flip.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin/include/toolbar/userselect.php
===================================================================
diff -u -r718 -r1566
--- trunk/kernel/admin/include/toolbar/userselect.php (.../userselect.php) (revision 718)
+++ trunk/kernel/admin/include/toolbar/userselect.php (.../userselect.php) (revision 1566)
@@ -133,7 +133,7 @@
if(retval.length>0)
{
- bf.$destfield.value = retval;
+ bf.elements["$destfield"].value = retval;
if(DoSubmit)
{
bf.submit();
Index: trunk/kernel/admin_templates/img/toolbar/tool_copy_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_prev_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_upcat_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/admin/users/adduser_custom.php
===================================================================
diff -u -r881 -r1566
--- trunk/admin/users/adduser_custom.php (.../adduser_custom.php) (revision 881)
+++ trunk/admin/users/adduser_custom.php (.../adduser_custom.php) (revision 1566)
@@ -128,11 +128,13 @@
$formaction = $adminURL."/user/adduser_custom.php?".$envar;
+$saveURL = $admin."/".$objSession->GetVariable('ReturnScript');
+
//Display header
$sec = $objSections->GetSection($section);
$objListToolbar = new clsToolBar();
-$objListToolbar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',1);","tool_select.gif");
-$objListToolbar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',2);","tool_cancel.gif");
+$objListToolbar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('edituser','UserEditStatus','".$saveURL."',1);","tool_select.gif");
+$objListToolbar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('edituser','UserEditStatus','".$saveURL."',2);","tool_cancel.gif");
if ( isset($en_prev) || isset($en_next) )
{
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/custom_values/custom_value_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/icons/icon24_tool_export.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_product_pending.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/users/users_event_handler.php
===================================================================
diff -u
--- trunk/core/units/users/users_event_handler.php (revision 0)
+++ trunk/core/units/users/users_event_handler.php (revision 1566)
@@ -0,0 +1,591 @@
+Application->setUnitOption($event->Prefix, 'AutoLoad', false);
+ $object =& $this->Application->recallObject('u');
+
+ $password = $this->Application->GetVar('password');
+ if(!$password)
+ {
+ $object->SetError('ValidateLogin', 'blank_password', 'lu_blank_password');
+ $event->status = erFAIL;
+ return false;
+ }
+
+ $email_as_login = $this->Application->ConfigValue('Email_As_Login');
+ list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
+ $login_value = $this->Application->GetVar($submit_field);
+
+ $sql = 'SELECT PortalUserId FROM '.$object->TableName.' WHERE (%s = %s) AND (Password = MD5(%s))';
+ $user_id = $this->Conn->GetOne( sprintf($sql, $login_field, $this->Conn->qstr($login_value), $this->Conn->qstr($password) ) );
+
+ if($user_id)
+ {
+ $object->Load($user_id);
+ if( $object->GetDBField('Status') == STATUS_ACTIVE )
+ {
+ $session =& $this->Application->recallObject('Session');
+ $session->SetField('PortalUserId', $user_id);
+ $this->Application->SetVar('u_id', $user_id);
+ $this->Application->StoreVar('user_id', $user_id);
+
+ $sql = 'SELECT DISTINCT GroupId FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId = '.$user_id;
+ if( $groups = $this->Conn->GetCol($sql) )
+ {
+ $this->Application->StoreVar( 'UserGroups', implode(',', $groups) );
+ }
+
+ $next_template = $this->Application->GetVar('next_template');
+ if($next_template) $event->redirect = $next_template;
+ }
+ else
+ {
+ $event->redirect = $this->Application->GetVar('pending_disabled_template');
+ }
+ }
+ else
+ {
+ $object->SetError('ValidateLogin', 'invalid_password', 'lu_invalid_password');
+ $event->status = erFAIL;
+ }
+ }
+
+ function OnLogout(&$event)
+ {
+ $session =& $this->Application->recallObject('Session');
+ $session->SetField('PortalUserId', -2);
+ $this->Application->SetVar('u_id', -2);
+ $this->Application->StoreVar('user_id', -2);
+ $object =& $this->Application->recallObject('u');
+ $object->Load(-2);
+
+ $this->Application->DestroySession();
+ }
+
+ /**
+ * Prefill states dropdown with correct values
+ *
+ * @param kEvent $event
+ * @access public
+ */
+ function OnPrepareStates(&$event)
+ {
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $cs_helper->PopulateStates($event, 'State', 'Country');
+
+ $object =& $event->getObject();
+
+ if( $cs_helper->CountryHasStates( $object->GetDBField('Country') ) ) $object->Fields['State']['required'] = true;
+
+ if( $this->Application->ConfigValue('Email_As_Login') )
+ {
+ $object->SetDBField('Login', $object->GetDBField('Email') );
+ }
+ }
+
+ /**
+ * Redirects user after succesfull registration to confirmation template (on Front only)
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ $is_subscriber = $this->Application->GetVar('IsSubscriber');
+ if (!$is_subscriber){
+
+ $object =& $event->getObject();
+ $group_id = $this->Application->ConfigValue('User_NewGroup');
+
+ $sql = 'INSERT INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,1)';
+ $this->Conn->Query( sprintf($sql, $object->GetID(), $group_id) );
+
+ }
+ }
+
+ /**
+ * Login user if possible, if not then redirect to corresponding template
+ *
+ * @param kEvent $event
+ */
+ function autoLoginUser(&$event)
+ {
+ $object =& $event->getObject();
+ $this->Application->SetVar('u_id', $object->GetID() );
+
+ if($object->GetDBField('Status') == STATUS_ACTIVE)
+ {
+ $email_as_login = $this->Application->ConfigValue('Email_As_Login');
+ list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login');
+
+ $this->Application->SetVar($submit_field, $object->GetDBField($login_field) );
+ $this->Application->SetVar('password', $object->GetDBField('Password_plain') );
+
+ $event->CallSubEvent('OnLogin');
+ }
+ }
+
+ /**
+ * Creates new user
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ if( !$this->Application->IsAdmin() ) $this->setUserStatus($event);
+
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $cs_helper->CheckStateField($event, 'State', 'Country');
+
+ parent::OnCreate($event);
+
+ $this->setNextTemplate($event);
+
+ if( !$this->Application->IsAdmin() && ($event->status == erSUCCESS) && $event->redirect) $this->autoLoginUser($event);
+ }
+
+ /**
+ * Set's new user status based on config options
+ *
+ * @param kEvent $event
+ */
+ function setUserStatus(&$event)
+ {
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object =& $event->getObject();
+
+ $new_users_allowed = $this->Application->ConfigValue('User_Allow_New');
+ // 1 - Instant, 2 - Not Allowed, 3 - Pending
+
+ switch ($new_users_allowed)
+ {
+ case 1: // Instant
+ $object->SetDBField('Status', 1);
+ $event->redirect = $this->Application->GetVar('registration_confirm_template');
+ break;
+
+ case 3: // Pending
+ $event->redirect = $this->Application->GetVar('registration_confirm_pending_template');
+ $object->SetDBField('Status', 2);
+ break;
+
+ case 2: // Not Allowed
+ $object->SetDBField('Status', 0);
+ break;
+ }
+ }
+
+ /**
+ * Set's new unique resource id to user
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemValidate(&$event)
+ {
+ $object =& $event->getObject();
+ $object->SetDBField('ResourceId', $this->Application->NextResourceId() );
+ }
+
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnRecommend(&$event){
+
+ $friend_email = $this->Application->GetVar('friend_email');
+ $friend_name = $this->Application->GetVar('friend_email');
+
+ if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $friend_email))
+ {
+
+ $send_params = array();
+ $send_params['to_email']=$friend_email;
+ $send_params['to_name']=$friend_name;
+
+ $user_id = $this->Application->GetVar('u_id');
+ $email_event = &$this->Application->EmailEventUser('SITE.SUGGEST', $user_id, $send_params);
+ if ($email_event->status == erSUCCESS){
+ $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+ $event->redirect = $this->Application->GetVar('template_success');
+ }
+ else {
+// $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+// $event->redirect = $this->Application->GetVar('template_fail');
+ $object =& $this->Application->recallObject('u');
+ $object->ErrorMsgs['send_error'] = $this->Application->Phrase('lu_email_send_error');
+ $object->FieldErrors['Email']['pseudo'] = 'send_error';
+ $event->status = erFAIL;
+
+ }
+ }
+ else {
+ $object =& $this->Application->recallObject('u');
+ $object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
+ $object->FieldErrors['Email']['pseudo'] = 'invalid_email';
+ $event->status = erFAIL;
+ }
+
+
+ }
+
+ /**
+ * Saves address changes and mades no redirect
+ *
+ * @param kEvent $event
+ */
+ function OnUpdateAddress(&$event)
+ {
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object =& $event->getObject();
+
+ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
+ if($items_info)
+ {
+ list($id,$field_values) = each($items_info);
+ if($id > 0) $object->Load($id);
+ $object->SetFieldsFromHash($field_values);
+ $object->setID($id);
+ $object->Validate();
+ }
+
+ $event->redirect = false;
+ }
+
+ function OnSubscribeQuery(&$event){
+
+ $user_email = $this->Application->GetVar('subscriber_email');
+ if ( eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $user_email) ){
+
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object = &$this->Application->recallObject($this->Prefix.'.subscriber');
+
+ $this->Application->StoreVar('SubscriberEmail', $user_email);
+
+ if( $object->Load(array('Email'=>$user_email)) ){
+ $group_info = $this->GetGroupInfo($object->GetID());
+ if($group_info){
+ $event->redirect = $this->Application->GetVar('unsubscribe_template');
+ }
+ else {
+ $event->redirect = $this->Application->GetVar('subscribe_template');
+ }
+ }
+ else {
+ $event->redirect = $this->Application->GetVar('subscribe_template');
+ $this->Application->StoreVar('SubscriberEmail', $user_email);
+ }
+
+ }
+ else {
+
+ $object =& $this->Application->recallObject('u');
+ $object->ErrorMsgs['invalid_email'] = $this->Application->Phrase('lu_InvalidEmail');
+ $object->FieldErrors['SubscribeEmail']['pseudo'] = 'invalid_email';
+ $event->status = erFAIL;
+
+ }
+
+
+ //subscribe_query_ok_template
+ }
+
+ function OnSubscribeUser(&$event){
+
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $object = &$this->Application->recallObject($this->Prefix.'.subscriber');
+
+ $user_email = $this->Application->RecallVar('SubscriberEmail');
+
+ if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $user_email)){
+
+ if($object->Load(array('Email'=>$user_email))){
+
+ $group_info = $this->GetGroupInfo($object->GetID());
+
+ if ($group_info){
+ if ($group_info['PrimaryGroup']){
+ // delete user
+ $object->Delete();
+ }
+ else {
+ $this->RemoveSubscriberGroup($object->GetID());
+ }
+
+ $event->redirect = $this->Application->GetVar('unsubscribe_ok_template');
+
+ }
+ else {
+ $this->AddSubscriberGroup($object->GetID(), 0);
+ $event->redirect = $this->Application->GetVar('subscribe_ok_template');
+ }
+
+
+ }
+ else {
+
+ $object->SetField('Email', $user_email);
+ $object->SetField('Login', $user_email);
+ $object->SetDBField('dob_date', 1);
+ $object->SetDBField('dob_time', 1);
+ $ip = getenv('HTTP_X_FORWARDED_FOR')?getenv('HTTP_X_FORWARDED_FOR'):getenv('REMOTE_ADDR');
+ $object->SetDBField('ip', $ip);
+
+ $this->Application->SetVar('IsSubscriber', 1);
+
+ if ($object->Create()) {
+
+ $this->AddSubscriberGroup($object->GetID(), 1);
+ $event->redirect = $this->Application->GetVar('subscribe_ok_template');
+ }
+
+ $this->Application->SetVar('IsSubscriber', 0);
+ }
+ }
+ else {
+ // error handling here
+ $event->redirect = $this->Application->GetVar('subscribe_fail_template');
+ }
+
+
+ }
+
+ function AddSubscriberGroup($user_id, $is_primary){
+
+ $group_id = $this->Application->ConfigValue('User_SubscriberGroup');
+ $sql = 'INSERT INTO '.TABLE_PREFIX.'UserGroup(PortalUserId,GroupId,PrimaryGroup) VALUES (%s,%s,'.$is_primary.')';
+ $this->Conn->Query( sprintf($sql, $user_id, $group_id) );
+
+ }
+
+ function RemoveSubscriberGroup($user_id){
+
+ $group_id = $this->Application->ConfigValue('User_SubscriberGroup');
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'UserGroup WHERE PortalUserId='.$user_id.' AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup');
+ $this->Conn->Query($sql);
+
+ }
+
+ function GetGroupInfo($user_id){
+
+ $group_info = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'UserGroup
+ WHERE PortalUserId='.$user_id.'
+ AND GroupId='.$this->Application->ConfigValue('User_SubscriberGroup'));
+ return $group_info;
+
+ }
+
+ function OnForgotPassword(&$event){
+
+ $this->Application->setUnitOption('u', 'AutoLoad', false);
+ $user_object = &$this->Application->recallObject('u.forgot');
+ $user_current_object = &$this->Application->recallObject('u');
+
+ $username = $this->Application->GetVar('username');
+ $email = $this->Application->GetVar('email');
+ $found = false;
+ $allow_reset = true;
+
+ if( strlen($username) )
+ {
+ if( $user_object->Load(array('Login'=>$username)) )
+ $found = ($user_object->GetDBField("Login")==$username && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
+ }
+ else if( strlen($email) )
+ {
+ if( $user_object->Load(array('Email'=>$email)) )
+ $found = ($user_object->GetDBField("Email")==$email && $user_object->GetDBField("Status")==1) && strlen($user_object->GetDBField("Password"));
+ }
+
+ if($user_object->Loaded)
+ {
+ $PwResetConfirm = $user_object->GetDBField('PwResetConfirm');
+ $PwRequestTime = $user_object->GetDBField('PwRequestTime');
+ $PassResetTime = $user_object->GetDBField('PassResetTime');
+ //$MinPwResetDelay = $user_object->GetDBField('MinPwResetDelay');
+ $MinPwResetDelay = $this->Application->ConfigValue('Users_AllowReset');
+
+ $allow_reset = (strlen($PwResetConfirm) ?
+ mktime() > $PwRequestTime + $MinPwResetDelay :
+ mktime() > $PassResetTime + $MinPwResetDelay);
+ }
+
+ if($found && $allow_reset)
+ {
+ $this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId"));
+ $this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email"));
+
+ $this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
+
+ $event->redirect = $this->Application->GetVar('template_success');
+
+ }
+ else
+ {
+ if(!strlen($username) && !strlen($email))
+ {
+ $user_current_object->ErrorMsgs['forgotpw_nodata'] = $this->Application->Phrase('lu_ferror_forgotpw_nodata');
+ $user_current_object->FieldErrors['Login']['pseudo'] = 'lu_ferror_forgotpw_nodata';
+ }
+ else
+ {
+
+ if($allow_reset)
+ {
+ if( strlen($username) ){
+ $user_current_object->ErrorMsgs['unknown_username'] = $this->Application->Phrase('lu_ferror_unknown_username');
+ $user_current_object->FieldErrors['Login']['pseudo']='unknown_username';
+ }
+ if( strlen($email) ){
+ $user_current_object->ErrorMsgs['unknown_email'] = $this->Application->Phrase('lu_ferror_unknown_email');
+ $user_current_object->FieldErrors['Email']['pseudo']='unknown_email';
+ }
+ }
+ else
+ {
+ $user_current_object->ErrorMsgs['reset_denied'] = $this->Application->Phrase('lu_ferror_reset_denied');
+ if( strlen($username) ){
+ $user_current_object->FieldErrors['Login']['pseudo']='reset_denied';
+ }
+ if( strlen($email) ){
+ $user_current_object->FieldErrors['Email']['pseudo']='reset_denied';
+ }
+ }
+
+ }
+
+ if($user_current_object->FieldErrors){
+ $event->redirect = false;
+ }
+ }
+
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnResetPassword(&$event){
+
+ $user_object = &$this->Application->recallObject('u.forgot');
+
+ if($user_object->Load($this->Application->RecallVar('tmp_user_id'))){
+
+ $this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId"));
+ $event->redirect = $this->Application->GetVar('template_success');
+
+ $mod_object =& $this->Application->recallObject('mod.'.'In-Commerce');
+ $m_cat_id = $mod_object->GetDBField('RootCat');
+ $event->SetRedirectParam('pass', 'm');
+ //$event->SetRedirectParam('m_cat_id', $m_cat_id);
+ $this->Application->SetVar('m_cat_id', $m_cat_id);
+
+
+ }
+
+ }
+
+ function OnResetPasswordConfirmed(&$event){
+
+ $passed_key = $this->Application->GetVar('user_key');
+
+ $user_object = &$this->Application->recallObject('u.forgot');
+ $user_current_object = &$this->Application->recallObject('u');
+
+ if (strlen(trim($passed_key)) == 0) {
+ $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+ $event->redirect = false;
+
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ }
+
+
+ if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
+ {
+ $exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
+ $user_object->SetDBField("PwResetConfirm", '');
+ $user_object->SetDBField("PwRequestTime", 0);
+ if ($exp_time > mktime())
+ {
+ //$m_var_list_update['codevalidationresult'] = 'lu_resetpw_confirm_text';
+ $newpw = makepassword4();
+
+ $this->Application->StoreVar('password', $newpw);
+
+ $user_object->SetDBField("Password",$newpw);
+ $user_object->SetDBField("PassResetTime", time());
+ $user_object->SetDBField("PwResetConfirm", '');
+ $user_object->SetDBField("PwRequestTime", 0);
+ $user_object->Update();
+
+ $this->Application->SetVar('ForgottenPassword', $newpw);
+
+ $email_event_user = &$this->Application->EmailEventUser('INCOMMERCEUSER.PSWD', $user_object->GetDBField('PortalUserId'));
+ $email_event_admin = &$this->Application->EmailEventAdmin('INCOMMERCEUSER.PSWD');
+
+ $this->Application->DeleteVar('ForgottenPassword');
+
+ if ($email_event_user->status == erSUCCESS){
+ $event->redirect_params = array('opener' => 's', 'pass' => 'all');
+ $event->redirect = $this->Application->GetVar('template_success');
+ }
+
+ $user_object->SetDBField("Password",md5($newpw));
+ $user_object->Update();
+
+ } else {
+ $user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
+ $event->redirect = false;
+
+ }
+ } else {
+ $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
+ $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
+ $event->redirect = false;
+
+ }
+ }
+
+ function OnUpdate(&$event)
+ {
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $cs_helper->CheckStateField($event, 'State', 'Country');
+
+ parent::OnUpdate($event);
+
+ $this->setNextTemplate($event);
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function setNextTemplate(&$event)
+ {
+ if( !$this->Application->IsAdmin() )
+ {
+ $event->redirect_params['opener'] = 's';
+ $object =& $event->getObject();
+ if($object->GetDBField('Status') == STATUS_ACTIVE)
+ {
+ $next_template = $this->Application->GetVar('next_template');
+ if($next_template) $event->redirect = $next_template;
+ }
+ }
+ }
+ }
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_select.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_reset_to_billing_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/itemicons/icon16_discount_pending.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/email_events/email_events_config.php
===================================================================
diff -u
--- trunk/kernel/units/email_events/email_events_config.php (revision 0)
+++ trunk/kernel/units/email_events/email_events_config.php (revision 1566)
@@ -0,0 +1,97 @@
+ '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(),
+ '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('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('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'),
+ 'Module' => Array( 'title'=>'la_col_Module' ),
+ 'Type' => Array( 'title'=>'la_col_Type' ),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+
+ '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'),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/old/icon_select_page.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon24_conf_themes.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_theme_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tab_active_left.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_move_down.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_clear_all.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/calendar.js
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/calendar.js (revision 0)
+++ trunk/kernel/admin_templates/incs/calendar.js (revision 1566)
@@ -0,0 +1,1318 @@
+var cbPath = "";
+ /*
+preloadImage(cbPath);
+preloadImage(cbPathO);
+preloadImage(cbPathA);
+*/
+
+//addScript("core.js");
+//addScript("lang.js");
+
+//addCss("wnd.css");
+//addCss("calendar.css");
+
+function initCalendar(id, dateFormat)
+{
+ var input = document.getElementById(id);
+ if (!input) return;
+ input.dateFormat = dateFormat;
+ var cbPath = input.getAttribute("datepickerIcon");
+
+ var inputContainer = document.createElement("DIV");
+ inputContainer.className = "dpContainer";
+ inputContainer.noWrap = true;
+ var pNode = input.parentNode;
+ pNode.insertBefore(inputContainer, input.nextSibling);
+// inputContainer.appendChild(pNode.removeChild(input));
+
+ var calendarButton = document.createElement("IMG");
+ calendarButton.setAttribute("width", "24");
+ calendarButton.setAttribute("height", "24");
+ calendarButton.setAttribute("align", "absMiddle");
+ calendarButton.style.width=24
+ calendarButton.style.height=24
+ calendarButton.style.cursor = "hand";
+
+ calendarButton.setAttribute("hspace", 2);
+ calendarButton.src = cbPath;
+ calendarButton.onmouseover = cbMouseOver;
+ calendarButton.onmouseout = cbMouseOut;
+ calendarButton.onmouseup = calendarButton.onmouseout;
+ calendarButton.onmousedown = cbMouseDown;
+ calendarButton.showCalendar = wnd_showCalendar;
+ inputContainer.appendChild(calendarButton);
+ inputContainer.dateInput = input;
+}
+
+var calendar;
+
+function cbMouseOver(e)
+{
+// this.src = cbPathO;
+ var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
+}
+
+function cbMouseOut(e)
+{
+// this.src = cbPath;
+ var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
+}
+
+function cbMouseDown(e)
+{
+// this.src = cbPathA;
+ // alert("cbMouseDown");
+ var evt = (e) ? e : event; if (evt) evt.cancelBubble = true;
+ this.showCalendar();
+}
+
+function wnd_showCalendar()
+{
+ var el = this.parentNode.dateInput;
+ if (calendar != null) calendar.hide();
+ else
+ {
+ var calendarObject = new Calendar(false, null, dateSelected, closeHandler);
+ calendar = calendarObject;
+ calendarObject.setRange(1900, 2070);
+ calendarObject.create();
+ }
+ calendar.setDateFormat(el.dateFormat);
+ calendar.parseDate(el.value);
+ calendar.sel = el;
+ calendar.showAtElement(el);
+
+ Calendar.addEvent(document, "mousedown", checkCalendar);
+ return false;
+}
+
+function dateSelected(calendarObject, date)
+{
+ calendarObject.sel.value = date;
+ calendarObject.callCloseHandler();
+}
+
+function closeHandler(calendarObject)
+{
+ calendarObject.hide();
+ Calendar.removeEvent(document, "mousedown", checkCalendar);
+}
+
+function checkCalendar(ev)
+{
+ var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
+
+ for (; el != null; el = el.parentNode)
+ if (el == calendar.element || el.tagName == "A") break;
+
+ if (el == null)
+ {
+ calendar.callCloseHandler();
+ Calendar.stopEvent(ev);
+ }
+}
+
+function preloadImage(path)
+{
+ var img = new Image();
+ img.src = path;
+ preloadImages.push(img);
+}
+
+function addCss(path)
+{
+ path = cssPath + path;
+ document.write("");
+}
+
+/**/
+/* Copyright Mihai Bazon, 2002
+ * http://students.infoiasi.ro/~mishoo
+ *
+ * Version: 0.9.1
+ *
+ * Feel free to use this script under the terms of the GNU General Public
+ * License, as long as you do not remove or alter this notice.
+ */
+
+/** The Calendar object constructor. */
+Calendar = function (mondayFirst, dateStr, onSelected, onClose) {
+ // member variables
+ this.activeDiv = null;
+ this.currentDateEl = null;
+ this.checkDisabled = null;
+ this.timeout = null;
+ this.onSelected = onSelected || null;
+ this.onClose = onClose || null;
+ this.dragging = false;
+ this.minYear = 1970;
+ this.maxYear = 2050;
+ this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];
+ this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"];
+ this.isPopup = true;
+ this.mondayFirst = mondayFirst;
+ this.dateStr = dateStr;
+ // HTML elements
+ this.table = null;
+ this.element = null;
+ this.tbody = null;
+ this.daynames = null;
+ // Combo boxes
+ this.monthsCombo = null;
+ this.yearsCombo = null;
+ this.hilitedMonth = null;
+ this.activeMonth = null;
+ this.hilitedYear = null;
+ this.activeYear = null;
+
+ // one-time initializations
+ if (!Calendar._DN3) {
+ // table of short day names
+ var ar = new Array();
+ for (var i = 8; i > 0;) {
+ ar[--i] = Calendar._DN[i].substr(0, 3);
+ }
+ Calendar._DN3 = ar;
+ // table of short month names
+ ar = new Array();
+ for (var i = 12; i > 0;) {
+ ar[--i] = Calendar._MN[i].substr(0, 3);
+ }
+ Calendar._MN3 = ar;
+ }
+};
+
+// ** constants
+
+/// "static", needed for event handlers.
+Calendar._C = null;
+
+/// detect a special case of "web browser"
+Calendar.is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
+ (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
+
+// short day names array (initialized at first constructor call)
+Calendar._DN3 = null;
+
+// short month names array (initialized at first constructor call)
+Calendar._MN3 = null;
+
+// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
+// library, at some point.
+
+Calendar.getAbsolutePos = function(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = Calendar.getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+Calendar.isRelated = function (el, evt) {
+ var related = evt.relatedTarget;
+ if (!related) {
+ var type = evt.type;
+ if (type == "mouseover") {
+ related = evt.fromElement;
+ } else if (type == "mouseout") {
+ related = evt.toElement;
+ }
+ }
+ while (related) {
+ if (related == el) {
+ return true;
+ }
+ related = related.parentNode;
+ }
+ return false;
+};
+
+Calendar.removeClass = function(el, className) {
+ if (!(el && el.className)) {
+ return;
+ }
+ var cls = el.className.split(" ");
+ var ar = new Array();
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] != className) {
+ ar[ar.length] = cls[i];
+ }
+ }
+ el.className = ar.join(" ");
+};
+
+Calendar.addClass = function(el, className) {
+ el.className += " " + className;
+};
+
+Calendar.getElement = function(ev) {
+ if (Calendar.is_ie) {
+ return window.event.srcElement;
+ } else {
+ return ev.currentTarget;
+ }
+};
+
+Calendar.getTargetElement = function(ev) {
+ if (Calendar.is_ie) {
+ return window.event.srcElement;
+ } else {
+ return ev.target;
+ }
+};
+
+Calendar.stopEvent = function(ev) {
+ if (Calendar.is_ie) {
+ window.event.cancelBubble = true;
+ window.event.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+};
+
+Calendar.addEvent = function(el, evname, func) {
+ if (Calendar.is_ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+Calendar.removeEvent = function(el, evname, func) {
+ if (Calendar.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+};
+
+Calendar.createElement = function(type, parent) {
+ var el = null;
+ if (document.createElementNS) {
+ // use the XHTML namespace; IE won't normally get here unless
+ // _they_ "fix" the DOM2 implementation.
+ el = document.createElementNS("http://www.w3.org/1999/xhtml", type);
+ } else {
+ el = document.createElement(type);
+ }
+ if (typeof parent != "undefined") {
+ parent.appendChild(el);
+ }
+ return el;
+};
+
+// END: UTILITY FUNCTIONS
+
+// BEGIN: CALENDAR STATIC FUNCTIONS
+
+/** Internal -- adds a set of events to make some element behave like a button. */
+Calendar._add_evs = function(el) {
+ with (Calendar) {
+ addEvent(el, "mouseover", dayMouseOver);
+ addEvent(el, "mousedown", dayMouseDown);
+ addEvent(el, "mouseout", dayMouseOut);
+ if (is_ie) {
+ addEvent(el, "dblclick", dayMouseDblClick);
+ el.setAttribute("unselectable", true);
+ }
+ }
+};
+
+Calendar.findMonth = function(el) {
+ if (typeof el.month != "undefined") {
+ return el;
+ } else if (typeof el.parentNode.month != "undefined") {
+ return el.parentNode;
+ }
+ return null;
+};
+
+Calendar.findYear = function(el) {
+ if (typeof el.year != "undefined") {
+ return el;
+ } else if (typeof el.parentNode.year != "undefined") {
+ return el.parentNode;
+ }
+ return null;
+};
+
+Calendar.showMonthsCombo = function () {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ var cal = cal;
+ var cd = cal.activeDiv;
+ var mc = cal.monthsCombo;
+ if (cal.hilitedMonth) {
+ Calendar.removeClass(cal.hilitedMonth, "hilite");
+ }
+ if (cal.activeMonth) {
+ Calendar.removeClass(cal.activeMonth, "active");
+ }
+ var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];
+ Calendar.addClass(mon, "active");
+ cal.activeMonth = mon;
+ mc.style.left = cd.offsetLeft;
+ mc.style.top = cd.offsetTop + cd.offsetHeight;
+ mc.style.display = "block";
+};
+
+Calendar.showYearsCombo = function (fwd) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ var cal = cal;
+ var cd = cal.activeDiv;
+ var yc = cal.yearsCombo;
+ if (cal.hilitedYear) {
+ Calendar.removeClass(cal.hilitedYear, "hilite");
+ }
+ if (cal.activeYear) {
+ Calendar.removeClass(cal.activeYear, "active");
+ }
+ cal.activeYear = null;
+ var Y = cal.date.getFullYear() + (fwd ? 1 : -1);
+ var yr = yc.firstChild;
+ var show = false;
+ for (var i = 12; i > 0; --i) {
+ if (Y >= cal.minYear && Y <= cal.maxYear) {
+ yr.firstChild.data = Y;
+ yr.year = Y;
+ yr.style.display = "block";
+ show = true;
+ } else {
+ yr.style.display = "none";
+ }
+ yr = yr.nextSibling;
+ Y += fwd ? 2 : -2;
+ }
+ if (show) {
+ yc.style.left = cd.offsetLeft;
+ yc.style.top = cd.offsetTop + cd.offsetHeight;
+ yc.style.display = "block";
+ }
+};
+
+// event handlers
+
+Calendar.tableMouseUp = function(ev) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ if (cal.timeout) {
+ clearTimeout(cal.timeout);
+ }
+ var el = cal.activeDiv;
+ if (!el) {
+ return false;
+ }
+ var target = Calendar.getTargetElement(ev);
+ Calendar.removeClass(el, "active");
+ if (target == el || target.parentNode == el) {
+ Calendar.cellClick(el);
+ }
+ var mon = Calendar.findMonth(target);
+ var date = null;
+ if (mon) {
+ date = new Date(cal.date);
+ if (mon.month != date.getMonth()) {
+ date.setMonth(mon.month);
+ cal.setDate(date);
+ }
+ } else {
+ var year = Calendar.findYear(target);
+ if (year) {
+ date = new Date(cal.date);
+ if (year.year != date.getFullYear()) {
+ date.setFullYear(year.year);
+ cal.setDate(date);
+ }
+ }
+ }
+ with (Calendar) {
+ removeEvent(document, "mouseup", tableMouseUp);
+ removeEvent(document, "mouseover", tableMouseOver);
+ removeEvent(document, "mousemove", tableMouseOver);
+ cal._hideCombos();
+ stopEvent(ev);
+ _C = null;
+ }
+};
+
+Calendar.tableMouseOver = function (ev) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return;
+ }
+ var el = cal.activeDiv;
+ var target = Calendar.getTargetElement(ev);
+ if (target == el || target.parentNode == el) {
+ Calendar.addClass(el, "hilite active");
+ } else {
+ Calendar.removeClass(el, "active");
+ Calendar.removeClass(el, "hilite");
+ }
+ var mon = Calendar.findMonth(target);
+ if (mon) {
+ if (mon.month != cal.date.getMonth()) {
+ if (cal.hilitedMonth) {
+ Calendar.removeClass(cal.hilitedMonth, "hilite");
+ }
+ Calendar.addClass(mon, "hilite");
+ cal.hilitedMonth = mon;
+ } else if (cal.hilitedMonth) {
+ Calendar.removeClass(cal.hilitedMonth, "hilite");
+ }
+ } else {
+ var year = Calendar.findYear(target);
+ if (year) {
+ if (year.year != cal.date.getFullYear()) {
+ if (cal.hilitedYear) {
+ Calendar.removeClass(cal.hilitedYear, "hilite");
+ }
+ Calendar.addClass(year, "hilite");
+ cal.hilitedYear = year;
+ } else if (cal.hilitedYear) {
+ Calendar.removeClass(cal.hilitedYear, "hilite");
+ }
+ }
+ }
+ Calendar.stopEvent(ev);
+};
+
+Calendar.tableMouseDown = function (ev) {
+ if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {
+ Calendar.stopEvent(ev);
+ }
+};
+
+Calendar.calDragIt = function (ev) {
+ var cal = Calendar._C;
+ if (!(cal && cal.dragging)) {
+ return false;
+ }
+ var posX;
+ var posY;
+ if (Calendar.is_ie) {
+ posY = window.event.clientY + document.body.scrollTop;
+ posX = window.event.clientX + document.body.scrollLeft;
+ } else {
+ posX = ev.pageX;
+ posY = ev.pageY;
+ }
+ cal.hideShowCovered();
+ var st = cal.element.style;
+ st.left = (posX - cal.xOffs) + "px";
+ st.top = (posY - cal.yOffs) + "px";
+ Calendar.stopEvent(ev);
+};
+
+Calendar.calDragEnd = function (ev) {
+ var cal = Calendar._C;
+ if (!cal) {
+ return false;
+ }
+ cal.dragging = false;
+ with (Calendar) {
+ removeEvent(document, "mousemove", calDragIt);
+ removeEvent(document, "mouseover", stopEvent);
+ removeEvent(document, "mouseup", calDragEnd);
+ tableMouseUp(ev);
+ }
+ cal.hideShowCovered();
+};
+
+Calendar.dayMouseDown = function(ev) {
+ var el = Calendar.getElement(ev);
+ if (el.disabled) {
+ return false;
+ }
+ var cal = el.calendar;
+ cal.activeDiv = el;
+ Calendar._C = cal;
+ if (el.navtype != 300) with (Calendar) {
+ addClass(el, "hilite active");
+ addEvent(document, "mouseover", tableMouseOver);
+ addEvent(document, "mousemove", tableMouseOver);
+ addEvent(document, "mouseup", tableMouseUp);
+ } else if (cal.isPopup) {
+ cal._dragStart(ev);
+ }
+ Calendar.stopEvent(ev);
+ if (el.navtype == -1 || el.navtype == 1) {
+ cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250);
+ } else if (el.navtype == -2 || el.navtype == 2) {
+ cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250);
+ } else {
+ cal.timeout = null;
+ }
+};
+
+Calendar.dayMouseDblClick = function(ev) {
+ Calendar.cellClick(Calendar.getElement(ev));
+ if (Calendar.is_ie) {
+ document.selection.empty();
+ }
+};
+
+Calendar.dayMouseOver = function(ev) {
+ var el = Calendar.getElement(ev);
+ if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
+ return false;
+ }
+ if (el.ttip) {
+ if (el.ttip.substr(0, 1) == "_") {
+ var date = null;
+ with (el.calendar.date) {
+ date = new Date(getFullYear(), getMonth(), el.caldate);
+ }
+ el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
+ }
+ el.calendar.tooltips.firstChild.data = el.ttip;
+ }
+ if (el.navtype != 300) {
+ Calendar.addClass(el, "hilite");
+ }
+ Calendar.stopEvent(ev);
+};
+
+Calendar.dayMouseOut = function(ev) {
+ with (Calendar) {
+ var el = getElement(ev);
+ if (isRelated(el, ev) || _C || el.disabled) {
+ return false;
+ }
+ removeClass(el, "hilite");
+ el.calendar.tooltips.firstChild.data = _TT["SEL_DATE"];
+ stopEvent(ev);
+ }
+};
+
+/**
+ * A generic "click" handler :) handles all types of buttons defined in this
+ * calendar.
+ */
+Calendar.cellClick = function(el) {
+ var cal = el.calendar;
+ var closing = false;
+ var newdate = false;
+ var date = null;
+ if (typeof el.navtype == "undefined") {
+ Calendar.removeClass(cal.currentDateEl, "selected");
+ Calendar.addClass(el, "selected");
+ closing = (cal.currentDateEl == el);
+ if (!closing) {
+ cal.currentDateEl = el;
+ }
+ cal.date.setDate(el.caldate);
+ date = cal.date;
+ newdate = true;
+ } else {
+ if (el.navtype == 200) {
+ Calendar.removeClass(el, "hilite");
+ cal.callCloseHandler();
+ return;
+ }
+ date = (el.navtype == 0) ? new Date() : new Date(cal.date);
+ var year = date.getFullYear();
+ var mon = date.getMonth();
+ var setMonth = function (mon) {
+ var day = date.getDate();
+ var max = date.getMonthDays();
+ if (day > max) {
+ date.setDate(max);
+ }
+ date.setMonth(mon);
+ };
+ switch (el.navtype) {
+ case -2:
+ if (year > cal.minYear) {
+ date.setFullYear(year - 1);
+ }
+ break;
+ case -1:
+ if (mon > 0) {
+ setMonth(mon - 1);
+ } else if (year-- > cal.minYear) {
+ date.setFullYear(year);
+ setMonth(11);
+ }
+ break;
+ case 1:
+ if (mon < 11) {
+ setMonth(mon + 1);
+ } else if (year < cal.maxYear) {
+ date.setFullYear(year + 1);
+ setMonth(0);
+ }
+ break;
+ case 2:
+ if (year < cal.maxYear) {
+ date.setFullYear(year + 1);
+ }
+ break;
+ case 100:
+ cal.setMondayFirst(!cal.mondayFirst);
+ return;
+ }
+ if (!date.equalsTo(cal.date)) {
+ cal.setDate(date);
+ newdate = el.navtype == 0;
+ }
+ }
+ if (newdate) {
+ cal.callHandler();
+ }
+ if (closing) {
+ Calendar.removeClass(el, "hilite");
+ cal.callCloseHandler();
+ }
+};
+
+// END: CALENDAR STATIC FUNCTIONS
+
+// BEGIN: CALENDAR OBJECT FUNCTIONS
+
+/**
+ * This function creates the calendar inside the given parent. If _par is
+ * null than it creates a popup calendar inside the BODY element. If _par is
+ * an element, be it BODY, then it creates a non-popup calendar (still
+ * hidden). Some properties need to be set before calling this function.
+ */
+Calendar.prototype.create = function (_par) {
+ var parent = null;
+ if (! _par) {
+ // default parent is the document body, in which case we create
+ // a popup calendar.
+ parent = document.getElementsByTagName("body")[0];
+ this.isPopup = true;
+ } else {
+ parent = _par;
+ this.isPopup = false;
+ }
+ this.date = this.dateStr ? new Date(this.dateStr) : new Date();
+
+ var table = Calendar.createElement("table");
+ this.table = table;
+ table.cellSpacing = 0;
+ table.cellPadding = 0;
+ table.calendar = this;
+ Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);
+
+ var div = Calendar.createElement("div");
+ this.element = div;
+ div.className = "calendar";
+ if (this.isPopup) {
+ div.style.position = "absolute";
+ div.style.display = "none";
+ }
+ div.appendChild(table);
+
+ var thead = Calendar.createElement("thead", table);
+ var cell = null;
+ var row = null;
+
+ var cal = this;
+ var hh = function (text, cs, navtype) {
+ cell = Calendar.createElement("td", row);
+ cell.colSpan = cs;
+ cell.className = "button";
+ Calendar._add_evs(cell);
+ cell.calendar = cal;
+ cell.navtype = navtype;
+ if (text.substr(0, 1) != "&") {
+ cell.appendChild(document.createTextNode(text));
+ }
+ else {
+ // FIXME: dirty hack for entities
+ cell.innerHTML = text;
+ }
+ return cell;
+ };
+
+ row = Calendar.createElement("tr", thead);
+ row.className = "headrow";
+
+ hh("-", 1, 100).ttip = Calendar._TT["TOGGLE"];
+ this.title = hh("", this.isPopup ? 5 : 6, 300);
+ this.title.className = "title";
+ if (this.isPopup) {
+ this.title.ttip = Calendar._TT["DRAG_TO_MOVE"];
+ this.title.style.cursor = "move";
+ hh("X", 1, 200).ttip = Calendar._TT["CLOSE"];
+ }
+
+ row = Calendar.createElement("tr", thead);
+ row.className = "headrow";
+
+ hh("«", 1, -2).ttip = Calendar._TT["PREV_YEAR"];
+ hh("‹", 1, -1).ttip = Calendar._TT["PREV_MONTH"];
+ hh(Calendar._TT["TODAY"], 3, 0).ttip = Calendar._TT["GO_TODAY"];
+ hh("›", 1, 1).ttip = Calendar._TT["NEXT_MONTH"];
+ hh("»", 1, 2).ttip = Calendar._TT["NEXT_YEAR"];
+
+ // day names
+ row = Calendar.createElement("tr", thead);
+ row.className = "daynames";
+ this.daynames = row;
+ for (var i = 7; i > 0; --i) {
+ cell = Calendar.createElement("td", row);
+ cell.appendChild(document.createTextNode(""));
+ if (!i) {
+ cell.navtype = 100;
+ cell.calendar = this;
+ Calendar._add_evs(cell);
+ }
+ }
+ this._displayWeekdays();
+
+ var tbody = Calendar.createElement("tbody", table);
+ this.tbody = tbody;
+
+ for (i = 6; i > 0; --i) {
+ row = Calendar.createElement("tr", tbody);
+ for (var j = 7; j > 0; --j) {
+ cell = Calendar.createElement("td", row);
+ cell.appendChild(document.createTextNode(""));
+ cell.calendar = this;
+ Calendar._add_evs(cell);
+ }
+ }
+
+ var tfoot = Calendar.createElement("tfoot", table);
+
+ row = Calendar.createElement("tr", tfoot);
+ row.className = "footrow";
+
+ cell = hh(Calendar._TT["SEL_DATE"], 7, 300);
+ cell.className = "ttip";
+ if (this.isPopup) {
+ cell.ttip = Calendar._TT["DRAG_TO_MOVE"];
+ cell.style.cursor = "move";
+ }
+ this.tooltips = cell;
+
+ div = Calendar.createElement("div", this.element);
+ this.monthsCombo = div;
+ div.className = "combo";
+ for (i = 0; i < Calendar._MN.length; ++i) {
+ var mn = Calendar.createElement("div");
+ mn.className = "label";
+ mn.month = i;
+ mn.appendChild(document.createTextNode(Calendar._MN3[i]));
+ div.appendChild(mn);
+ }
+
+ div = Calendar.createElement("div", this.element);
+ this.yearsCombo = div;
+ div.className = "combo";
+ for (i = 12; i > 0; --i) {
+ var yr = Calendar.createElement("div");
+ yr.className = "label";
+ yr.appendChild(document.createTextNode(""));
+ div.appendChild(yr);
+ }
+
+ this._init(this.mondayFirst, this.date);
+ parent.appendChild(this.element);
+};
+
+/**
+ * (RE)Initializes the calendar to the given date and style (if mondayFirst is
+ * true it makes Monday the first day of week, otherwise the weeks start on
+ * Sunday.
+ */
+Calendar.prototype._init = function (mondayFirst, date) {
+ var today = new Date();
+ var year = date.getFullYear();
+ if (year < this.minYear) {
+ year = this.minYear;
+ date.setFullYear(year);
+ } else if (year > this.maxYear) {
+ year = this.maxYear;
+ date.setFullYear(year);
+ }
+ this.mondayFirst = mondayFirst;
+ this.date = new Date(date);
+ var month = date.getMonth();
+ var mday = date.getDate();
+ var no_days = date.getMonthDays();
+ date.setDate(1);
+ var wday = date.getDay();
+ var MON = mondayFirst ? 1 : 0;
+ var SAT = mondayFirst ? 5 : 6;
+ var SUN = mondayFirst ? 6 : 0;
+ if (mondayFirst) {
+ wday = (wday > 0) ? (wday - 1) : 6;
+ }
+ var iday = 1;
+ var row = this.tbody.firstChild;
+ var MN = Calendar._MN3[month];
+ var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month));
+ var todayDate = today.getDate();
+ for (var i = 0; i < 6; ++i) {
+ if (iday > no_days) {
+ row.className = "emptyrow";
+ row = row.nextSibling;
+ continue;
+ }
+ var cell = row.firstChild;
+ row.className = "daysrow";
+ for (var j = 0; j < 7; ++j) {
+ if ((!i && j < wday) || iday > no_days) {
+ cell.className = "emptycell";
+ cell = cell.nextSibling;
+ continue;
+ }
+ cell.firstChild.data = iday;
+ cell.className = "day";
+ cell.disabled = false;
+ if (typeof this.checkDisabled == "function") {
+ date.setDate(iday);
+ if (this.checkDisabled(date)) {
+ cell.className += " disabled";
+ cell.disabled = true;
+ }
+ }
+ if (!cell.disabled) {
+ cell.caldate = iday;
+ cell.ttip = "_";
+ if (iday == mday) {
+ cell.className += " selected";
+ this.currentDateEl = cell;
+ }
+ if (hasToday && (iday == todayDate)) {
+ cell.className += " today";
+ cell.ttip += Calendar._TT["PART_TODAY"];
+ }
+ if (wday == SAT || wday == SUN) {
+ cell.className += " weekend";
+ }
+ }
+ ++iday;
+ ((++wday) ^ 7) || (wday = 0);
+ cell = cell.nextSibling;
+ }
+ row = row.nextSibling;
+ }
+ this.title.firstChild.data = Calendar._MN[month] + ", " + year;
+ // PROFILE
+ // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms";
+};
+
+/**
+ * Calls _init function above for going to a certain date (but only if the
+ * date is different than the currently selected one).
+ */
+Calendar.prototype.setDate = function (date) {
+ if (!date.equalsTo(this.date)) {
+ this._init(this.mondayFirst, date);
+ }
+};
+
+/** Modifies the "mondayFirst" parameter (EU/US style). */
+Calendar.prototype.setMondayFirst = function (mondayFirst) {
+ this._init(mondayFirst, this.date);
+ this._displayWeekdays();
+};
+
+/**
+ * Allows customization of what dates are enabled. The "unaryFunction"
+ * parameter must be a function object that receives the date (as a JS Date
+ * object) and returns a boolean value. If the returned value is true then
+ * the passed date will be marked as disabled.
+ */
+Calendar.prototype.setDisabledHandler = function (unaryFunction) {
+ this.checkDisabled = unaryFunction;
+};
+
+/** Customization of allowed year range for the calendar. */
+Calendar.prototype.setRange = function (a, z) {
+ this.minYear = a;
+ this.maxYear = z;
+};
+
+/** Calls the first user handler (selectedHandler). */
+Calendar.prototype.callHandler = function () {
+ if (this.onSelected) {
+ this.onSelected(this, this.date.print(this.dateFormat));
+ }
+};
+
+/** Calls the second user handler (closeHandler). */
+Calendar.prototype.callCloseHandler = function () {
+ if (this.onClose) {
+ this.onClose(this);
+ }
+ this.hideShowCovered();
+};
+
+/** Removes the calendar object from the DOM tree and destroys it. */
+Calendar.prototype.destroy = function () {
+ var el = this.element.parentNode;
+ el.removeChild(this.element);
+ Calendar._C = null;
+ delete el;
+};
+
+/**
+ * Moves the calendar element to a different section in the DOM tree (changes
+ * its parent).
+ */
+Calendar.prototype.reparent = function (new_parent) {
+ var el = this.element;
+ el.parentNode.removeChild(el);
+ new_parent.appendChild(el);
+};
+
+/** Shows the calendar. */
+Calendar.prototype.show = function () {
+ this.element.style.display = "block";
+ this.hideShowCovered();
+};
+
+/**
+ * Hides the calendar. Also removes any "hilite" from the class of any TD
+ * element.
+ */
+Calendar.prototype.hide = function () {
+ var trs = this.table.getElementsByTagName("td");
+ for (var i = trs.length; i > 0; ) {
+ Calendar.removeClass(trs[--i], "hilite");
+ }
+ this.element.style.display = "none";
+};
+
+/**
+ * Shows the calendar at a given absolute position (beware that, depending on
+ * the calendar element style -- position property -- this might be relative
+ * to the parent's containing rectangle).
+ */
+Calendar.prototype.showAt = function (x, y) {
+ var s = this.element.style;
+ s.left = x + "px";
+ s.top = y + "px";
+ this.show();
+};
+
+/** Shows the calendar near a given element. */
+Calendar.prototype.showAtElement = function (el) {
+ var p = Calendar.getAbsolutePos(el);
+
+ var cw = 190;
+ var ch = -200;
+
+ if (Calendar.is_ie)
+ {
+ var posX = getWndX(el) + el.offsetWidth + 18; if (posX + ch > document.body.scrollLeft + document.body.offsetWidth) posX = document.body.scrollLeft + document.body.offsetWidth - ch
+ var posY = p.y + el.offsetHeight; if (posY + cw > document.body.scrollTop + document.body.offsetHeight) posY = getWndY(el) - cw;
+ //document.body.scrollTop + document.body.offsetHeight - cw - el.offsetHeight
+ this.showAt(posX, posY);
+ }
+ else
+ {
+ // for other browsers types
+ this.showAt(getWndX(el) + el.offsetWidth + 30, p.y + el.offsetHeight-200);
+ }
+};
+
+function getWndC(object, c)
+{
+ pos = 0;
+ while (object != null)
+ {
+ pos += (c == "y") ? object.offsetTop : object.offsetLeft;
+ object = object.offsetParent;
+ }
+ return pos;
+}
+
+function getWndX(object) {return getWndC(object, "x")}
+function getWndY(object) {return getWndC(object, "y")}
+
+
+/** Customizes the date format. */
+Calendar.prototype.setDateFormat = function (str) {
+ this.dateFormat = str;
+};
+
+/** Customizes the tooltip date format. */
+Calendar.prototype.setTtDateFormat = function (str) {
+ this.ttDateFormat = str;
+};
+
+/**
+ * Tries to identify the date represented in a string. If successful it also
+ * calls this.setDate which moves the calendar to the given date.
+ */
+Calendar.prototype.parseDate = function (str, fmt) {
+ var y = 0;
+ var m = -1;
+ var d = 0;
+ var a = str.split(/\W+/);
+ if (!fmt) {
+ fmt = this.dateFormat;
+ }
+ var b = fmt.split(/\W+/);
+ var i = 0, j = 0;
+ for (i = 0; i < a.length; ++i) {
+ if (b[i] == "D" || b[i] == "DD") {
+ continue;
+ }
+ if (b[i] == "j" || b[i] == "d") {
+ d = a[i];
+ }
+ if (b[i] == "n" || b[i] == "m") {
+ m = a[i]-1;
+ }
+// if (b[i] == "y") {
+// y = a[i];
+// }
+ if ((b[i] == "Y")||(b[i] == "y")) {
+// if (b[i] == "yy") {
+ if (a[i].length == 4) {
+ y = a[i];
+ }
+ else {
+ if (parseInt(a[i]) < 70) {
+ y = parseInt(a[i]) + 2000;
+ }
+ else {
+ y = parseInt(a[i]) + 1900;
+ }
+ }
+ }
+ if (b[i] == "M" || b[i] == "MM") {
+ for (j = 0; j < 12; ++j) {
+ if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
+ }
+ }
+ }
+ if (y != 0 && m != -1 && d != 0) {
+ this.setDate(new Date(y, m, d));
+ return;
+ }
+ y = 0; m = -1; d = 0;
+ for (i = 0; i < a.length; ++i) {
+ if (a[i].search(/[a-zA-Z]+/) != -1) {
+ var t = -1;
+ for (j = 0; j < 12; ++j) {
+ if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
+ }
+ if (t != -1) {
+ if (m != -1) {
+ d = m+1;
+ }
+ m = t;
+ }
+ } else if (parseInt(a[i]) <= 12 && m == -1) {
+ m = a[i]-1;
+ } else if (parseInt(a[i]) > 31 && y == 0) {
+ y = a[i];
+ } else if (d == 0) {
+ d = a[i];
+ }
+ }
+ if (y == 0) {
+ var today = new Date();
+ y = today.getFullYear();
+ }
+ if (m != -1 && d != 0) {
+ this.setDate(new Date(y, m, d));
+ }
+};
+
+Calendar.prototype.hideShowCovered = function () {
+ var tags = new Array("applet", "iframe", "select");
+ var el = this.element;
+
+ var p = Calendar.getAbsolutePos(el);
+ var EX1 = p.x;
+ var EX2 = el.offsetWidth + EX1;
+ var EY1 = p.y;
+ var EY2 = el.offsetHeight + EY1;
+
+ for (var k = tags.length; k > 0; ) {
+ var ar = document.getElementsByTagName(tags[--k]);
+ var cc = null;
+
+ for (var i = ar.length; i > 0;) {
+ cc = ar[--i];
+
+ p = Calendar.getAbsolutePos(cc);
+ var CX1 = p.x;
+ var CX2 = cc.offsetWidth + CX1;
+ var CY1 = p.y;
+ var CY2 = cc.offsetHeight + CY1;
+
+ if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
+ cc.style.visibility = "visible";
+ } else {
+ cc.style.visibility = "hidden";
+ }
+ }
+ }
+};
+
+/** Internal function; it displays the bar with the names of the weekday. */
+Calendar.prototype._displayWeekdays = function () {
+ var MON = this.mondayFirst ? 0 : 1;
+ var SUN = this.mondayFirst ? 6 : 0;
+ var SAT = this.mondayFirst ? 5 : 6;
+ var cell = this.daynames.firstChild;
+ for (var i = 0; i < 7; ++i) {
+ cell.className = "day name";
+ if (!i) {
+ cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"];
+ cell.navtype = 100;
+ cell.calendar = this;
+ Calendar._add_evs(cell);
+ }
+ if (i == SUN || i == SAT) {
+ Calendar.addClass(cell, "weekend");
+ }
+ cell.firstChild.data = Calendar._DN3[i + 1 - MON];
+ cell = cell.nextSibling;
+ }
+};
+
+/** Internal function. Hides all combo boxes that might be displayed. */
+Calendar.prototype._hideCombos = function () {
+ this.monthsCombo.style.display = "none";
+ this.yearsCombo.style.display = "none";
+};
+
+/** Internal function. Starts dragging the element. */
+Calendar.prototype._dragStart = function (ev) {
+ if (this.dragging) {
+ return;
+ }
+ this.dragging = true;
+ var posX;
+ var posY;
+ if (Calendar.is_ie) {
+ posY = window.event.clientY + document.body.scrollTop;
+ posX = window.event.clientX + document.body.scrollLeft;
+ } else {
+ posY = ev.clientY + window.scrollY;
+ posX = ev.clientX + window.scrollX;
+ }
+ var st = this.element.style;
+ this.xOffs = posX - parseInt(st.left);
+ this.yOffs = posY - parseInt(st.top);
+ with (Calendar) {
+ addEvent(document, "mousemove", calDragIt);
+ addEvent(document, "mouseover", stopEvent);
+ addEvent(document, "mouseup", calDragEnd);
+ }
+};
+
+// BEGIN: DATE OBJECT PATCHES
+
+/** Adds the number of days array to the Date object. */
+Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
+
+/** Returns the number of days in the current month */
+Date.prototype.getMonthDays = function() {
+ var year = this.getFullYear();
+ var month = this.getMonth();
+ if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
+ return 29;
+ } else {
+ return Date._MD[month];
+ }
+};
+
+/** Checks dates equality (ignores time) */
+Date.prototype.equalsTo = function(date) {
+ return ((this.getFullYear() == date.getFullYear()) &&
+ (this.getMonth() == date.getMonth()) &&
+ (this.getDate() == date.getDate()));
+};
+
+/** Prints the date in a string according to the given format. */
+Date.prototype.print = function (frm) {
+ var str = new String(frm);
+ var m = this.getMonth();
+ var d = this.getDate();
+ var y = this.getFullYear();
+ var w = this.getDay();
+ var s = new Array();
+ s["j"] = d;
+ s["d"] = (d < 10) ? ("0" + d) : d;
+ s["n"] = 1+m;
+ s["m"] = (m < 9) ? ("0" + (1+m)) : (1+m);
+ s["Y"] = y;
+ s["y"] = new String(y).substr(2, 2);
+ with (Calendar) {
+ s["D"] = _DN3[w];
+ s["DD"] = _DN[w];
+ s["M"] = _MN3[m];
+ s["MM"] = _MN[m];
+ }
+ var re = /(.*)(\W|^)(j|d|n|m|y|Y|MM|M|DD|D)(\W|$)(.*)/;
+ while (re.exec(str) != null) {
+ str = RegExp.$1 + RegExp.$2 + s[RegExp.$3] + RegExp.$4 + RegExp.$5;
+ }
+ return str;
+};
+
+// END: DATE OBJECT PATCHES
+/**/
+/**/
+Calendar._DN = new Array
+("Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday");
+Calendar._MN = new Array
+("January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "Toggle first day of week";
+Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
+Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
+Calendar._TT["GO_TODAY"] = "Go Today";
+Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
+Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
+Calendar._TT["SEL_DATE"] = "Select date";
+Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
+Calendar._TT["PART_TODAY"] = " (today)";
+Calendar._TT["MON_FIRST"] = "Display Monday first";
+Calendar._TT["SUN_FIRST"] = "Display Sunday first";
+Calendar._TT["CLOSE"] = "Close";
+Calendar._TT["TODAY"] = "Today";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
+Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
+/**/
+/**/
+document.write("")
+/* The main calendar widget. DIV containing a table. */
+
Index: trunk/kernel/admin_templates/img/old/icon_select_all.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/email_messages/email_messages_event_handler.php
===================================================================
diff -u
--- trunk/core/units/email_messages/email_messages_event_handler.php (revision 0)
+++ trunk/core/units/email_messages/email_messages_event_handler.php (revision 1566)
@@ -0,0 +1,138 @@
+getEmailEventId();
+ $object =& $event->getObject();
+
+ $parent_info = $object->getLinkedInfo();
+
+ $sql = 'SELECT '.$object->IDField.' FROM '.$object->TableName.' WHERE ('.$parent_info['ForeignKey'].' = '.$parent_info['ParentId'].') AND (EventId = '.$email_event_id.')';
+
+ $id = (int)$this->Conn->GetOne($sql);
+ if(!$id)
+ {
+ $object->SetDBField('EventId', $email_event_id);
+ $object->SetDBField('Headers', $this->Application->ConfigValue('Smtp_DefaultHeaders') );
+ }
+ return $id;
+ }
+
+ function getEmailEventId()
+ {
+ return parent::getPassedID( new kEvent('emailevents:OnDummy') );
+ }
+
+ /**
+ * If loading empty item, then set parent id
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemLoad(&$event)
+ {
+ if( !$event->getEventParam('id') )
+ {
+ $this->OnNew($event);
+ $event->status = erFATAL;
+ }
+ }
+
+
+ /**
+ * Parse message template (split into header, subject & body)
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+
+ $lines = explode("\n", $object->GetDBField('Template') );
+
+ $headers = Array();
+
+ foreach($lines as $line)
+ {
+ if( strlen(trim($line)) == 0 || ($line == '.') ) break;
+
+ $parts = explode(':', $line, 2);
+ if(strtolower($parts[0]) == 'subject')
+ {
+ $object->SetDBField('Subject', trim($parts[1]) );
+ }
+ else
+ {
+ $headers[] = $line;
+ }
+ }
+ $object->SetDBField('Headers', implode("\n", $headers) );
+
+ $message_body = '';
+ while( (list($line_id,$line) = each($lines)) )
+ {
+ $message_body .= $line;
+ }
+ $object->SetDBField('Body', $message_body);
+ }
+
+ /**
+ * Merge body+subject+headers into message template
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $this->parseVirtualFields($event);
+ }
+
+ /**
+ * Merge body+subject+headers into message template
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $this->parseVirtualFields($event);
+ }
+
+ /**
+ * Merge body+subject+headers into message template
+ *
+ * @param kEvent $event
+ */
+ function parseVirtualFields(&$event)
+ {
+ $object =& $event->getObject();
+ if( $object->GetDBField('Headers') || $object->GetDBField('Subject') || $object->GetDBField('Body') )
+ {
+ $ret = $object->GetDBField('Headers');
+ if($ret) $ret .= "\n";
+
+ $ret = $this->removeTrailingCRLF($ret);
+ $ret .= 'Subject: '.$object->GetDBField('Subject')."\n\n";
+ $ret .= $object->GetDBField('Body');
+ $object->SetDBField('Template', $ret);
+ }
+ }
+
+ /**
+ * Remove trailing CR/LF chars from string
+ *
+ * @param string $string
+ * @return string
+ */
+ function removeTrailingCRLF($string)
+ {
+ return preg_replace('/(\n|\r)+/',"\\1",$string);
+ }
+ }
+
+?>
\ No newline at end of file
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/general/inp_db_event_handler.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/toolbar/tool_modify_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/header.tpl
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/header.tpl (revision 0)
+++ trunk/kernel/admin_templates/incs/header.tpl (revision 1566)
@@ -0,0 +1,49 @@
+
+
+
+In-Commerce
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Set("section",$section);
+ $objListToolBar->Set("load_menu_func","");
+ $objListToolBar->Set("CheckClass","");
+
+ $listImages = array();
+ //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
+
+ $objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');",
+ "swap('select', 'toolbar/tool_select.gif');",
+ "document.frm.submit();","tool_select.gif");
+
+ $objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');",
+ "swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
+
+ $title = "Online HTML Editor";
+
+ $objSections->SetCurrentSection($section);
+ print $objSections->section_header($envar,NULL,$title);
+ $TargetForm = $_GET["TargetForm"];
+ $TargetField = $_GET["TargetField"];
+ echo $objListToolBar->Build();
+?>
+
+ |
+
+
+
+
+
+
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/general/cat_dbitem.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/icons/icon46_list_currencies.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_image_f2.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/kernel/units/general/my_application.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/kernel/admin_templates/img/toolbar/tool_homecat_f2.gif
===================================================================
diff -u
Binary files differ
Fisheye: Tag 1558 refers to a dead (removed) revision in file `trunk/core/units/general/cat_dblist.php'.
Fisheye: No comparison available. Pass `N' to diff?
Index: trunk/themes/default/img/menu_bg.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_tool_export.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_edit_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/selectors/selectors_tag_processor.php
===================================================================
diff -u
--- trunk/kernel/units/selectors/selectors_tag_processor.php (revision 0)
+++ trunk/kernel/units/selectors/selectors_tag_processor.php (revision 1566)
@@ -0,0 +1,89 @@
+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
+ * event processing)
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function InputName($params)
+ {
+ $ret = parent::InputName($params);
+ $subfield = getArrayValue($params,'subfield');
+ if($subfield && $subfield != '$subfield')
+ {
+ $ret .= '['.$subfield.']';
+ }
+ return $ret;
+ }
+
+ function Field($params)
+ {
+ $subfield = getArrayValue($params,'subfield');
+ if($subfield && $subfield != '$subfield')
+ {
+ $params['no_special'] = 'no_special';
+ }
+ $ret = parent::Field($params);
+ if($subfield && $subfield != '$subfield')
+ {
+ $ret = getArrayValue($ret,$subfield);
+ return $ret !== false ? $ret : '';
+ }
+ return $ret;
+ }
+
+ function PredefinedOptions($params)
+ {
+ $field = $params['field'];
+ $object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix, $params);
+
+ $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'];
+ $block_params['field'] = $params['field'];
+ $block_params['pass_params'] = 'true';
+
+ $selected_param_name = $params['selected_param'];
+ if (!$selected_param_name) $selected_param_name = $params['selected'];
+ $selected = $params['selected'];
+
+ $o = '';
+ foreach ($options['options'] as $key => $val) {
+ $block_params['key'] = $key;
+ $block_params['option'] = $val;
+ $block_params['field_name'] = $this->InputName($params);
+ $block_params[$selected_param_name] = ( $key == $value ? ' '.$selected : '');
+ $block_params['PrefixSpecial'] = $this->getPrefixSpecial();
+ $o .= $this->Application->ParseBlock($block_params, 1);
+ }
+
+ return $o;
+ }
+
+ }
+
+?>
\ No newline at end of file
Index: trunk/themes/default/img/cube.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_listing.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_products.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_conf_themes.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_theme.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_settings_in-newz.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_move_up_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_tool_restore.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/menu_paste.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/fw_menu.js
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/fw_menu.js (revision 0)
+++ trunk/kernel/admin_templates/incs/fw_menu.js (revision 1566)
@@ -0,0 +1,745 @@
+/**
+ * fw_menu 24OCT2000 Version 4.0
+ * John Ahlquist, October 2000
+ * Copyright (c) 2000 Macromedia, Inc.
+ *
+ * based on menu.js
+ * by gary smith, July 1997
+ * Copyright (c) 1997-1999 Netscape Communications Corp.
+ *
+ * Netscape grants you a royalty free license to use or modify this
+ * software provided that this copyright notice appears on all copies.
+ * This software is provided "AS IS," without a warranty of any kind.
+ *
+ * Modified By Intechnic Corporation for use in In-Portal
+ * 6/28/02
+ *
+ */
+function Menu(label) {
+ this.version = "990702 [xMenu; fw_menu.js]";
+ this.type = "Menu";
+ this.menuWidth = 0;
+ this.menuItemHeight = 0;
+ this.fontSize = 11;
+ this.fontWeight = "normal";
+ this.fontFamily = "helvetica, arial, verdana, helvetica";
+ this.fontColor = "#000000";
+ this.fontColorHilite = "#000000";
+ this.bgColor = "#555555";
+ this.menuBorder = 1;
+ this.menuItemBorder = 0;
+ this.menuItemBgColor = "#f0f1eb";
+ this.menuLiteBgColor = "#ffffff";
+ this.menuBorderBgColor = "#777777";
+ this.menuHiliteBgColor = "#e0e0da";
+ this.menuContainerBgColor = "#cccccc";
+ this.imagePath = (typeof(activeTab) != 'undefined') ? 'images/' : 'img/';
+ this.childMenuIcon = "menu_arrow.gif";
+ this.items = new Array();
+ this.actions = new Array();
+ this.types = new Array(); //for check/radio type to show pics
+ this.childMenus = new Array();
+
+ this.hideOnMouseOut = true;
+
+ this.addMenuItem = addMenuItem;
+ this.addMenuSeparator = addMenuSeparator;
+ this.writeMenus = writeMenus;
+ this.FW_showMenu = FW_showMenu;
+ this.onMenuItemOver = onMenuItemOver;
+ this.onMenuItemAction = onMenuItemAction;
+ this.hideMenu = hideMenu;
+ this.hideChildMenu = hideChildMenu;
+
+ label = RemoveTranslationLink(label);
+ if (!window.menus) window.menus = new Array();
+ this.label = label || "menuLabel" + window.menus.length;
+ window.menus[this.label] = this;
+ window.menus[window.menus.length] = this;
+ if (!window.activeMenus) window.activeMenus = new Array();
+}
+
+function addMenuItem(label, action, type)
+{
+ if( typeof(label) == 'string' ) label = RemoveTranslationLink(label);
+ if( isset(type) ) type = parseInt(type);
+ this.items[this.items.length] = label;
+ this.actions[this.actions.length] = action;
+ switch(type)
+ {
+ case 1:
+ this.types[this.types.length] = this.imagePath+'check_on.gif';
+ break;
+ case 2:
+ this.types[this.types.length] = this.imagePath+'menu_dot.gif';
+ break;
+ default:
+ this.types[this.types.length] = '';
+ }
+}
+
+function addMenuSeparator() {
+ this.items[this.items.length] = "separator";
+ this.actions[this.actions.length] = "";
+ this.types[this.types.length] = "";
+ this.menuItemBorder = 0;
+}
+
+// For NS6.
+function FIND(item,called_from)
+{
+ if (document.all) return(document.all[item]);
+ if (document.getElementById) return(document.getElementById(item));
+ return(false);
+}
+
+function writeMenus(container_id) {
+
+ if (window.triedToWriteMenus) return;
+ var container = null;
+
+ if (!container_id && document.layers) {
+ window.delayWriteMenus = this.writeMenus;
+ var timer = setTimeout('delayWriteMenus()', 100);
+ container = new Layer(100);
+ clearTimeout(timer);
+ } else if (document.all || document.hasChildNodes) {
+ if( !isset(container_id) ) container_id = 'menuContainer';
+ container = FIND(container_id);
+ if (!container)
+ {
+ container = document.createElement('SPAN');
+ container.id = container_id;
+ document.body.appendChild(container);
+ container = FIND(container_id);
+ }
+ else
+ {
+ container.innerHTML = '';
+ }
+ }
+
+ window.fwHideMenuTimer = null;
+ if (!container) return; window.triedToWriteMenus = true;
+ container.isContainer = true;
+ container.menus = new Array();
+
+ for (var i=0; i>
+
+
+
+
+Reload frame || Show debugger
+
\ No newline at end of file
Index: trunk/core/units/modules/modules_config.php
===================================================================
diff -u
--- trunk/core/units/modules/modules_config.php (revision 0)
+++ trunk/core/units/modules/modules_config.php (revision 1566)
@@ -0,0 +1,41 @@
+ 'mod',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ModulesEventHandler','file'=>'modules_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'Name',
+ 'TitleField' => 'Name', // field, used in bluebar when editing existing item
+ 'TableName' => TABLE_PREFIX.'Modules',
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(),
+ 'Fields' => Array(
+ 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Loaded' => Array('type' => 'int','not_null' => '1','default' => '1'),
+ 'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'BuildDate' => Array('type' => 'double','not_null' => '1','default' => '0'),
+ ),
+ 'VirtualFields' => Array(),
+
+ 'Grids' => Array(),
+ );
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_manufacturer.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_user_settings.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/in-link/icon16_valid.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/logo.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/footer.tpl
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/footer.tpl (revision 0)
+++ trunk/kernel/admin_templates/incs/footer.tpl (revision 1566)
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/toolbar/tool_update_rates.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/themes/themes_config.php
===================================================================
diff -u
--- trunk/core/units/themes/themes_config.php (revision 0)
+++ trunk/core/units/themes/themes_config.php (revision 1566)
@@ -0,0 +1,78 @@
+ 'theme',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'InpDBEventHandler','file'=>'','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ThemesTagProcessor','file'=>'themes_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'Hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+ 'IDField' => 'ThemeId',
+
+ 'StatusField' => Array('Enabled','Primary'),
+
+ 'TitleField' => 'Name',
+
+ 'TableName' => TABLE_PREFIX.'Theme',
+ 'SubItems' => Array('themefiles'),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array(0,1), 'type' => WHERE_FILTER),
+ ),
+
+ 'Filters' => Array(
+ 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
+ 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
+ )
+ ),
+
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.*, style.LastCompiled, style.Name AS StyleName
+ FROM %s
+ LEFT JOIN '.TABLE_PREFIX.'Stylesheets style ON style.StylesheetId = %1$s.StylesheetId',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('Name' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'ThemeId' => Array(),
+ 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1=>'la_Enabled', 0=>'la_Disabled'), 'use_phrases'=>1, 'not_null' => '1','default' => '1'),
+ 'Description' => Array('type' => 'string','default' => ''),
+ 'PrimaryTheme' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'CacheTimeout' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'StylesheetId' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ ),
+
+ 'VirtualFields' => Array(
+ 'LastCompiled' => Array('type'=>'int', 'formatter'=>'kDateFormatter' ),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif',0=>'icon16_style_disabled.gif',1=>'icon16_style.gif'),
+ 'Fields' => Array(
+ 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td'),
+ 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td' ),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/menu_bar.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default/img/act_addtocart.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_list_orders.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/old/sort_asc.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_primary_theme.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_selector_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_language_var_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/icons/icon46_banlist.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_cut_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/toolbar/tool_new_style.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/units/translator/translator_event_handler.php
===================================================================
diff -u
--- trunk/core/units/translator/translator_event_handler.php (revision 0)
+++ trunk/core/units/translator/translator_event_handler.php (revision 1566)
@@ -0,0 +1,83 @@
+Application->GetVar($event->getPrefixSpecial(true).'_prefix');
+ $object = $this->Application->recallObject($obj_prefix);
+
+ /*$items_info = $this->Application->GetVar( $obj_prefix );
+ if($items_info) $field_values = array_shift($items_info);
+ $object->SetFieldsFromHash($field_values);
+ $object->Update();*/
+
+ $field = $this->Application->GetVar($event->getPrefixSpecial(true).'_field');
+
+ $translator =& $this->Application->recallObject($event->getPrefixSpecial());
+
+ $def_lang = $this->Application->GetDefaultLanguageId();
+
+ $current_lang = $translator->GetDBField('Language');
+ if (!$current_lang) $current_lang = $this->Application->RecallVar('trans_lang');
+ if (!$current_lang) $current_lang = $this->Application->GetVar('m_lang');
+ /*if ($current_lang == $def_lang) {
+ $current_lang = $def_lang + 1;
+ }*/
+ $this->Application->StoreVar('trans_lang', $current_lang); //remember translation language for user friendlyness
+
+
+ $translator->SetId(1);
+ $translator->SetDBField('Original', $object->GetDBField('l'.$this->Application->GetVar('m_lang').'_'.$field));
+ $translator->SetDBField('Language', $current_lang);
+ $translator->SetDBField('SwitchLanguage', $current_lang);
+
+ $translator->SetDBField('Translation', $object->GetDBField('l'.$current_lang.'_'.$field));
+
+ $cur_lang = $this->Application->recallObject('lang.current');
+ $cur_lang->Load($current_lang);
+
+ $translator->SetDBField('Charset', $cur_lang->GetDBField('Charset'));
+
+ $event->redirect = false;
+ }
+
+ function OnSaveAndClose(&$event)
+ {
+ $event->CallSubEvent('OnPreSave');
+ $this->finalizePopup($event, '', 'in-commerce/products/products_edit');
+ }
+
+ function OnPreSave(&$event)
+ {
+ $translator =& $this->Application->recallObject($event->getPrefixSpecial());
+
+ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
+ if($items_info) $field_values = array_shift($items_info);
+
+ $translator->SetFieldsFromHash($field_values);
+
+ $object = $this->Application->recallObject($this->Application->GetVar($event->getPrefixSpecial(true).'_prefix'));
+ $field = $this->Application->GetVar($event->getPrefixSpecial(true).'_field');
+
+ $lang = $translator->GetDBField('Language');
+ $object->Fields['l'.$lang.'_'.$field] = Array();
+ $object->SetDBField('l'.$lang.'_'.$field, $translator->GetDBField('Translation'));
+ $this->RemoveRequiredFields($object);
+ $object->Update();
+ }
+
+ function OnChangeLanguage(&$event)
+ {
+ $event->CallSubEvent('OnPreSave');
+ $translator =& $this->Application->recallObject($event->getPrefixSpecial());
+ $translator->SetDBField('Language', $translator->GetDBField('SwitchLanguage'));
+ $event->CallSubEvent('OnLoad');
+ $event->redirect = false;
+ }
+
+ }
+
+
+?>
\ No newline at end of file
Index: trunk/admin/editor/editor_new.php
===================================================================
diff -u
--- trunk/admin/editor/editor_new.php (revision 0)
+++ trunk/admin/editor/editor_new.php (revision 1566)
@@ -0,0 +1,208 @@
+Get("Site_Path");
+$admin = $objConfig->Get("AdminDirectory");
+if(!strlen($admin))
+ $admin = "admin";
+$adminURL = $rootURL.$admin;
+$imagesURL = $adminURL."/images";
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+require_once($pathtoroot.$admin."/editor/cmseditor/fckeditor.php");
+
+$style_sheet_global = $adminURL."/include/style.css";
+?>
+
+
+
Online Editor
+ \n"; ?>
+
+
+
+