Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 11:47 PM

in-portal

Index: branches/unlabeled/unlabeled-1.3.4/core/units/config_search/config_search_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.3.4/core/units/config_search/config_search_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.4/core/units/config_search/config_search_event_handler.php (revision 1822)
@@ -0,0 +1,141 @@
+<?php
+
+ class ConfigSearchEventHandler extends InpDBEventHandler {
+
+ /**
+ * Apply any custom changes to list's sql query
+ *
+ * @param kEvent $event
+ * @access protected
+ * @see OnListBuild
+ */
+ function SetCustomQuery(&$event)
+ {
+ $object =& $event->getObject();
+
+ $module_owner=$this->Application->GetVar('module');
+ if ($module_owner===false) {
+ $module_owner=$this->myUrlDecode($this->Application->GetVar('confs_module'));
+ $this->Application->SetVar("module", $module_owner);
+ }
+
+ $section=$this->Application->GetVar('section');
+ if ($section===false){
+ $section=$this->myUrlDecode($this->Application->GetVar('confs_section'));
+ $this->Application->SetVar("section", $section);
+ }
+
+ $object->addFilter('module_filter', '%1$s.ModuleName = "'.$module_owner.'"');
+
+ }
+
+ function OnUpdate(&$event)
+ {
+ if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) {
+ parent::OnUpdate($event);
+ }
+ $module_owner=$this->Application->GetVar('module');
+ $module_section=$this->Application->GetVar('section');
+
+ $conf_update = new kEvent( );
+ $conf_update->Init('conf');
+ $conf_update->Name = 'OnUpdate';
+ $conf_update->redirect = false;
+ $this->Application->HandleEvent($conf_update);
+
+ $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,conf'); //stay!
+
+ }
+
+ function OnCancel(&$event)
+ {
+ parent::OnCancel($event);
+ $module_owner=$this->Application->GetVar('module');
+ $module_section=$this->Application->GetVar('section');
+
+ $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,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;
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnCreateCustomField(&$event)
+ {
+ $cf_object =& $event->MasterEvent->getObject();
+
+ $is_new = $event->MasterEvent->getEventParam('IsNew');
+
+
+ $cf_search = array();
+ $cf_search['DisplayOrder'] = $cf_object->FieldValues['DisplayOrder'];
+ $cf_search['ElementType'] = $cf_object->FieldValues['ElementType'];
+ $cf_search['DisplayName'] = $cf_object->FieldValues['FieldLabel'];
+ $cf_search['FieldName'] = $cf_object->FieldValues['FieldName'];
+ $cf_search['Description'] = $cf_object->FieldValues['Prompt'];
+ $cf_search['ConfigHeader'] = 'la_Text_CustomFields';
+
+
+ $cf_search['TableName'] = "CustomField";
+ $cf_search['ModuleName'] = "In-Commerce";
+ $cf_search['ForeignField'] = "CustomMetaData.Value";
+ $cf_search['JoinClause'] = "{ForeignTable}.ResourceId={LocalTable}.ResourceId";
+
+ if($is_new)
+ {
+
+ $live_id = $this->Conn->GetOne("SELECT CustomFieldId FROM ".TABLE_PREFIX."CustomField WHERE FieldName='".$cf_search['FieldName']."'");
+
+ $cf_search['CustomFieldId'] = $live_id;
+
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $confs_item = $event->getObject();
+ $confs_item->SetFieldsFromHash($cf_search);
+ $confs_item->Create();
+
+ }else{
+
+
+ $cf_search['CustomFieldId'] = $cf_object->FieldValues['CustomFieldId'];
+
+ $search_config_id = $this->Conn->GetOne("SELECT SearchConfigId FROM ".TABLE_PREFIX."SearchConfig WHERE CustomFieldId='".$cf_object->FieldValues['CustomFieldId']."'");
+
+ $cf_search['SearchConfigId'] = $search_config_id;
+
+ $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
+ $confs_item = $event->getObject();
+ $confs_item->SetFieldsFromHash($cf_search);
+ $confs_item->Update($search_config_id);
+
+ }
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnDeleteCustomField(&$event){
+
+ $custom_field_id =&$event->MasterEvent->getEventParam('id');
+ $this->Conn->Query("DELETE FROM ".TABLE_PREFIX."SearchConfig WHERE CustomFieldId=".$custom_field_id);
+
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.4/core/units/config_search/config_search_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.4/core/admin_templates/incs/custom_blocks.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.4/core/admin_templates/incs/custom_blocks.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.4/core/admin_templates/incs/custom_blocks.tpl (revision 1822)
@@ -0,0 +1,46 @@
+<inp2:m_block name="config_edit_text" />
+ <input type="text" name="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" value="<inp2:$PrefixSpecial_Field field="$field" />" />
+<inp2:m_blockend />
+
+<inp2:m_block name="config_edit_password" />
+ <input type="password" primarytype="password" name="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" value="" />
+ <input type="password" name="verify_<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" id="verify_<inp2:$PrefixSpecial_InputName field="$field" IdField=="$IdField"/>" value="" />
+ &nbsp;<span class="error" id="error_<inp2:$PrefixSpecial_InputName field="$field"/>"></span>
+<inp2:m_blockend />
+
+<inp2:m_block name="config_edit_option" />
+ <option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
+<inp2:m_blockend />
+
+<inp2:m_block name="config_edit_select" />
+ <select name="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>">
+ <inp2:$PrefixSpecial_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="config_edit_option" selected="selected"/>
+ </select>
+<inp2:m_blockend />
+
+<inp2:m_block name="config_edit_checkbox"/>
+ <input type="hidden" id="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" name="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" value="<inp2:$PrefixSpecial_Field field="$field" db="db"/>">
+ <input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:m_param name="field"/>" <inp2:$PrefixSpecial_Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>'))">
+<inp2:m_blockend/>
+
+<inp2:m_block name="config_edit_textarea" />
+ <textarea name="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" <inp2:m_param name="field_params" />><inp2:$PrefixSpecial_Field field="$field" /></textarea>
+<inp2:m_blockend />
+
+<inp2:m_block name="config_radio_item"/>
+ <input type="radio" <inp2:m_param name="checked"/> name="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>"><label for="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
+<inp2:m_blockend/>
+
+<inp2:m_block name="config_edit_radio"/>
+ <inp2:$PrefixSpecial_PredefinedOptions field="$field" tabindex="$pass_tabindex" block="config_radio_item" selected="checked"/>
+<inp2:m_blockend/>
+
+<inp2:m_block name="edit_custom_td" />
+ <td valign="top" class="text">
+ <input type="hidden" name="<inp2:$PrefixSpecial_InputName field="ResourceId" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="ResourceId" IdField="$IdField"/>" value="<inp2:$PrefixSpecial_field field="ResourceId" grid="$grid"/>">
+ <input type="hidden" name="<inp2:$PrefixSpecial_InputName field="CustomDataId" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="CustomDataId" IdField="$IdField"/>" value="<inp2:$PrefixSpecial_field field="CustomDataId" grid="$grid"/>">
+ <!--<input size="40" type="text" name="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" id="<inp2:$PrefixSpecial_InputName field="$field" IdField="$IdField"/>" value="<inp2:$PrefixSpecial_field field="$field" grid="$grid"/>">-->
+
+ <inp2:$PrefixSpecial_ConfigFormElement field="Value" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList" />
+ </td>
+<inp2:m_blockend />
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.4/core/admin_templates/incs/custom_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_edit.tpl (revision 1822)
@@ -0,0 +1,70 @@
+<inp2:m_set nobody="yes"/>
+<inp2:m_include t="incs/header"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+<inp2:m_include t="stylesheets/stylesheets_tabs"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="stylesheets_edit" module="in-portal" icon="icon46_style"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save"/>', function() {
+ submit_event('css','<inp2:css_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel"/>', function() {
+ submit_event('css','OnCancelEdit');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev"/>', function() {
+ go_to_id('css', '<inp2:css_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next"/>', function() {
+ go_to_id('css', '<inp2:css_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if prefix="css" function="IsSingle"/>
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if prefix="css" function="IsLast"/>
+ a_toolbar.DisableButton('next');
+ <inp2:m_endif/>
+ <inp2:m_if prefix="css" function="IsFirst"/>
+ a_toolbar.DisableButton('prev');
+ <inp2:m_endif/>
+ <inp2:m_endif/>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:css_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+
+ <inp2:m_ParseBlock name="inp_id_label" prefix="css" field="StylesheetId" title="!la_fld_StylesheetId!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="css" field="Name" title="!la_fld_Name!" size="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="css" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="css" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
+ <inp2:m_ParseBlock name="inp_edit_checkbox" prefix="css" field="Enabled" title="!la_fld_Enabled!"/>
+</table>
+
+<inp2:m_include t="incs/footer"/>
+
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_tabs.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_tabs.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_tabs.tpl (revision 1822)
@@ -0,0 +1,13 @@
+<table cellpadding="0" cellspacing="0" border="0" width="100%">
+<tr>
+ <td align="right" width="100%">
+ <table cellpadding="0" cellspacing="0" border="0" height="23">
+ <tr>
+ <inp2:m_ParseBlock name="tab" title="la_tab_General" t="stylesheets/stylesheets_edit" main_prefix="css"/>
+ <inp2:m_ParseBlock name="tab" title="la_tab_BlockStyles" t="stylesheets/stylesheets_edit_block" main_prefix="css"/>
+ <inp2:m_ParseBlock name="tab" title="la_tab_BaseStyles" t="stylesheets/stylesheets_edit_base" main_prefix="css"/>
+ </tr>
+ </table>
+ </td>
+</tr>
+</table>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.4/core/admin_templates/stylesheets/stylesheets_tabs.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline