Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1167706
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 24, 12:16 AM
Size
56 KB
Mime Type
text/x-diff
Expires
Fri, Sep 26, 12:16 AM (1 d, 14 h)
Engine
blob
Format
Raw Data
Handle
755093
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.16.2/kernel/units/languages/languages_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/kernel/units/languages/languages_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/kernel/units/languages/languages_config.php (revision 6106)
@@ -0,0 +1,168 @@
+<?php
+
+$config = Array(
+ 'Prefix' => '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',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnUpdatePrimary',
+ ),
+ ),
+ '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#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:configure_lang'),
+
+ 'Sections' => Array(
+ 'in-portal:configure_lang' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_regional',
+ 'label' => 'la_tab_Regional',
+ 'url' => Array('t' => 'regional/languages_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:set_primary', 'advanced:import', 'advanced:export'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ '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),
+ 'InputDateFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('m/d/Y' => 'm/d/Y'), 'not_null' => '1','default' => 'm/d/Y', 'required' => 1),
+ 'InputTimeFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('g:i:s A' => 'g:i:s A'), 'not_null' => '1','default' => 'g:i:s A', '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),
+ 'UnitSystem' => Array('type' => 'int','not_null' => '1','default' => '1','formatter' => 'kOptionsFormatter','options' => Array(1 => 'la_Metric', 2 => 'la_US_UK'),'use_phrases' => 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
Property changes on: branches/unlabeled/unlabeled-1.16.2/kernel/units/languages/languages_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.16.2/kernel/units/configuration/configuration_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/kernel/units/configuration/configuration_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/kernel/units/configuration/configuration_event_handler.php (revision 6106)
@@ -0,0 +1,191 @@
+<?php
+
+ class ConfigurationEventHandler extends InpDBEventHandler {
+
+
+ /**
+ * Changes permission section to one from REQUEST, not from config
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $event->setEventParam('PermSection', $this->Application->GetVar('section'));
+ return parent::CheckPermission($event);
+ }
+
+
+ /**
+ * Apply any custom changes to list's sql query
+ *
+ * @param kEvent $event
+ * @access protected
+ * @see OnListBuild
+ */
+ function SetCustomQuery(&$event)
+ {
+ $object =& $event->getObject();
+
+ $module = $this->Application->GetVar('module');
+ $section = $this->Application->GetVar('section');
+
+ $object->addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module));
+ $object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section));
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+
+ // if password field is empty, then don't update
+ if ($object->GetDBField('element_type') == 'password') {
+ if (trim($object->GetDBField('VariableValue')) == '') {
+ $field_options = $object->GetFieldOptions('VariableValue');
+ $field_options['skip_empty'] = 1;
+ $object->SetFieldOptions('VariableValue', $field_options);
+ }else {
+ $object->SetDBField('VariableValue', md5($object->GetDBField('VariableValue')));
+ }
+ }
+
+ $field_values = $this->Application->GetVar($event->getPrefixSpecial(true));
+
+ $state_country_hash = Array(
+ 'Comm_State' => 'Comm_Country',
+ 'Comm_Shipping_State' => 'Comm_Shipping_Country'
+ );
+
+ $field_name = $object->GetDBField('VariableName');
+ if (isset($state_country_hash[$field_name])) {
+ // if this is state field
+ $check_state = $object->GetDBField('VariableValue');
+ $check_country = $field_values[ $state_country_hash[$field_name] ]['VariableValue'];
+
+ if (!($check_country && $check_state)) {
+ return true;
+ }
+
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $state_iso = $cs_helper->CheckState($check_state, $check_country);
+ if ($state_iso !== false) {
+ $object->SetDBField('VariableValue', $state_iso);
+ }
+ else
+ {
+ $errormsgs = $this->Application->GetVar('errormsgs');
+ $errors = !$errormsgs || !isset($errormsgs[$event->Prefix_Special]) ? Array() : $errormsgs[$event->Prefix_Special];
+
+ $errors[$field_name] = 'la_InvalidState';
+ $errormsgs[$event->Prefix_Special] = $errors;
+
+ $this->Application->SetVar('errormsgs', $errormsgs);
+ $event->status = erFAIL;
+ }
+ }
+
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ if ($object->GetDBField('element_type') == 'password') {
+ if (trim($object->GetDBField('VariableValue')) == '') {
+ $field_options = $object->GetFieldOptions('VariableValue');
+ unset($field_options['skip_empty']);
+ $object->SetFieldOptions('VariableValue', $field_options);
+ }
+ }
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnUpdate(&$event)
+ {
+ if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+
+ // 1. save user selected module root category
+ $items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
+ $new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue');
+ if ($new_category_id) {
+ unset($items_info['ModuleRootCategory']);
+ $this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
+ }
+
+ parent::OnUpdate($event);
+
+ if ($event->status == erSUCCESS && $new_category_id !== false) {
+ // root category was submitted
+ $module = $this->Application->GetVar('module');
+ $root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
+
+ if ($root_category_id != $new_category_id) {
+ // root category differs from one in db
+ $fields_hash = Array('RootCat' => $new_category_id);
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
+ }
+ }
+
+ if ($event->status == erSUCCESS) { // reset cache
+ $this->Application->UnitConfigReader->ResetParsedData();
+ }
+ }
+
+ if ($this->Application->GetVar('errormsgs')) {
+ // because we have list out there, and this is item
+ $this->Application->removeObject($event->getPrefixSpecial());
+ $event->redirect = false;
+ }
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ /*function OnChangeCountry(&$event)
+ {
+ $event->setPseudoClass('_List');
+ $object = &$event->getObject( Array('per_page'=>-1) );
+ $object->Query();
+ $array_records =& $object->Records;
+ foreach($array_records as $i=>$record){
+ if ($record['VariableName']=='Comm_Country'){
+ $values = $this->Application->GetVar('conf');
+ $array_records[$i]['VariableValue'] = $values['Comm_Country']['VariableValue'];
+ }
+ }
+
+ $event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
+ $event->redirect = false;
+ }*/
+
+ /**
+ * Process items from selector (selected_ids var, key - prefix, value - comma separated ids)
+ *
+ * @param kEvent $event
+ */
+ function OnProcessSelected(&$event)
+ {
+ $selected_ids = $this->Application->GetVar('selected_ids');
+ $this->Application->StoreVar('ModuleRootCategory', $selected_ids['c']);
+ $this->finalizePopup($event);
+ }
+
+ }
+
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.16.2/kernel/units/configuration/configuration_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/xml/categories_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/xml/categories_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/xml/categories_list.tpl (revision 6106)
@@ -0,0 +1,73 @@
+<inp2:m_include t="incs/blocks"/>
+<inp2:m_include t="incs/grid_blocks"/>
+<inp2:c_InitList no_special="1" per_page="-1"/>
+Grids['c'] = new Grid('c', 'table_white_selected', ':original', edit, a_toolbar);
+Grids['c'].AddItemsByIdMask('td', /^c_([0-9-]+)/, 'c[$$ID$$][CategoryId]');
+Grids['c'].InitItems();
+Grids['c'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+<inp2:c_ViewMenu block="viewmenu_declaration" grid="Default" no_special="1" menu_perpage="no" menu_filters="yes" ajax="1"/>
+
+<!-- substiture form action, like from was created from here -->
+document.getElementById('categories_form').action = '<inp2:m_t pass="all" js_escape="1"/>';
+$Catalog.setItemCount('c', '<inp2:c_TotalRecords no_special="1"/>');
+$Catalog.ParentCategoryID = <inp2:c_GetParentCategory/>;
+document.getElementById('c_search_warning').style.display = '<inp2:m_if check="m_RecallEquals" var="c_search_keyword" value="" inverse="inverse">block<inp2:m_else/>none</inp2:m_if>';
+document.getElementById('c_search_keyword').value = '<inp2:c_SearchKeyword no_special="1" js_escape="1"/>';
+set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
+<inp2:m_DefineElement name="category_caption">
+ <span class="NAV_CURRENT_ITEM">
+ <inp2:m_if check="m_ParamEquals" name="cat_id" value="0" inverse="inverse">
+ <inp2:m_param name="separator"/>
+ </inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="current" value="1" inverse="1">
+ <a class="control_link" href="javascript:$Catalog.go_to_cat(<inp2:m_param name="cat_id"/>);"><inp2:m_param name="cat_name"/></a>
+ <inp2:m_else/>
+ <inp2:m_param name="cat_name"/>
+ </inp2:m_if>
+ </span>
+</inp2:m_DefineElement>
+setInnerHTML('category_path', '<inp2:c_CategoryPath separator=">" render_as="category_caption" js_escape="1"/>');
+<inp2:m_if check="m_GetEquals" name="m_cat_id" value="0">
+ a_toolbar.DisableButton('upcat');
+ a_toolbar.DisableButton('homecat');
+<inp2:m_else/>
+ a_toolbar.EnableButton('upcat');
+ a_toolbar.EnableButton('homecat');
+</inp2:m_if>
+<inp2:m_if check="m_GetEquals" name="tm" value="single">
+ Grids['c'].RadioMode = true;
+ Grids['c'].DblClick = function() {return false};
+</inp2:m_if>
+$Catalog.reflectPasteButton(<inp2:c_HasClipboard/>);
+#separator#
+<inp2:c_UpdateLastTemplate template="catalog"/>
+<inp2:m_include t="categories/ci_blocks"/>
+<br />
+<table border="0" width="100%">
+ <inp2:m_DefineElement name="category_td">
+ <td valign="top" class="table_white text" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="CategoryId"/>" width="50%">
+ <input type="<inp2:m_if check="m_GetEquals" name="tm" value="single">radio<inp2:m_else/>checkbox</inp2:m_if>" name="<inp2:InputName field="$IdField"/>" id="<inp2:InputName field="$IdField"/>">
+ <img src="<inp2:ModulePath />img/itemicons/<inp2:ItemIcon grid="Default"/>"> <span class="priority"><inp2:m_if check="FieldEquals" field="Priority" value="0" inverse="inverse"><sup><inp2:Field field="Priority"/></sup></inp2:m_if></span>
+ <a class="link" href="javascript:$Catalog.go_to_cat(<inp2:m_get name="c_id"/>);"><b><inp2:Field name="Name" no_special="1"/></b></a><span class="cat_desc">:</span>
+ <inp2:m_RenderElement name="status_mark" field="EditorsPick" type="pick" PrefixSpecial="$PrefixSpecial"/>
+ <inp2:m_RenderElement name="status_mark" field="IsNew" type="new" PrefixSpecial="$PrefixSpecial"/>
+ <span class="cats_stats">(<inp2:SubCatCount/> / <inp2:ItemCount/>)</span><br>
+ <div style="padding-left: 3px;">
+ <span class="cat_desc"><inp2:Field field="Description" no_special="1"/></span><br>
+ <inp2:m_if check="m_IsDebugMode">
+ <span class="cat_desc">ParentPath: <b><inp2:Field name="ParentPath"/></b></span><br />
+ </inp2:m_if>
+ <span class="cats_stats">(<inp2:Field field="CreatedOn" format="_regional_DateFormat"/>)</span>
+ </div>
+ </td>
+ </inp2:m_DefineElement>
+ <inp2:m_if check="c_TotalRecords" no_special="1">
+ <inp2:c_CategoryList no_special="1" block_main="category_td" per_page="-1" columns="2" direction="V" IdField="CategoryId" />
+ <inp2:m_else/>
+ <tr>
+ <td class="text">
+ <inp2:m_phrase name="la_text_NoCategories"/>
+ </td>
+ </tr>
+ </inp2:m_if>
+</table></br>
Property changes on: branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/xml/categories_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/incs/ajax.js
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/incs/ajax.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/incs/ajax.js (revision 6106)
@@ -0,0 +1,257 @@
+// Main AJAX classs
+function Request() {}
+
+Request.timeout = 5000; //5 seconds
+Request.method = 'GET';
+Request.headers = new Array();
+Request.params = null;
+
+Request.makeRequest = function(p_url, p_busyReq, p_progId, p_successCallBack, p_errorCallBack, p_pass, p_object) {
+ //p_url: the web service url
+ //p_busyReq: is a request for this object currently in progress?
+ //p_progId: element id where progress HTML should be shown
+ //p_successCallBack: callback function for successful response
+ //p_errorCallBack: callback function for erroneous response
+ //p_pass: string of params to pass to callback functions
+ //p_object: object of params to pass to callback functions
+
+ if (p_busyReq) return;
+ var req = Request.getRequest();
+ if (req != null) {
+ p_busyReq = true;
+ Request.showProgress(p_progId);
+ req.onreadystatechange = function() {
+ if (req.readyState == 4) {
+ p_busyReq = false;
+ window.clearTimeout(toId);
+ if (req.status == 200) {
+ p_successCallBack(req, p_pass, p_object);
+ } else {
+ p_errorCallBack(req, p_pass, p_object);
+ }
+ Request.hideProgress(p_progId);
+ }
+ }
+ var $ajax_mark = (p_url.indexOf('?') ? '&' : '?') + 'ajax=yes';
+ req.open(Request.method, p_url + $ajax_mark, true);
+
+ if (Request.method == 'POST') {
+ Request.headers['Content-type'] = 'application/x-www-form-urlencoded';
+ Request.headers['referer'] = p_url;
+ }
+ else {
+ Request.headers['If-Modified-Since'] = 'Sat, 1 Jan 2000 00:00:00 GMT';
+ }
+
+ Request.sendHeaders(req);
+ if (Request.method == 'POST') {
+ req.send(Request.params);
+ Request.method = 'GET'; // restore method back to GET
+ }
+ else {
+ req.send(null);
+ }
+
+ var toId = window.setTimeout( function() {if (p_busyReq) req.abort();}, Request.timeout );
+ }
+}
+
+Request.sendHeaders = function($request) {
+ for (var $header_name in Request.headers) {
+ $request.setRequestHeader($header_name, Request.headers[$header_name]);
+ }
+ Request.headers = new Array(); // reset header afterwards
+}
+
+Request.getRequest = function() {
+ var xmlHttp;
+ try { xmlHttp = new ActiveXObject('MSXML2.XMLHTTP'); return xmlHttp; } catch (e) {}
+ try { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); return xmlHttp; } catch (e) {}
+ try { xmlHttp = new XMLHttpRequest(); return xmlHttp; } catch(e) {}
+ return null;
+}
+
+Request.showProgress = function(p_id) {
+ if (p_id != '') {
+ Request.setOpacity(20, p_id);
+
+ if (!document.getElementById(p_id + '_progress')) {
+ document.body.appendChild(Request.getProgressObject(p_id));
+ }
+ else {
+ var $progress_div = document.getElementById(p_id + '_progress');
+ $progress_div.style.top = getRealTop(p_id) + 'px';
+ $progress_div.style.height = document.getElementById(p_id).clientHeight;
+ $progress_div.style.display = 'block';
+ }
+// document.getElementById(p_id).innerHTML = Request.getProgressHtml();
+ }
+}
+
+Request.hideProgress = function(p_id) {
+ if (p_id != '') {
+ document.getElementById(p_id + '_progress').style.display = 'none';
+ Request.setOpacity(100, p_id);
+ }
+}
+
+Request.setOpacity = function (opacity, id) {
+ var object = document.getElementById(id).style;
+ object.opacity = (opacity / 100);
+ object.MozOpacity = (opacity / 100);
+ object.KhtmlOpacity = (opacity / 100);
+ object.filter = "alpha(opacity=" + opacity + ")";
+}
+
+Request.getProgressHtml = function() {
+ return "<p class='progress'>" + Request.progressText + "<br /><img src='img/ajax_progress.gif' align='absmiddle' width='100' height='7' alt='" + Request.progressText + "'/></p>";
+}
+
+Request.getProgressObject = function($id) {
+ var $div = document.createElement('DIV');
+ var $parent_div = document.getElementById($id);
+
+ $div.id = $id + '_progress';
+
+ $div.style.width = $parent_div.clientWidth + 'px';
+ $div.style.height = '150px'; // default height if div is empty (first ajax request for div)
+ $div.style.left = getRealLeft($parent_div) + 'px';
+ $div.style.top = getRealTop($parent_div) + 'px';
+ $div.style.position = 'absolute';
+
+ /*$div.style.border = '1px solid green';
+ $div.style.backgroundColor = '#FF0000';*/
+
+ $div.innerHTML = '<table style="width: 100%; height: 100%;"><tr><td style="text-align: center;">'+Request.progressText+'<br /><img src="img/ajax_progress.gif" align="absmiddle" width="100" height="7" alt="'+escape(Request.progressText)+'" /></td></tr></table>';
+ return $div;
+}
+
+Request.getErrorHtml = function(p_req) {
+ //TODO: implement accepted way to handle request error
+ return '[status: ' + p_req.status + '; status_text: ' + p_req.statusText + '; responce_text: ' + p_req.responseText + ']';
+}
+
+Request.serializeForm = function(theform) {
+ if (typeof(theform) == 'string') {
+ theform = document.getElementById(theform);
+ }
+
+ var els = theform.elements;
+ var len = els.length;
+ var queryString = '';
+
+ Request.addField = function(name, value) {
+ if (queryString.length > 0) queryString += '&';
+ queryString += encodeURIComponent(name) + '=' + encodeURIComponent(value);
+ };
+
+ for (var i = 0; i<len; i++) {
+ var el = els[i];
+ if (el.disabled) continue;
+
+ switch(el.type) {
+ case 'text':
+ case 'password':
+ case 'hidden':
+ case 'textarea':
+ Request.addField(el.name, el.value);
+ break;
+
+ case 'select-one':
+ if (el.selectedIndex >= 0) {
+ Request.addField(el.name, el.options[el.selectedIndex].value);
+ }
+ break;
+
+ case 'select-multiple':
+ for (var j = 0; j < el.options.length; j++) {
+ if (!el.options[j].selected) continue;
+ Request.addField(el.name, el.options[j].value);
+ }
+ break;
+
+ case 'checkbox':
+ case 'radio':
+ if (!el.checked) continue;
+ Request.addField(el.name,el.value);
+ break;
+ }
+ }
+ return queryString;
+};
+
+// AJAX ProgressBar classs
+function AjaxProgressBar($url) {
+ this.WindowTitle = this.GetWindow().document.title;
+ this.URL = $url;
+ this.BusyRequest = false;
+ this.LastResponceTime = this.GetMicroTime();
+ this.ProgressPercent = 0; // progress percent
+ this.ProgressTime = new Array();
+ this.Query();
+}
+
+AjaxProgressBar.prototype.GetWindow = function() {
+ return window.parent ? window.parent : window;
+}
+
+AjaxProgressBar.prototype.GetMicroTime = function() {
+ var $now = new Date();
+ return Math.round($now.getTime() / 1000); // because miliseconds are returned too
+}
+
+AjaxProgressBar.prototype.Query = function() {
+ Request.makeRequest(this.URL, this.BusyRequest, '', this.successCallback, this.errorCallback, '', this);
+}
+
+// return time needed for progress to finish
+AjaxProgressBar.prototype.GetEstimatedTime = function() {
+ return Math.ceil((100 - this.ProgressPercent) * Math.sum(this.ProgressTime) / this.ProgressPercent);
+}
+
+AjaxProgressBar.prototype.successCallback = function($request, $params, $object) {
+ var $responce = $request.responseText;
+ var $match_redirect = new RegExp('^#redirect#(.*)').exec($responce);
+ if ($match_redirect != null) {
+ $object.showProgress(100);
+ // redirect to external template requested
+ window.location.href = $match_redirect[1];
+ return false;
+ }
+
+ if ($object.showProgress($responce)) {
+ $object.Query();
+ }
+}
+
+AjaxProgressBar.prototype.errorCallback = function($request, $params, $object) {
+ alert('AJAX Error; class: AjaxProgressBar; ' + Request.getErrorHtml($request));
+}
+
+AjaxProgressBar.prototype.FormatTime = function ($seconds) {
+ $seconds = parseInt($seconds);
+
+ var $minutes = Math.floor($seconds / 60);
+ if ($minutes < 10) $minutes = '0' + $minutes;
+ $seconds = $seconds % 60;
+ if ($seconds < 10) $seconds = '0' + $seconds;
+
+ return $minutes + ':' + $seconds;
+}
+
+AjaxProgressBar.prototype.showProgress = function ($percent) {
+ this.ProgressPercent = $percent;
+ var $now = this.GetMicroTime();
+ this.ProgressTime[this.ProgressTime.length] = $now - this.LastResponceTime;
+ this.LastResponceTime = $now;
+
+ var $display_progress = parseInt(this.ProgressPercent);
+ this.GetWindow().document.title = $display_progress + '% - ' + this.WindowTitle;
+ document.getElementById('progress_display[percents_completed]').innerHTML = $display_progress + '%';
+ document.getElementById('progress_display[elapsed_time]').innerHTML = this.FormatTime( Math.sum(this.ProgressTime) );
+ document.getElementById('progress_display[Estimated_time]').innerHTML = this.FormatTime( this.GetEstimatedTime() );
+
+ document.getElementById('progress_bar[done]').style.width = $display_progress + '%';
+ document.getElementById('progress_bar[left]').style.width = (100 - $display_progress) + '%';
+ return $percent < 100 ? true : false;
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.16.2/kernel/admin_templates/incs/ajax.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.16.2/core/units/languages/languages_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/core/units/languages/languages_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/core/units/languages/languages_config.php (revision 6106)
@@ -0,0 +1,168 @@
+<?php
+
+$config = Array(
+ 'Prefix' => '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',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnUpdatePrimary',
+ ),
+ ),
+ '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#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:configure_lang'),
+
+ 'Sections' => Array(
+ 'in-portal:configure_lang' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_regional',
+ 'label' => 'la_tab_Regional',
+ 'url' => Array('t' => 'regional/languages_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:set_primary', 'advanced:import', 'advanced:export'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ '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),
+ 'InputDateFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('m/d/Y' => 'm/d/Y'), 'not_null' => '1','default' => 'm/d/Y', 'required' => 1),
+ 'InputTimeFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('g:i:s A' => 'g:i:s A'), 'not_null' => '1','default' => 'g:i:s A', '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),
+ 'UnitSystem' => Array('type' => 'int','not_null' => '1','default' => '1','formatter' => 'kOptionsFormatter','options' => Array(1 => 'la_Metric', 2 => 'la_US_UK'),'use_phrases' => 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
Property changes on: branches/unlabeled/unlabeled-1.16.2/core/units/languages/languages_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.16.2/core/units/configuration/configuration_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/core/units/configuration/configuration_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/core/units/configuration/configuration_event_handler.php (revision 6106)
@@ -0,0 +1,191 @@
+<?php
+
+ class ConfigurationEventHandler extends InpDBEventHandler {
+
+
+ /**
+ * Changes permission section to one from REQUEST, not from config
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $event->setEventParam('PermSection', $this->Application->GetVar('section'));
+ return parent::CheckPermission($event);
+ }
+
+
+ /**
+ * Apply any custom changes to list's sql query
+ *
+ * @param kEvent $event
+ * @access protected
+ * @see OnListBuild
+ */
+ function SetCustomQuery(&$event)
+ {
+ $object =& $event->getObject();
+
+ $module = $this->Application->GetVar('module');
+ $section = $this->Application->GetVar('section');
+
+ $object->addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module));
+ $object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section));
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+
+ // if password field is empty, then don't update
+ if ($object->GetDBField('element_type') == 'password') {
+ if (trim($object->GetDBField('VariableValue')) == '') {
+ $field_options = $object->GetFieldOptions('VariableValue');
+ $field_options['skip_empty'] = 1;
+ $object->SetFieldOptions('VariableValue', $field_options);
+ }else {
+ $object->SetDBField('VariableValue', md5($object->GetDBField('VariableValue')));
+ }
+ }
+
+ $field_values = $this->Application->GetVar($event->getPrefixSpecial(true));
+
+ $state_country_hash = Array(
+ 'Comm_State' => 'Comm_Country',
+ 'Comm_Shipping_State' => 'Comm_Shipping_Country'
+ );
+
+ $field_name = $object->GetDBField('VariableName');
+ if (isset($state_country_hash[$field_name])) {
+ // if this is state field
+ $check_state = $object->GetDBField('VariableValue');
+ $check_country = $field_values[ $state_country_hash[$field_name] ]['VariableValue'];
+
+ if (!($check_country && $check_state)) {
+ return true;
+ }
+
+ $cs_helper =& $this->Application->recallObject('CountryStatesHelper');
+ $state_iso = $cs_helper->CheckState($check_state, $check_country);
+ if ($state_iso !== false) {
+ $object->SetDBField('VariableValue', $state_iso);
+ }
+ else
+ {
+ $errormsgs = $this->Application->GetVar('errormsgs');
+ $errors = !$errormsgs || !isset($errormsgs[$event->Prefix_Special]) ? Array() : $errormsgs[$event->Prefix_Special];
+
+ $errors[$field_name] = 'la_InvalidState';
+ $errormsgs[$event->Prefix_Special] = $errors;
+
+ $this->Application->SetVar('errormsgs', $errormsgs);
+ $event->status = erFAIL;
+ }
+ }
+
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ if ($object->GetDBField('element_type') == 'password') {
+ if (trim($object->GetDBField('VariableValue')) == '') {
+ $field_options = $object->GetFieldOptions('VariableValue');
+ unset($field_options['skip_empty']);
+ $object->SetFieldOptions('VariableValue', $field_options);
+ }
+ }
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnUpdate(&$event)
+ {
+ if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+
+ // 1. save user selected module root category
+ $items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
+ $new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue');
+ if ($new_category_id) {
+ unset($items_info['ModuleRootCategory']);
+ $this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
+ }
+
+ parent::OnUpdate($event);
+
+ if ($event->status == erSUCCESS && $new_category_id !== false) {
+ // root category was submitted
+ $module = $this->Application->GetVar('module');
+ $root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
+
+ if ($root_category_id != $new_category_id) {
+ // root category differs from one in db
+ $fields_hash = Array('RootCat' => $new_category_id);
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
+ }
+ }
+
+ if ($event->status == erSUCCESS) { // reset cache
+ $this->Application->UnitConfigReader->ResetParsedData();
+ }
+ }
+
+ if ($this->Application->GetVar('errormsgs')) {
+ // because we have list out there, and this is item
+ $this->Application->removeObject($event->getPrefixSpecial());
+ $event->redirect = false;
+ }
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ /*function OnChangeCountry(&$event)
+ {
+ $event->setPseudoClass('_List');
+ $object = &$event->getObject( Array('per_page'=>-1) );
+ $object->Query();
+ $array_records =& $object->Records;
+ foreach($array_records as $i=>$record){
+ if ($record['VariableName']=='Comm_Country'){
+ $values = $this->Application->GetVar('conf');
+ $array_records[$i]['VariableValue'] = $values['Comm_Country']['VariableValue'];
+ }
+ }
+
+ $event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
+ $event->redirect = false;
+ }*/
+
+ /**
+ * Process items from selector (selected_ids var, key - prefix, value - comma separated ids)
+ *
+ * @param kEvent $event
+ */
+ function OnProcessSelected(&$event)
+ {
+ $selected_ids = $this->Application->GetVar('selected_ids');
+ $this->Application->StoreVar('ModuleRootCategory', $selected_ids['c']);
+ $this->finalizePopup($event);
+ }
+
+ }
+
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.16.2/core/units/configuration/configuration_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.16.2/core/units/general/inp1_parser.php
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/core/units/general/inp1_parser.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/core/units/general/inp1_parser.php (revision 6106)
@@ -0,0 +1,156 @@
+<?php
+
+class Inp1Parser extends kHelper {
+
+ var $InportalInited = false;
+
+ var $InpParsetInited = false;
+
+ function Parse($tname, $template_body)
+ {
+ global $objTemplate, $var_list, $var_list_update;
+
+ if ( !$this->InportalInited) {
+ //$save_t = $this->Application->GetVar('t');
+ $this->InitInPortal();
+ $var_list['t'] = $this->cutTPL($var_list['t']);
+ if($var_list['t'] != $this->Application->GetVar('t'))
+ {
+ $get = $_GET;
+ unset($get['env'], $get['Action'], $get['_mod_rw_url_'], $get['rewrite']);
+ $this->Application->StoreVar('K4_Template_Referer', $this->Application->GetVar('t') );
+
+ $this->Application->Redirect($var_list['t'], $get);
+ }
+ }
+
+ $var_list['t'] = $this->cutTPL($var_list['t']);
+
+ if ($var_list['t'] != $this->Application->GetVar('t')) {
+ //$var_list['t'] = rtrim($var_list['t'],'.tpl');
+ $t = $var_list['t'];
+ $this->Application->SetVar('t', $t);
+ $template_cache =& $this->Application->recallObject('TemplatesCache');
+ $template_body = $this->Application->Parser->Parse( $template_cache->GetTemplateBody($t), $t, 0 );
+ }
+ else {
+ $this->InitParser();
+ $template_body = $objTemplate->ParseTemplateFromBuffer($tname, $template_body);
+ }
+ return $template_body;
+ }
+
+ function cutTPL($tname)
+ {
+ if( substr($tname,-4) == '.tpl' )
+ {
+ return substr($tname, 0, strlen($tname)-4 );
+ }
+ return $tname;
+ }
+
+ function InitParser()
+ {
+ global $objTemplate, $CurrentTheme, $objThemes, $objLanguageCache, $var_list;
+ if ($this->InpParsetInited) return true;
+
+ $theme_id = $this->Application->GetVar('m_theme');
+ if ($theme_id) {
+ $CurrentTheme = $objThemes->GetItem($theme_id);
+
+ $timeout = $CurrentTheme->Get('CacheTimeout');
+ $objLanguageCache->LoadTemplateCache($var_list['t'], $timeout, $theme_id);
+ $objLanguageCache->LoadCachedVars($this->Application->GetVar('m_lang'));
+
+ $objTemplate = new clsTemplateList(FULL_PATH.THEMES_PATH.'/');
+ }
+
+ $this->InpParsetInited = true;
+ }
+
+ function InitInPortal()
+ {
+ $this->InportalInited = true;
+ /*global $pathtoroot, $FrontEnd, $indexURL, $rootURL, $secureURL, $var_list, $CurrentTheme,
+ $objThemes, $objConfig, $m_var_list, $timeout, $objLanguages, $objLanguageCache,
+ $TemplateRoot, $objTemplate, $html, $objSession, $Errors, $objCatList, $objUsers,
+ $env, $mod_prefix, $ExtraVars, $timestart, $timeend, $timeout, $sqlcount, $totalsql,
+ $template_path, $modules_loaded, $mod_root_cats, $objModules, $objItemTypes;*/
+
+
+ global $sec, $usec, $timestart, $pathtoroot, $FrontEnd, $indexURL, $kernel_version, $FormError,
+ $FormValues, $ItemTables, $KeywordIgnore, $debuglevel,
+ $LogLevel, $LogFile, $rq_value, $rq_name, $dbg_constMap, $dbg_constValue, $dbg_constName,
+ $debugger, $g_LogFile, $LogData, $Errors,
+ $g_DebugMode, $totalsql, $sqlcount, $objConfig, $ItemTypePrefixes, $ItemTagFiles, $objModules,
+ $objSystemCache, $objBanList, $objItemTypes, $objThemes, $objLanguages, $objImageList, $objFavorites,
+ $objUsers, $objGroups, $DownloadId, $objPermissions, $objPermCache, $m_var_list, $objCatList,
+ $objCustomFieldList, $objCustomDataList, $objCountCache, $CRLF, $objMessageList, $objEmailQueue,
+ $ExtraVars, $adodbConnection, $sql, $rs, $mod_prefix, $modules_loaded, $name,
+ $template_path, $mod_root_cats, $value, $mod, $ItemTypes,
+ $ParserFiles, $SessionQueryString, $var_list, $objSession,
+ $orderByClause, $TemplateRoot, $ip, $UseSession, $Action, $CookieTest, $sessionId,
+ $var_list_update, $CurrentTheme, $UserID, $objCurrentUser, $objLanguageCache,
+ $folder_name, $objLinkList, $tag_override, $timeZones, $siteZone, $serverZone,
+ $lastExpire, $diffZone, $date, $nowDate, $lastExpireDate, $SearchPerformed,
+ $TotalMessagesSent, $ado, $adminDir, $rootURL, $secureURL, $html, $timeout,
+ $pathchar, $objTemplate, $objTopicList, $objArticleList, $objPostingList, $objCensorList,
+ $objSmileys, $objPMList, $SubscribeAddress, $SubscribeError, $SubscribeResult, $application;
+
+ $pathtoroot = $this->Application->IsAdmin() ? '../' : './';
+ $pathtoroot = realpath($pathtoroot)."/";
+
+ if (!file_exists($pathtoroot."config.php")) {
+ echo "In-Portal is probably not installed, or configuration file is missing.<br>";
+ echo "Please use the installation script to fix the problem.<br><br>";
+ echo "<a href='admin/install.php'>Go to installation script</a><br><br>";
+ flush();
+ $this->Application->ApplicationDie();
+ }
+
+ //ob_start();
+ $FrontEnd=1;
+
+ $indexURL="../../index.php"; //Set to relative URL from the theme directory
+
+ /* initalize the in-portal system */
+ include_once(FULL_PATH."/kernel/startup.php");
+
+ $rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
+ $secureURL = $rootURL;
+
+ if( !$var_list['t'] ) $var_list['t'] = 'index';
+
+ $this->InitParser();
+
+ // process referer in session: begin
+ if (is_object($objSession)) {
+ $k4_referer = $objSession->GetVariable('K4_Template_Referer');
+ if ($k4_referer) {
+ $_local_t = $k4_referer;
+ $this->Application->RemoveVar('K4_Template_Referer');
+ }
+ $objSession->SetVariable('Template_Referer', $_local_t);
+ }
+ // process referer in session: end
+
+ if ($this->Application->isDebugMode() && $Action) {
+ $this->Application->Debugger->setHTMLByIndex(1, 'Front Action: <b>'.$Action.'</b>', 'append');
+ }
+
+ LogEntry("Output Complete\n");
+ $objLanguageCache->SaveTemplateCache();
+ LogEntry("Templates Cached\n");
+
+ $timeend = getmicrotime();
+ $diff = $timeend - $timestart;
+
+ LogEntry("\nTotal Queries Executed: $sqlcount in $totalsql seconds\n");
+ LogEntry("\nPage Execution Time: $diff seconds\n", true);
+ if ($LogFile) {
+ fclose($LogFile);
+ }
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.16.2/core/units/general/inp1_parser.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.16.2/core/admin_templates/categories/xml/categories_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.16.2/core/admin_templates/categories/xml/categories_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.16.2/core/admin_templates/categories/xml/categories_list.tpl (revision 6106)
@@ -0,0 +1,73 @@
+<inp2:m_include t="incs/blocks"/>
+<inp2:m_include t="incs/grid_blocks"/>
+<inp2:c_InitList no_special="1" per_page="-1"/>
+Grids['c'] = new Grid('c', 'table_white_selected', ':original', edit, a_toolbar);
+Grids['c'].AddItemsByIdMask('td', /^c_([0-9-]+)/, 'c[$$ID$$][CategoryId]');
+Grids['c'].InitItems();
+Grids['c'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+<inp2:c_ViewMenu block="viewmenu_declaration" grid="Default" no_special="1" menu_perpage="no" menu_filters="yes" ajax="1"/>
+
+<!-- substiture form action, like from was created from here -->
+document.getElementById('categories_form').action = '<inp2:m_t pass="all" js_escape="1"/>';
+$Catalog.setItemCount('c', '<inp2:c_TotalRecords no_special="1"/>');
+$Catalog.ParentCategoryID = <inp2:c_GetParentCategory/>;
+document.getElementById('c_search_warning').style.display = '<inp2:m_if check="m_RecallEquals" var="c_search_keyword" value="" inverse="inverse">block<inp2:m_else/>none</inp2:m_if>';
+document.getElementById('c_search_keyword').value = '<inp2:c_SearchKeyword no_special="1" js_escape="1"/>';
+set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
+<inp2:m_DefineElement name="category_caption">
+ <span class="NAV_CURRENT_ITEM">
+ <inp2:m_if check="m_ParamEquals" name="cat_id" value="0" inverse="inverse">
+ <inp2:m_param name="separator"/>
+ </inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="current" value="1" inverse="1">
+ <a class="control_link" href="javascript:$Catalog.go_to_cat(<inp2:m_param name="cat_id"/>);"><inp2:m_param name="cat_name"/></a>
+ <inp2:m_else/>
+ <inp2:m_param name="cat_name"/>
+ </inp2:m_if>
+ </span>
+</inp2:m_DefineElement>
+setInnerHTML('category_path', '<inp2:c_CategoryPath separator=">" render_as="category_caption" js_escape="1"/>');
+<inp2:m_if check="m_GetEquals" name="m_cat_id" value="0">
+ a_toolbar.DisableButton('upcat');
+ a_toolbar.DisableButton('homecat');
+<inp2:m_else/>
+ a_toolbar.EnableButton('upcat');
+ a_toolbar.EnableButton('homecat');
+</inp2:m_if>
+<inp2:m_if check="m_GetEquals" name="tm" value="single">
+ Grids['c'].RadioMode = true;
+ Grids['c'].DblClick = function() {return false};
+</inp2:m_if>
+$Catalog.reflectPasteButton(<inp2:c_HasClipboard/>);
+#separator#
+<inp2:c_UpdateLastTemplate template="catalog"/>
+<inp2:m_include t="categories/ci_blocks"/>
+<br />
+<table border="0" width="100%">
+ <inp2:m_DefineElement name="category_td">
+ <td valign="top" class="table_white text" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="CategoryId"/>" width="50%">
+ <input type="<inp2:m_if check="m_GetEquals" name="tm" value="single">radio<inp2:m_else/>checkbox</inp2:m_if>" name="<inp2:InputName field="$IdField"/>" id="<inp2:InputName field="$IdField"/>">
+ <img src="<inp2:ModulePath />img/itemicons/<inp2:ItemIcon grid="Default"/>"> <span class="priority"><inp2:m_if check="FieldEquals" field="Priority" value="0" inverse="inverse"><sup><inp2:Field field="Priority"/></sup></inp2:m_if></span>
+ <a class="link" href="javascript:$Catalog.go_to_cat(<inp2:m_get name="c_id"/>);"><b><inp2:Field name="Name" no_special="1"/></b></a><span class="cat_desc">:</span>
+ <inp2:m_RenderElement name="status_mark" field="EditorsPick" type="pick" PrefixSpecial="$PrefixSpecial"/>
+ <inp2:m_RenderElement name="status_mark" field="IsNew" type="new" PrefixSpecial="$PrefixSpecial"/>
+ <span class="cats_stats">(<inp2:SubCatCount/> / <inp2:ItemCount/>)</span><br>
+ <div style="padding-left: 3px;">
+ <span class="cat_desc"><inp2:Field field="Description" no_special="1"/></span><br>
+ <inp2:m_if check="m_IsDebugMode">
+ <span class="cat_desc">ParentPath: <b><inp2:Field name="ParentPath"/></b></span><br />
+ </inp2:m_if>
+ <span class="cats_stats">(<inp2:Field field="CreatedOn" format="_regional_DateFormat"/>)</span>
+ </div>
+ </td>
+ </inp2:m_DefineElement>
+ <inp2:m_if check="c_TotalRecords" no_special="1">
+ <inp2:c_CategoryList no_special="1" block_main="category_td" per_page="-1" columns="2" direction="V" IdField="CategoryId" />
+ <inp2:m_else/>
+ <tr>
+ <td class="text">
+ <inp2:m_phrase name="la_text_NoCategories"/>
+ </td>
+ </tr>
+ </inp2:m_if>
+</table></br>
Property changes on: branches/unlabeled/unlabeled-1.16.2/core/admin_templates/categories/xml/categories_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.16
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment