Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, Jun 24, 11:29 PM

in-portal

Index: branches/unlabeled/unlabeled-1.14.2/kernel/units/general/main_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/kernel/units/general/main_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/kernel/units/general/main_event_handler.php (revision 6102)
@@ -0,0 +1,125 @@
+<?php
+
+ class MainEventHandler extends kEventHandler {
+
+
+ /**
+ * Description
+ *
+ * @var kDBConnection
+ * @access public
+ */
+ var $Conn;
+
+ /**
+ * Adds ability to address db connection
+ *
+ * @return kDBEventHandler
+ * @access public
+ */
+ function MainEventHandler()
+ {
+ parent::kBase();
+ $this->Conn =& $this->Application->GetADODBConnection();
+ }
+
+ /**
+ * Created url part for this module
+ *
+ * @param kEvent $event
+ */
+ function BuildEnv(&$event)
+ {
+ $prefix_special = $event->getPrefixSpecial();
+ $url_params = $event->getEventParam('url_params');
+
+ $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
+
+ //if pass events is off and event is not implicity passed
+ if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) )
+ {
+ $url_params[$prefix_special.'_event'] = ''; // remove event from url if requested
+ //otherwise it will use value from get_var
+ }
+
+ if(!$query_vars) return true;
+
+ $processed_params = Array();
+ foreach($query_vars as $index => $var_name)
+ {
+ //if value passed in params use it, otherwise use current from application
+ $var_name = $prefix_special.'_'.$var_name;
+ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
+ if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
+ }
+
+ $ret = '';
+ $default_language_id = $this->Application->GetDefaultLanguageId();
+ if( $processed_params['m_lang'] && ($processed_params['m_lang'] != $default_language_id) )
+ {
+ $language_name = $this->Application->getCache('language_names', $processed_params['m_lang']);
+ if ($language_name === false) {
+ $sql = 'SELECT PackName
+ FROM '.TABLE_PREFIX.'Language
+ WHERE LanguageId = '.$processed_params['m_lang'];
+ $language_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('language_names', $processed_params['m_lang'], $language_name);
+ }
+ $ret .= $language_name.'/';
+ }
+
+ $default_theme_id = $this->Application->GetDefaultThemeId();
+ if( $processed_params['m_theme'] && ($processed_params['m_theme'] != $default_theme_id) )
+ {
+ $theme_name = $this->Application->getCache('theme_names', $processed_params['m_theme']);
+ if ($theme_name === false) {
+ $sql = 'SELECT Name
+ FROM '.TABLE_PREFIX.'Theme
+ WHERE ThemeId = '.$processed_params['m_theme'];
+ $theme_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('theme_names', $processed_params['m_theme'], $theme_name);
+
+ }
+ $ret .= $theme_name.'/';
+ }
+
+ if ($processed_params['m_cat_id'] > 0) {
+ $ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/';
+ $url_params['category_processed'] = true;
+ }
+
+ $force_page_adding = false;
+ if (getArrayValue($url_params, 'reset'))
+ {
+ unset($url_params['reset']);
+ if ($processed_params['m_cat_id'])
+ {
+ $processed_params['m_cat_page'] = 1;
+ $force_page_adding = true;
+ }
+ }
+
+ if( $processed_params['m_cat_page'] > 1 || $force_page_adding )
+ {
+ $ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/';
+ }
+
+ $template = getArrayValue($url_params, 't');
+ $category_template = $processed_params['m_cat_id'] ? $this->Application->getCache('category_templates', $processed_params['m_cat_id']) : '';
+
+ // remove template from url if it is category index cached template
+ if ($template == $category_template || strtolower($template) == '__default__') {
+ $template = '';
+ }
+
+ if ($template) {
+ $ret .= $template.'/';
+ }
+ unset($url_params['t']);
+
+ $event->setEventParam('url_params', $url_params);
+ $event->setEventParam('env_string', strtolower($ret) );
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.14.2/kernel/units/general/main_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/kernel/include/customfield.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/kernel/include/customfield.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/kernel/include/customfield.php (revision 6102)
@@ -0,0 +1,289 @@
+<?php
+
+class clsCustomField extends clsItem
+{
+
+ function clsCustomField($CustomFieldId=-1)
+ {
+ $this->clsItem();
+ $this->tablename=GetTablePrefix()."CustomField";
+ $this->type=10;
+ $this->BasePermission="";
+ $this->id_field = "CustomFieldId";
+ $this->NoResourceId=1; //set this to avoid using a resource ID
+ $this->debuglevel=0;
+ if($CustomFieldId>-1)
+ $this->LoadFromDatabase($CustomFieldId);
+ }
+
+
+ function GetAdminUI()
+ {
+ $a = new clsConfigAdminItem();
+ $a->name = "_".$this->Get("FieldName");
+ $a->heading = $this->Get("Heading");
+ $a->prompt = $this->Get("Prompt");
+ $a->ElementType = $this->Get("ElementType");
+ $a->ValidationRules="";
+ $a->default_value = "";
+ $a->ValueList=$this->Get("ValueList");
+ if(!strlen($a->ElementType))
+ $a->ElementType="text";
+ if(!strlen($a->prompt))
+ $a->prompt = "lu_fieldcustom__".strtolower($this->Get("FieldName"));
+ return $a;
+ }
+
+ function parsetag($tag)
+ {
+ if(is_object($tag))
+ {
+ $tagname = $tag->name;
+ }
+ else
+ $tagname = $tag;
+ switch($tagname)
+ {
+ case "fieldlabel":
+ return $this->Get("FieldLabel");
+ break;
+
+ case "fieldname":
+ return $this->Get("FieldName");
+ break;
+
+ case "customfieldid":
+ return $this->Get("CustomFieldId");
+
+ default:
+ return "Undefined:$tagname";
+ break;
+ }
+ }
+
+ }
+
+class clsCustomFieldList extends clsItemCollection
+{
+ var $Type;
+
+ function clsCustomFieldList($type = -1, $table = 'CustomField')
+ {
+ $this->clsItemCollection();
+ $this->Type = $type;
+ $this->classname = 'clsCustomField';
+ if ($table == 'CustomField') {
+ $table = GetTablePrefix().$table;
+ }
+
+ $this->SourceTable = $table;
+ if ($this->Type > 0) {
+ $this->LoadFields();
+ }
+ }
+
+ function LoadFields()
+ {
+ $this->Clear();
+ $sql = 'SELECT *
+ FROM '.$this->SourceTable.'
+ WHERE Type = '.$this->Type.' AND IsSystem = 0
+ ORDER BY DisplayOrder DESC, CustomFieldId ASC';
+ if($this->debuglevel > 1)
+ echo $sql."<br>\n";
+ $rs = $this->adodbConnection->Execute($sql);
+
+ while($rs && !$rs->EOF)
+ {
+ $data = $rs->fields;
+ $this->AddItemFromArray($data);
+ $rs->MoveNext();
+ }
+ }
+
+ function LoadFieldsAndValues($ResourceId, $main_prefix, $temp_table = false)
+ {
+ $this->Clear();
+
+ $table = $this->Application->getUnitOption($main_prefix.'-cdata', 'TableName');
+ if ($temp_table) {
+ $table = $this->Application->GetTempName($table);
+ }
+
+ $sql = 'SELECT *
+ FROM '.$table.'
+ WHERE ResourceId = '.$ResourceId;
+ $custom_data = $this->adodbConnection->GetRow($sql);
+
+ $sql = 'SELECT *
+ FROM '.TABLE_PREFIX.'CustomField
+ WHERE Type = '.$this->Application->getUnitOption($main_prefix, 'ItemType');
+ $custom_fields = $this->Conn->Query($sql, 'CustomFieldId');
+
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ foreach ($custom_fields as $custom_id => $custom_info) {
+ $custom_name = $ml_formatter->LangFieldName('cust_'.$custom_id);
+ $custom_info['Value'] = $custom_data[$custom_name];
+ $custom_info['CustomDataId'] = 0;
+ $this->AddItemFromArray($custom_info);
+ }
+ }
+
+ function GetFieldUIList($GeneralTab=FALSE)
+ {
+ $ret = new clsConfigAdmin();
+
+ if ($this->NumItems() > 0) {
+ foreach ($this->Items as $field) {
+ if ($GeneralTab == true && $field->Get('OnGeneralTab') == 1 || !$GeneralTab) {
+ $ui = $field->GetAdminUI();
+ array_push($ret->Items,$ui);
+ }
+ }
+ }
+ return $ret;
+ }
+
+ function GetFieldNames()
+ {
+ $res = array();
+ foreach($this->Items as $f)
+ $res[] = $f->Get("FieldName");
+ return $res;
+ }
+
+ function SaveFields()
+ {
+ foreach($this->Items as $i)
+ {
+ if($i->Get("CustomFieldId"))
+ {
+ $i->Update();
+ }
+ else
+ $i->Create();
+ }
+
+ }
+
+ function Query_CustomField($where=NULL,$orderby=NULL,$limit=NULL)
+ {
+ $this->Clear();
+ $sql = "SELECT * FROM ".$this->SourceTable;
+ if(isset($where))
+ $sql = sprintf('%s WHERE %s',$sql,$where);
+ if(isset($orderby) && strlen(trim($orderby))>0)
+ $sql = sprintf('%s ORDER BY %s',$sql,$orderby);
+ if(isset($limit) && strlen(trim($limit)))
+ $sql .= " ".$limit;
+ // $sql."<br>";
+ $this->Query_Item($sql);
+ return $this->Items;
+ }
+
+ function AddField($Type,$FieldName,$FieldLabel,$ShowGeneral=0,$Heading="", $Prompt="",
+ $ElementType="",$ValueList="")
+ {
+ global $objItemTypes,$objSearchConfig,$objLanguages;
+
+ //if(!is_numeric($Type))
+ // {
+ $f = new clsCustomField();
+ $f->tablename = $this->SourceTable;
+ $f->Set(array("Type","FieldName","FieldLabel","OnGeneralTab","Heading","Prompt",
+ "ElementType","ValueList"),
+ array($Type,$FieldName,$FieldLabel,$ShowGeneral,$Heading,$Prompt,
+ $ElementType,$ValueList));
+ $f->Create();
+ $Item = $objItemTypes->GetItem($Type);
+ if(is_object($Item))
+ {
+ //$Table = $Item->Get("SourceTable");
+ $Table = 'CustomField';
+ $Header = "la_text_".strtolower($Item->Get("ItemName"));
+ $Module = $Item->Get("Module");
+// $Desc = $FieldLabel;
+
+ if(!is_object($objSearchConfig))
+ {
+ $objSearchConfig = new clsSearchConfigList();
+ }
+
+ $NextOrder = $objSearchConfig->GetNextDisplayOrder($Module);
+ $desc = "lu_fieldcustom__".strtolower($FieldName);
+ if(!strlen($FieldLabel))
+ {
+ $FieldLabel = $FieldName;
+ }
+
+ $l = $objLanguages->GetPrimary();
+ $phrases = new clsPhraseList();
+ $phrases->AddPhrase($desc,$l,$FieldLabel,2, $Item->Get('Module') );
+
+ $dtable = GetTablePrefix()."CustomMetaData";
+ $Join = "($dtable.ResourceId={Table}.ResourceId)";
+ $objSearchConfig->AddSearchField($Table,$FieldName,$Module,$Type == 6 ? -1 : 0,0,
+ $FieldLabel,$desc,$Header,$NextOrder,0,
+ $ElementType, NULL, NULL, NULL, NULL, NULL,
+ $f->Get("CustomFieldId"), NULL);
+ }
+ return $f;
+ //}
+ //else
+ // return FALSE;
+ }
+
+ function EditField($FieldId,$Type,$FieldName,$FieldLabel,$ShowGeneral=0,$Heading="", $Prompt="",$ElementType="",$ValueList="")
+ {
+ global $objSearchConfig;
+
+ $f = $this->GetItem($FieldId);
+ $f->Set(array("Type","FieldName","FieldLabel","OnGeneralTab","Heading","Prompt","ElementType","ValueList"),
+ array($Type,$FieldName,$FieldLabel,$ShowGeneral,$Heading,$Prompt,$ElementType,$ValueList));
+ $f->Update();
+
+ $db =& $this->adodbConnection;
+
+ if (!$FieldLabel) $FieldLabel = $FieldName;
+ $sql = 'UPDATE '.GetTablePrefix().'SearchConfig
+ SET FieldType = '.$db->qstr($ElementType).',
+ DisplayName = '.$db->qstr('lu_fieldcustom__'.strtolower($FieldName)).',
+ FieldName = '.$db->qstr($FieldName).',
+ Description = '.$db->qstr($FieldLabel).'
+ WHERE CustomFieldId = '.$FieldId;
+ $this->adodbConnection->Execute($sql);
+
+ return $f;
+ }
+
+ function DeleteField($FieldId)
+ {
+ global $objItemTypes, $objSearchConfig;
+ //echo "<pre>"; print_r($objSearchConfig); echo "</pre>";
+ $f = $this->GetItem($FieldId);
+ $Type = $f->Get("Type");
+ $Item = $objItemTypes->GetItem($Type);
+ $Module = $Item->Get("Module");
+ if(is_object($Item))
+ {
+ //$table = $Item->Get("TableName");
+ $table = GetTablePrefix()."CustomField";
+ if(!is_object($objSearchConfig))
+ {
+ $objSearchConfig = new clsSearchConfigList($Module);
+ }
+
+ $sql = 'DELETE FROM '.$objSearchConfig->SourceTable.' WHERE CustomFieldId = '.$FieldId;
+ $this->adodbConnection->Execute($sql);
+
+ $phrase_name = 'lu_fieldcustom__'.strtolower($f->Get('FieldName'));
+ $sql = 'DELETE FROM '.GetTablePrefix().'Phrase WHERE Phrase = '.$this->adodbConnection->qstr($phrase_name);
+ $this->adodbConnection->Execute($sql);
+ }
+ $f->Delete();
+ }
+
+}/*clsCustomFieldList*/
+
+
+?>
Property changes on: branches/unlabeled/unlabeled-1.14.2/kernel/include/customfield.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/core/units/users/users_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/core/units/users/users_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/core/units/users/users_tag_processor.php (revision 6102)
@@ -0,0 +1,182 @@
+<?php
+
+ class UsersTagProcessor extends kDBTagProcessor
+ {
+
+ function LogoutLink($params)
+ {
+ $pass = Array('pass' => 'all,m,u', 'u_event' => 'OnLogout', 'm_cat_id'=>0);
+ $logout_template = $this->SelectParam($params, 'template,t');
+ return $this->Application->HREF($logout_template, '', $pass);
+ }
+
+ function UseUsernames($params)
+ {
+ return $this->Application->ConfigValue('Email_As_Login') != 1;
+ }
+
+ function RegistrationEnabled($params)
+ {
+ return $this->Application->ConfigValue('User_Allow_New') != 2;
+ }
+
+ function SuggestRegister($params)
+ {
+ return !$this->Application->LoggedIn() && !$this->Application->ConfigValue('Comm_RequireLoginBeforeCheckout') && $this->RegistrationEnabled($params);
+ }
+
+ 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='.adodb_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 > adodb_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');
+ }
+
+ function AffiliatePaymentTypeChecked($params)
+ {
+ static $checked = false;
+
+ if( $this->Application->GetVar('PaymentTypeId') )
+ {
+ $apt_object =& $this->Application->recallObject('apt.active');
+ if( $this->Application->GetVar('PaymentTypeId') == $apt_object->GetDBField('PaymentTypeId') )
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ if(!$checked)
+ {
+ $checked = true;
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ function HasError($params)
+ {
+ $res = parent::HasError($params);
+ if($this->SelectParam($params,'field,fields') == 'any')
+ {
+ $res = $res || $this->Application->GetVar('MustAgreeToTerms'); // need to do it not put module fields into kernel ! (noticed by Alex)
+ $res = $res || $this->Application->GetVar('SSNRequiredError');
+ }
+ return $res;
+ }
+
+ /**
+ * Returns login name of user
+ *
+ * @param Array $params
+ */
+ function LoginName($params)
+ {
+ $object =& $this->getObject($params);
+ return $object->GetID() != -1 ? $object->GetDBField('Login') : 'root';
+ }
+
+ }
+
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.14.2/core/units/users/users_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/core/units/general/main_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/core/units/general/main_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/core/units/general/main_event_handler.php (revision 6102)
@@ -0,0 +1,125 @@
+<?php
+
+ class MainEventHandler extends kEventHandler {
+
+
+ /**
+ * Description
+ *
+ * @var kDBConnection
+ * @access public
+ */
+ var $Conn;
+
+ /**
+ * Adds ability to address db connection
+ *
+ * @return kDBEventHandler
+ * @access public
+ */
+ function MainEventHandler()
+ {
+ parent::kBase();
+ $this->Conn =& $this->Application->GetADODBConnection();
+ }
+
+ /**
+ * Created url part for this module
+ *
+ * @param kEvent $event
+ */
+ function BuildEnv(&$event)
+ {
+ $prefix_special = $event->getPrefixSpecial();
+ $url_params = $event->getEventParam('url_params');
+
+ $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
+
+ //if pass events is off and event is not implicity passed
+ if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) )
+ {
+ $url_params[$prefix_special.'_event'] = ''; // remove event from url if requested
+ //otherwise it will use value from get_var
+ }
+
+ if(!$query_vars) return true;
+
+ $processed_params = Array();
+ foreach($query_vars as $index => $var_name)
+ {
+ //if value passed in params use it, otherwise use current from application
+ $var_name = $prefix_special.'_'.$var_name;
+ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
+ if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
+ }
+
+ $ret = '';
+ $default_language_id = $this->Application->GetDefaultLanguageId();
+ if( $processed_params['m_lang'] && ($processed_params['m_lang'] != $default_language_id) )
+ {
+ $language_name = $this->Application->getCache('language_names', $processed_params['m_lang']);
+ if ($language_name === false) {
+ $sql = 'SELECT PackName
+ FROM '.TABLE_PREFIX.'Language
+ WHERE LanguageId = '.$processed_params['m_lang'];
+ $language_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('language_names', $processed_params['m_lang'], $language_name);
+ }
+ $ret .= $language_name.'/';
+ }
+
+ $default_theme_id = $this->Application->GetDefaultThemeId();
+ if( $processed_params['m_theme'] && ($processed_params['m_theme'] != $default_theme_id) )
+ {
+ $theme_name = $this->Application->getCache('theme_names', $processed_params['m_theme']);
+ if ($theme_name === false) {
+ $sql = 'SELECT Name
+ FROM '.TABLE_PREFIX.'Theme
+ WHERE ThemeId = '.$processed_params['m_theme'];
+ $theme_name = $this->Conn->GetOne($sql);
+ $this->Application->setCache('theme_names', $processed_params['m_theme'], $theme_name);
+
+ }
+ $ret .= $theme_name.'/';
+ }
+
+ if ($processed_params['m_cat_id'] > 0) {
+ $ret .= $this->Application->getFilename('c', $processed_params['m_cat_id']).'/';
+ $url_params['category_processed'] = true;
+ }
+
+ $force_page_adding = false;
+ if (getArrayValue($url_params, 'reset'))
+ {
+ unset($url_params['reset']);
+ if ($processed_params['m_cat_id'])
+ {
+ $processed_params['m_cat_page'] = 1;
+ $force_page_adding = true;
+ }
+ }
+
+ if( $processed_params['m_cat_page'] > 1 || $force_page_adding )
+ {
+ $ret = preg_replace('/(.*)\//', '\\1', $ret).'_'.$processed_params['m_cat_page'].'/';
+ }
+
+ $template = getArrayValue($url_params, 't');
+ $category_template = $processed_params['m_cat_id'] ? $this->Application->getCache('category_templates', $processed_params['m_cat_id']) : '';
+
+ // remove template from url if it is category index cached template
+ if ($template == $category_template || strtolower($template) == '__default__') {
+ $template = '';
+ }
+
+ if ($template) {
+ $ret .= $template.'/';
+ }
+ unset($url_params['t']);
+
+ $event->setEventParam('url_params', $url_params);
+ $event->setEventParam('env_string', strtolower($ret) );
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.14.2/core/units/general/main_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline