getObject(); $module_owner=$this->Application->GetVar('module'); if ($module_owner===false) { $module_owner=$this->myUrlDecode($this->Application->GetVar('conf_module')); $this->Application->SetVar("module", $module_owner); } $section=$this->Application->GetVar('section'); if ($section===false){ $section=$this->myUrlDecode($this->Application->GetVar('conf_section')); $this->Application->SetVar("section", $section); } $object->SetWhereClause('%1$s.ModuleOwner="'.$module_owner.'" AND %1$s.Section="'.$section.'"'); $object->AddOrderField('DisplayOrder', 'ASC'); } /** * Enter description here... * * @param kEvent $event */ function OnBeforeItemUpdate(&$event) { $object =& $event->getObject(); 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'))); } } } /** * 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); } } } function OnUpdate(&$event) { parent::OnUpdate($event); $module_owner=$this->Application->GetVar('module'); $section=$this->Application->GetVar('section'); $event->redirect_params = Array('opener' => 's','conf_section'=>$this->myUrlEncode($section), 'conf_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //stay! } function OnCancel(&$event) { parent::OnCancel($event); $module_owner=$this->Application->GetVar('module'); $section=$this->Application->GetVar('section'); $event->redirect_params = Array('opener' => 's','conf_section'=>$this->myUrlEncode($section), 'conf_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //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; } } ?>