Attached Files |
promo.patch [^] (40,260 bytes) 2011-09-27 12:03
[Show Content]
Index: admin/system_presets/simple/promo_blocks_promo-block.php
===================================================================
--- admin/system_presets/simple/promo_blocks_promo-block.php (revision 0)
+++ admin/system_presets/simple/promo_blocks_promo-block.php (revision 0)
@@ -0,0 +1,48 @@
+<?php
+
+ defined('FULL_PATH') or die('restricted access!');
+
+ // section removal
+ $remove_sections = Array (
+ 'in-portal:promo-blocks',
+ );
+
+ // debug only sections
+ $debug_only_sections = Array (
+
+ );
+
+ // toolbar buttons
+ $remove_buttons = Array (
+
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+
+ );
Index: admin/system_presets/simple/sections_core-sections.php
===================================================================
--- admin/system_presets/simple/sections_core-sections.php (revision 14592)
+++ admin/system_presets/simple/sections_core-sections.php (working copy)
@@ -17,5 +17,6 @@
$debug_only_sections = Array (
'in-portal:configure_advanced',
'in-portal:tools',
-
+ 'in-portal:configure_promo_blocks',
+ 'in-portal:promo_blocks',
);
Index: core/admin_templates/promo_blocks/promo_block_edit.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_edit.tpl (revision 0)
+++ core/admin_templates/promo_blocks/promo_block_edit.tpl (revision 0)
@@ -0,0 +1,189 @@
+<inp2:adm_SetPopupSize width="700" height="585"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_edit"/>
+
+<!-- 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" escape="1"/>', function() {
+ submit_event('promo-block', '<inp2:promo-block_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ cancel_edit('promo-block', 'OnCancelEdit','<inp2:promo-block_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
+ reset_form('promo-block', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('promo-block', '<inp2:promo-block_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('promo-block', '<inp2:promo-block_NextId/>');
+ }
+ ) );
+
+
+
+ a_toolbar.Render();
+
+ <inp2:m_if check="promo-block_IsSingle" >
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if check="promo-block_IsLast" >
+ a_toolbar.DisableButton('next');
+ </inp2:m_if>
+ <inp2:m_if check="promo-block_IsFirst" >
+ a_toolbar.DisableButton('prev');
+ </inp2:m_if>
+ </inp2:m_if>
+ </script>
+
+ <script type="text/javascript" src="js/swfobject.js"></script>
+ <script type="text/javascript" src="<inp2:m_Compress files='js/uploader/upload_manager.js|js/uploader/uploader.js'/>"></script>
+
+ <inp2:m_RenderElement name="ml_selector" prefix="promo-block"/>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_DefineElement name="multilang_field_caption_element">
+ <label for="<inp2:m_param name='NamePrefix'/><inp2:{$prefix}_InputName field='$field'/>">
+ <span class="<inp2:m_if check='{$prefix}_HasError' field='$field'>error-cell</inp2:m_if>"><inp2:m_if check="m_Param" name="title"><inp2:lang_Field field="LocalName"/> <inp2:m_phrase label="$title"/></inp2:m_else/><inp2:lang_Field field="LocalName"/> <inp2:m_Param name="title_text"/></inp2:m_if></span></span><inp2:m_if check="{$prefix}_IsRequired" field="$field"><span class="field-required"> *</span></inp2:m_if>:<inp2:m_if check="m_Param" name="hint_label"><span> <img src="<inp2:m_TemplatesBase/>/img/hint_icon.png" width="12" height="13" title="<inp2:m_Phrase label='$hint_label' html_escape='1'/>" alt="<inp2:m_Phrase label='$hint_label' html_escape='1'/>"/></inp2:m_if>
+ </label>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="date_field_caption_element">
+ <label for="<inp2:m_param name='NamePrefix'/><inp2:{$prefix}_InputName field='$field'/>">
+ <span class="<inp2:m_if check='{$prefix}_HasError' field='$field'>error-cell</inp2:m_if>"><inp2:m_if check="m_Param" name="title"><inp2:m_phrase label="$title"/></inp2:m_else/><inp2:m_Param name="title_text"/></inp2:m_if> <span class="small">(<inp2:promo-block_Format field="ScheduleFromDate_date" input_format="1" human="true"/>)</span></span></span><inp2:m_if check="{$prefix}_IsRequired" field="$field"><span class="field-required"> *</span></inp2:m_if>:<inp2:m_if check="m_Param" name="hint_label"><span> <img src="<inp2:m_TemplatesBase/>/img/hint_icon.png" width="12" height="13" title="<inp2:m_Phrase label='$hint_label' html_escape='1'/>" alt="<inp2:m_Phrase label='$hint_label' html_escape='1'/>"/></inp2:m_if>
+ </label>
+</inp2:m_DefineElement>
+
+<inp2:promo-block_SaveWarning name="grid_save_warning"/>
+<inp2:promo-block_ErrorWarning name="form_error_warning"/>
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="inp_id_label" prefix="promo-block" field="BlockId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block" field="Title" title="la_fld_Title" maxlength="50"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="promo-block" field="Html" title="la_fld_Text" control_options="{min_height: 60}" rows="4" cols="70"/>
+
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="Priority" title="la_fld_Order"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block" field="Status" title="la_fld_Status"/>
+
+ <inp2:m_DefineElement name="image_block">
+ <inp2:Field field="LanguageId" result_to_var="langId"/>
+ <inp2:m_RenderElement name="inp_edit_swf_upload" caption_render_as="multilang_field_caption_element" prefix="promo-block" field="l{$langId}_Image" title="!la_fld_Image!"/>
+ </inp2:m_DefineElement>
+
+ <inp2:lang_ListLanguages render_as="image_block" row_start_render_as="html:" row_end_render_as="html:"/>
+
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="CSSClassName" title="la_fld_CSSClassName"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="LinkType" title="la_fld_LinkType" onchange="select_link_type()"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="CategoryId" title="la_fld_Category" style="width: 400px;"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block" field="ExternalLink" title="la_fld_ExternalLink"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="promo-block" field="OpenInNewWindow" title="la_fld_OpenInNewWindow"/>
+
+ <inp2:m_RenderElement design="form_row" caption_render_as="date_field_caption_element" prefix="promo-block" field="ScheduleFromDate" title="!la_fld_ScheduleDate!" to_field="ScheduleToDate">
+ <td class="control-cell">
+ <inp2:m_Phrase label="la_From"/>
+ <input type="text" name="<inp2:{$prefix}_InputName field="{$field}_date"/>" id="<inp2:{$prefix}_InputName field="{$field}_date"/>" value="<inp2:{$prefix}_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
+ <img src="img/calendar_icon.gif" id="cal_img_<inp2:{$prefix}_InputName field="{$field}"/>"
+ style="cursor: pointer; margin-right: 5px"
+ title="Date selector"
+ />
+
+ <script type="text/javascript">
+ Calendar.setup({
+ inputField : "<inp2:{$prefix}_InputName field="{$field}_date"/>",
+ ifFormat : Calendar.phpDateFormat("<inp2:{$prefix}_Format field="{$field}_date" input_format="1"/>"),
+ button : "cal_img_<inp2:{$prefix}_InputName field="{$field}"/>",
+ align : "br",
+ singleClick : true,
+ showsTime : true,
+ weekNumbers : false,
+ firstDay : <inp2:m_GetConfig var="FirstDayOfWeek"/>,
+ onUpdate : function(cal) {
+ runOnChange('<inp2:$prefix_InputName field="{$field}_date"/>');
+ }
+ });
+ </script>
+ <input type="hidden" name="<inp2:{$prefix}_InputName field="{$field}_time"/>" id="<inp2:{$prefix}_InputName field="{$field}_time" input_format="1"/>" value="">
+
+
+ <inp2:m_Phrase label="la_To"/>
+ <input type="text" name="<inp2:{$prefix}_InputName field="{$to_field}_date"/>" id="<inp2:{$prefix}_InputName field="{$to_field}_date"/>" value="<inp2:{$prefix}_Field field="{$to_field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$to_field}_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
+ <img src="img/calendar_icon.gif" id="cal_img_<inp2:{$prefix}_InputName field="{$to_field}"/>"
+ style="cursor: pointer; margin-right: 5px"
+ title="Date selector"
+ />
+
+ <script type="text/javascript">
+ Calendar.setup({
+ inputField : "<inp2:{$prefix}_InputName field="{$to_field}_date"/>",
+ ifFormat : Calendar.phpDateFormat("<inp2:{$prefix}_Format field="{$to_field}_date" input_format="1"/>"),
+ button : "cal_img_<inp2:{$prefix}_InputName field="{$to_field}"/>",
+ align : "br",
+ singleClick : true,
+ showsTime : true,
+ weekNumbers : false,
+ firstDay : <inp2:m_GetConfig var="FirstDayOfWeek"/>,
+ onUpdate : function(cal) {
+ runOnChange('<inp2:$prefix_InputName field="{$to_field}_date"/>');
+ }
+ });
+ </script>
+ <input type="hidden" name="<inp2:{$prefix}_InputName field="{$to_field}_time"/>" id="<inp2:{$prefix}_InputName field="{$to_field}_time" input_format="1"/>" value="">
+
+ </td>
+ </inp2:m_RenderElement>
+
+ <inp2:m_ifnot check="promo-block_IsNewItem">
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block" field="NumberOfClicks" title="la_fld_NumberOfClicks"/>
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block" field="NumberOfViews" title="la_fld_NumberOfViews"/>
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block" field="ConversionPercent" title="la_fld_ConversionPercent"/>
+ </inp2:m_ifnot>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
+<script type="text/javascript">
+ var otpl = document.getElementById('<inp2:promo-block_InputName field="LinkType"/>');
+ var orow_category = document.getElementById('<inp2:promo-block_InputName field="CategoryId"/>').parentNode.parentNode;
+ var orow_external_link = document.getElementById('<inp2:promo-block_InputName field="ExternalLink"/>').parentNode.parentNode;
+ var orow_open_in_new_window = document.getElementById('<inp2:promo-block_InputName field="OpenInNewWindow"/>').parentNode.parentNode;
+
+ function select_link_type() {
+ if (otpl.value == 1) {
+ // internal
+ orow_category.style.display = '';
+ orow_external_link.style.display = 'none';
+ orow_open_in_new_window.style.display = 'none';
+ } else {
+ // external
+ orow_category.style.display = 'none';
+ orow_external_link.style.display = '';
+ orow_open_in_new_window.style.display = '';
+ }
+ }
+
+ select_link_type();
+</script>
+
+<inp2:m_include t="incs/footer"/>
Index: core/admin_templates/promo_blocks/promo_block_list.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_list.tpl (revision 0)
+++ core/admin_templates/promo_blocks/promo_block_list.tpl (revision 0)
@@ -0,0 +1,66 @@
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_list" />
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+ std_edit_item('promo-block', 'promo_blocks/promo_block_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
+ function() {
+ std_precreate_item('promo-block', 'promo_blocks/promo_block_edit');
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('promo-block')
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarButton('setprimary', '<inp2:m_phrase label="la_ToolTip_SetSticky" escape="1"/>', function() {
+ submit_event('promo-block', 'OnSetSticky');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_ResetCounters" escape="1"/>', function() {
+ submit_event('promo-block', 'OnResetCounters');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function edit_promoblock(doc_id)
+ {
+ set_hidden_field('promo-block[' + doc_id + ']BlockId', 'on');
+ std_edit_item('promo-block', 'promo_blocks/promo_block_edit');
+ }
+ </script>
+ </td>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="promo-block" grid="Default"/>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_DefineElement name="file_block">
+ <a target="_blank" href="<inp2:m_BaseURL/>system/images/<inp2:Field field="Image"/>"><inp2:Field field="Image"/></a>
+</inp2:m_DefineElement>
+
+<inp2:m_RenderElement name="grid" PrefixSpecial="promo-block" IdField="BlockId" grid="Default" grid_filters="1"/>
+<script type="text/javascript">
+ Grids['promo-block'].SetDependantToolbarButtons( new Array('edit','delete','setprimary','reset_edit') );
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14592)
+++ core/install/english.lang (working copy)
@@ -1495,6 +1495,47 @@
<PHRASE Label="lu_opt_AutoDetect" Module="Core" Type="1">QXV0by1EZXRlY3Q=</PHRASE>
<PHRASE Label="lu_opt_Cookies" Module="Core" Type="1">Q29va2llcw==</PHRASE>
<PHRASE Label="lu_opt_QueryString" Module="Core" Type="1">UXVlcnkgU3RyaW5nIChTSUQp</PHRASE>
+ <PHRASE Label="la_opt_FadeLinear" Module="Core" Type="1">TGluZWFy</PHRASE>
+ <PHRASE Label="la_opt_FadeSwing" Module="Core" Type="1">U3dpbmc=</PHRASE>
+ <PHRASE Label="la_config_PromoRotationDelay" Module="Core" Type="1">UHJvbW8gUm90YXRpb24gRGVsYXkgKHNlY29uZHMp</PHRASE>
+ <PHRASE Label="la_config_PromoTransitionControls" Module="Core" Type="1">UHJvbW8gVHJhbnNpdGlvbiBDb250cm9scw==</PHRASE>
+ <PHRASE Label="la_config_PromoTransitionEffect" Module="Core" Type="1">UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3Q=</PHRASE>
+ <PHRASE Label="la_config_PromoTransitionTime" Module="Core" Type="1">VHJhbnNpdGlvbiBEZWxheSAoc2Vjb25kcyk=</PHRASE>
+ <PHRASE Label="la_Text_PromoSettings" Module="Core" Type="1">UHJvbW8gU2V0dGluZ3M=</PHRASE>
+ <PHRASE Label="la_fld_Text" Module="Core" Type="1">VGV4dA==</PHRASE>
+ <PHRASE Label="la_fld_OpenInNewWindow" Module="Core" Type="1">T3BlbiBJbiBOZXcgV2luZG93</PHRASE>
+ <PHRASE Label="la_fld_ExternalLink" Module="Core" Type="1">RXh0ZXJuYWwgTGluaw==</PHRASE>
+ <PHRASE Label="la_fld_ConversionPercent" Module="Core" Type="1">Q1RSLCAl</PHRASE>
+ <PHRASE Label="la_col_ConversionPercent" Module="Core" Type="1">Q1RSLCAl</PHRASE>
+ <PHRASE Label="la_ToolTip_SetSticky" Module="Core" Type="1">U2V0IFN0aWNreQ==</PHRASE>
+ <PHRASE Label="la_ToolTip_ResetCounters" Module="Core" Type="1">UmVzZXQgQ291bnRlcnM=</PHRASE>
+ <PHRASE Label="la_tab_PromoBlocks" Module="Core" Type="1">UHJvbW8gQmxvY2tz</PHRASE>
+ <PHRASE Label="la_col_Id" Module="Core" Type="1">SUQ=</PHRASE>
+ <PHRASE Label="la_col_Title" Module="Core" Type="1">VGl0bGU=</PHRASE>
+ <PHRASE Label="la_col_Status" Module="Core" Type="1">U3RhdHVz</PHRASE>
+ <PHRASE Label="la_col_Sticky" Module="Core" Type="1">U3RpY2t5</PHRASE>
+ <PHRASE Label="la_col_ConversionPercent" Module="Core" Type="1">Q1RSLCAl</PHRASE>
+ <PHRASE Label="la_col_CSSClassName" Module="Core" Type="1">Q1NTIENsYXNzIE5hbWU=</PHRASE>
+ <PHRASE Label="la_col_LinkType" Module="Core" Type="1">TGluayBUeXBl</PHRASE>
+ <PHRASE Label="la_col_Category" Module="Core" Type="1">U2VjdGlvbg==</PHRASE>
+ <PHRASE Label="la_col_ExternalLink" Module="Core" Type="1">RXh0ZXJuYWwgTGluaw==</PHRASE>
+ <PHRASE Label="la_col_ScheduleFromDate" Module="Core" Type="1">U2NoZWR1bGUgRnJvbSBEYXRl</PHRASE>
+ <PHRASE Label="la_col_ScheduleToDate" Module="Core" Type="1">U2NoZWR1bGUgVG8gRGF0ZQ==</PHRASE>
+ <PHRASE Label="la_col_NumberOfClicks" Module="Core" Type="1">TnVtYmVyIE9mIENsaWNrcw==</PHRASE>
+ <PHRASE Label="la_col_NumberOfViews" Module="Core" Type="1">TnVtYmVyIE9mIFZpZXdz</PHRASE>
+ <PHRASE Label="la_col_Order" Module="Core" Type="1">T3JkZXI=</PHRASE>
+ <PHRASE Label="la_title_AddingPromoBlock" Module="Core" Type="1">QWRkaW5nIFByb21vIEJsb2Nr</PHRASE>
+ <PHRASE Label="la_title_EditingPromoBlock" Module="Core" Type="1">RWRpdGluZyBQcm9tbyBCbG9jaw==</PHRASE>
+ <PHRASE Label="la_fld_Text" Module="Core" Type="1">VGV4dA==</PHRASE>
+ <PHRASE Label="la_fld_Order" Module="Core" Type="1">T3JkZXI=</PHRASE>
+ <PHRASE Label="la_fld_CSSClassName" Module="Core" Type="1">Q1NTIENsYXNzIE5hbWU=</PHRASE>
+ <PHRASE Label="la_fld_LinkType" Module="Core" Type="1">TGluayBUeXBl</PHRASE>
+ <PHRASE Label="la_fld_ExternalLink" Module="Core" Type="1">RXh0ZXJuYWwgTGluaw==</PHRASE>
+ <PHRASE Label="la_fld_ScheduleDate" Module="Core" Type="1">U2NoZWR1bGUgRGF0ZQ==</PHRASE>
+ <PHRASE Label="la_fld_OpenInNewWindow" Module="Core" Type="1">T3BlbiBJbiBOZXcgV2luZG93</PHRASE>
+ <PHRASE Label="la_From" Module="Core" Type="1">RnJvbQ==</PHRASE>
+ <PHRASE Label="la_To" Module="Core" Type="1">dG8=</PHRASE>
+ <PHRASE Label="la_title_PromoBlocks" Module="Core" Type="1">UHJvbW8gQmxvY2tz</PHRASE>
</PHRASES>
<EVENTS>
<EVENT MessageType="html" Event="CATEGORY.ADD" Type="0">U3ViamVjdDogTmV3IENhdGVnb3J5ICI8aW5wMjpjX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIC0gQWRkZWQKCllvdXIgc3VnZ2VzdGVkIGNhdGVnb3J5ICI8aW5wMjpjX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGhhcyBiZWVuIGFkZGVkLg==</EVENT>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14592)
+++ core/install/install_data.sql (working copy)
@@ -131,6 +131,12 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CategoriesRebuildSerial', '0', 'In-Portal', '', '', '', '', NULL, NULL, 0, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '2', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 2, 1, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'swing', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'swing=la_opt_FadeSwing||linear=la_opt_FadeLinear', 10.04, 2, 1, NULL);
+
+
INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 14592)
+++ core/install/install_schema.sql (working copy)
@@ -1186,4 +1186,34 @@
KEY ExternalUrl (ExternalUrl),
KEY RedirectOnIPMatch (RedirectOnIPMatch),
KEY Priority (Priority)
-);
\ No newline at end of file
+);
+
+CREATE TABLE PromoBlocks (
+ BlockId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(50) NOT NULL DEFAULT '',
+ Priority int(11) NOT NULL DEFAULT '0',
+ Status tinyint(1) NOT NULL DEFAULT '0',
+ l1_Image varchar(255) NOT NULL DEFAULT '',
+ l2_Image varchar(255) NOT NULL DEFAULT '',
+ l3_Image varchar(255) NOT NULL DEFAULT '',
+ l4_Image varchar(255) NOT NULL DEFAULT '',
+ l5_Image varchar(255) NOT NULL DEFAULT '',
+ CSSClassName varchar(255) NOT NULL DEFAULT '',
+ LinkType tinyint(1) NOT NULL DEFAULT '1',
+ CategoryId int(11) NOT NULL DEFAULT '0',
+ ExternalLink varchar(255) NOT NULL DEFAULT '',
+ OpenInNewWindow tinyint(3) unsigned NOT NULL DEFAULT '0',
+ ScheduleFromDate int(11) DEFAULT NULL,
+ ScheduleToDate int(11) DEFAULT NULL,
+ NumberOfClicks int(11) NOT NULL DEFAULT '0',
+ NumberOfViews int(11) NOT NULL DEFAULT '0',
+ Sticky tinyint(1) NOT NULL DEFAULT '0',
+ Html text,
+ l1_Html text,
+ l2_Html text,
+ l3_Html text,
+ l4_Html text,
+ l5_Html text,
+ PRIMARY KEY (BlockId),
+ KEY OpenInNewWindow (OpenInNewWindow)
+);
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14592)
+++ core/install/upgrades.sql (working copy)
@@ -2105,4 +2105,39 @@
UPDATE Category
SET DirectLinkAuthKey = SUBSTRING( MD5( CONCAT(CategoryId, ':', ParentId, ':', l<%PRIMARY_LANGUAGE%>_Name, ':b38') ), 1, 20)
-WHERE DirectLinkAuthKey = '';
\ No newline at end of file
+WHERE DirectLinkAuthKey = '';
+
+CREATE TABLE PromoBlocks (
+ BlockId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(50) NOT NULL DEFAULT '',
+ Priority int(11) NOT NULL DEFAULT '0',
+ Status tinyint(1) NOT NULL DEFAULT '0',
+ l1_Image varchar(255) NOT NULL DEFAULT '',
+ l2_Image varchar(255) NOT NULL DEFAULT '',
+ l3_Image varchar(255) NOT NULL DEFAULT '',
+ l4_Image varchar(255) NOT NULL DEFAULT '',
+ l5_Image varchar(255) NOT NULL DEFAULT '',
+ CSSClassName varchar(255) NOT NULL DEFAULT '',
+ LinkType tinyint(1) NOT NULL DEFAULT '1',
+ CategoryId int(11) NOT NULL DEFAULT '0',
+ ExternalLink varchar(255) NOT NULL DEFAULT '',
+ OpenInNewWindow tinyint(3) unsigned NOT NULL DEFAULT '0',
+ ScheduleFromDate int(11) DEFAULT NULL,
+ ScheduleToDate int(11) DEFAULT NULL,
+ NumberOfClicks int(11) NOT NULL DEFAULT '0',
+ NumberOfViews int(11) NOT NULL DEFAULT '0',
+ Sticky tinyint(1) NOT NULL DEFAULT '0',
+ Html text,
+ l1_Html text,
+ l2_Html text,
+ l3_Html text,
+ l4_Html text,
+ l5_Html text,
+ PRIMARY KEY (BlockId),
+ KEY OpenInNewWindow (OpenInNewWindow)
+);
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '2', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 2, 1, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'swing', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'swing=la_opt_FadeSwing||linear=la_opt_FadeLinear', 10.04, 2, 1, NULL);
Index: core/units/promo_blocks/promo_block_eh.php
===================================================================
--- core/units/promo_blocks/promo_block_eh.php (revision 0)
+++ core/units/promo_blocks/promo_block_eh.php (revision 0)
@@ -0,0 +1,236 @@
+<?php
+
+class PromoBlockEventHandler extends kDBEventHandler {
+
+
+ function mapPermissions()
+ {
+ parent::mapPermissions();
+ $permissions = Array(
+ // user can view any form on front-end
+ 'OnSetSticky' => Array ('self' => 'view'),
+ 'OnRegisterView' => Array ('self' => true),
+ 'OnFollowLink' => Array ('self' => true),
+ 'OnResetCounters' => Array ('self' => 'add|edit'),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ if ($event->Special == 'home') {
+ $object->addFilter('status_filter', '%1$s.Status = 1 AND (ScheduleFromDate IS NULL OR ScheduleFromDate <= UNIX_TIMESTAMP()) AND (ScheduleToDate IS NULL OR ScheduleToDate >= UNIX_TIMESTAMP())');
+ }
+ }
+
+
+ /**
+ * Updates structure config
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ $category_helper =& $this->Application->recallObject('CategoryHelper');
+ /* @var $category_helper CategoryHelper */
+
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+
+ $fields['CategoryId']['default'] = '';
+ $fields['CategoryId']['options'] = $category_helper->getStructureTreeAsOptions();
+
+ // images multilang fields
+ $a_image = Array(
+ 'type' => 'string',
+ 'max_len' => 255,
+ 'formatter' => 'kUploadFormatter',
+ 'upload_dir' => IMAGES_PATH,
+ 'not_null' => 1,
+ 'default' => '',
+ 'multiple' => 1,
+ 'required' => 1,
+ 'direct_links' => 1,
+ 'file_types' => '*.jpg;*.gif;*.png',
+ 'files_description' => '!la_Image_Files!',
+ );
+
+ // get active languages
+ $sql = 'SELECT LanguageId
+ FROM '.TABLE_PREFIX.'Language';
+ $a_languages = $this->Conn->GetCol($sql);
+
+ foreach ($a_languages AS $lang_id) {
+ $fields['l'.$lang_id.'_Image'] = $a_image;
+ }
+
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+ }
+
+ /**
+ * Set's block as sticky
+ *
+ * @param kEvent $event
+ */
+ function OnSetSticky(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ $this->StoreSelectedIDs($event);
+ $ids=$this->getSelectedIDs($event);
+ if($ids)
+ {
+ $id = array_shift($ids);
+ $table_info = $object->getLinkedInfo();
+
+ $this->Conn->Query('UPDATE '.$object->TableName.' SET Sticky = 0 ');
+ $this->Conn->Query('UPDATE '.$object->TableName.' SET Sticky = 1, Status = 1 WHERE BlockId = '.$id.' ');
+ }
+ $event->redirect_params = Array('opener' => 's'); //stay!
+ }
+
+
+ /**
+ * Set Required fields
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+ $this->_checkScheduleDates($event);
+ }
+
+ /**
+ * Set Required fields
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+ $this->_checkScheduleDates($event);
+ }
+
+
+ /**
+ * Schedule dates
+ *
+ * @param kEvent $event
+ */
+ function _checkScheduleDates(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+ $date_from = $object->GetDBField('ScheduleFromDate_date');
+ $date_to = $object->GetDBField('ScheduleToDate_date');
+ if (is_null($date_from) || is_null($date_to)) {
+ return;
+ }
+ if ($date_from >= $date_to) {
+ $object->SetError('ScheduleFromDate_date', 'wrong_date_interval', 'la_ToDateMustBeGreaterThanFromDate');
+ }
+ }
+
+ /**
+ * Registers view of the promo block
+ *
+ * @param kEvent $event
+ */
+ function OnRegisterView(&$event)
+ {
+ $this->_incrementField($event, 'NumberOfViews');
+ }
+
+ /**
+ * Registers click on the promo block
+ *
+ * @param kEvent $event
+ */
+ function OnFollowLink(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $this->_incrementField($event, 'NumberOfClicks', false);
+
+ if ($object->GetDBField('LinkType') == 1) { // Internal
+ $sql = 'SELECT NamedParentPath
+ FROM ' . TABLE_PREFIX . 'Category
+ WHERE CategoryId = ' . $object->GetDBField('CategoryId');
+ $event->redirect = $this->Conn->GetOne($sql);
+
+ $event->SetRedirectParam('pass', 'm');
+ }
+ else {
+ $ext_url = $object->GetDBField('ExternalLink');
+ $event->redirect = 'external:' . (preg_match('/^(http|ftp):\\/\\/.*/', $ext_url) ? $ext_url : $this->Application->BaseURL().$ext_url);
+ }
+ }
+
+ /**
+ * Incrmenet given promo block counters
+ *
+ * @param kEvent $event
+ * @param string $field
+ * @param bool $is_ajax
+ */
+ function _incrementField(&$event, $field, $is_ajax = true)
+ {
+ if ( $is_ajax ) {
+ $event->status = erSTOP;
+
+ if ( $this->Application->GetVar('ajax') != 'yes' ) {
+ return ;
+ }
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ( !$object->isLoaded() ) {
+ echo 'FAILED';
+ return ;
+ }
+
+ // don't use kDBItem::Update to support concurrent view updates from different visitors
+ $sql = 'UPDATE ' . $object->TableName . '
+ SET ' . $field . ' = ' . $field . ' + 1
+ WHERE ' . $object->IDField . ' = ' . $object->GetID();
+ $this->Conn->Query($sql);
+
+ echo 'OK';
+ }
+
+ /**
+ * Resets promo block counters
+ *
+ * @param kEvent $event
+ */
+ function OnResetCounters(&$event)
+ {
+ $object =& $event->getObject( Array ('skip_autoload' => true) );
+ /* @var $object kDBItem */
+
+ $ids = $this->StoreSelectedIDs($event);
+
+ foreach ($ids as $id) {
+ $object->Load($id);
+ $object->SetDBField('NumberOfViews', 0);
+ $object->SetDBField('NumberOfClicks', 0);
+ $object->Update();
+ }
+
+ $this->clearSelectedIDs($event);
+ }
+}
Index: core/units/promo_blocks/promo_block_tp.php
===================================================================
--- core/units/promo_blocks/promo_block_tp.php (revision 0)
+++ core/units/promo_blocks/promo_block_tp.php (revision 0)
@@ -0,0 +1,34 @@
+<?php
+
+class PromoBlockTagProcessor extends kDBtagProcessor {
+
+ function PromoLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $url_params = Array (
+ $this->Prefix . '_event' => 'OnFollowLink',
+ 'pass' => 'm,' . $this->Prefix,
+ '__NO_REWRITE__' => 1,
+ );
+
+ return $this->Application->HREF('index', '', $url_params);
+ }
+
+ /**
+ * Checks, that link should be opened in new window
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function LinkInNewWindow($params)
+ {
+ $object =& $this->getObject($params);
+
+ if ($object->GetDBField('LinkType') == 1) { // Internal
+ return false;
+ }
+
+ return $object->GetDBField('OpenInNewWindow');
+ }
+}
Index: core/units/promo_blocks/promo_blocks_config.php
===================================================================
--- core/units/promo_blocks/promo_blocks_config.php (revision 0)
+++ core/units/promo_blocks/promo_blocks_config.php (revision 0)
@@ -0,0 +1,178 @@
+<?php
+
+ $config = Array (
+ 'Prefix' => 'promo-block',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'PromoBlockEventHandler', 'file' => 'promo_block_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'PromoBlockTagProcessor', 'file' => 'promo_block_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'BlockId',
+
+ 'TableName' => TABLE_PREFIX.'PromoBlocks',
+
+ 'TitleField' => 'Title',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('promo-block' => '!la_title_AddingPromoBlock!'),
+ 'edit_status_labels' => Array ('promo-block' => '!la_title_EditingPromoBlock!'),
+ ),
+
+ 'promo_block_list' => Array ('prefixes' => Array ('promo-block_List'), 'format' => "!la_tab_PromoBlocks! (#promo-block_recordcount#)"),
+ 'promo_block_edit' => Array ('prefixes' => Array ('promo-block'), 'format' => "#promo-block_status# '#promo-block_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:promo_blocks'),
+
+ 'Sections' => Array (
+ 'in-portal:promo_blocks' => Array(
+ 'parent' => 'in-portal:site',
+ 'icon' => 'custom',
+ 'label' => 'la_tab_PromoBlocks',
+ 'url' => Array('t' => 'promo_blocks/promo_block_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'ConversionPercent' => 'IF(%1$s.NumberOfViews > 0, NumberOfClicks / NumberOfViews * 100, NULL)',
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('Priority' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'BlockId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array (
+ 'type' => 'string',
+ 'not_null' => 1,
+ 'default' => '',
+ 'max_len' => 50,
+ ),
+ 'Status' => Array (
+ 'type' => 'int',
+ 'not_null' => 1,
+ 'default' => 1,
+ 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'),
+ 'use_phrases' => 1,
+ ),
+ 'Priority' => Array(
+ 'type' => 'int', 'not_null' => 1,
+ 'formatter' => 'kOptionsFormatter',
+ 'options' => array(),
+ 'required' => 1, 'default' => 0
+ ),
+ 'Sticky' => Array (
+ 'type' => 'int',
+ 'not_null' => 1,
+ 'default' => 0,
+ 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1,
+ ),
+ 'CSSClassName' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(
+ 'promo-orange' => 'Orange',
+ 'promo-green' => 'Green',
+ 'promo-blue' => 'Blue',
+ ),
+ 'not_null' => 1,
+ 'default' => '',
+ ),
+ 'LinkType' => Array (
+ 'type' => 'int',
+ 'not_null' => 1,
+ 'required' => 1,
+ 'default' => 0,
+ 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Internal', 2 => 'la_External'),
+ 'use_phrases' => 1,
+ ),
+ 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'not_null' => 1, 'default' => 1),
+ 'ExternalLink' => Array(
+ 'type' => 'string',
+ 'not_null' => 1,
+ 'default' => '',
+ ),
+ 'OpenInNewWindow' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 0
+ ),
+ 'ScheduleFromDate' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kDateFormatter',
+ 'default' => null,
+ 'time_format' => '',
+ 'input_time_format' => '',
+ ),
+ 'ScheduleToDate' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kDateFormatter',
+ 'default' => null,
+ 'time_format' => '',
+ 'input_time_format' => '',
+ 'error_field' => 'ScheduleFromDate',
+ ),
+ 'NumberOfClicks' => Array (
+ 'type' => 'int',
+ 'default' => 0,
+ 'not_null' => 1,
+ ),
+ 'NumberOfViews' => Array (
+ 'type' => 'int',
+ 'default' => 0,
+ 'not_null' => 1,
+ ),
+ 'Html' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null),
+ ),
+
+ 'VirtualFields' => Array(
+ 'ConversionPercent' => Array('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.0f', 'default' => NULL),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Fields' => Array (
+ 'BlockId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
+ 'Title' => Array ('title' => 'la_col_Title', 'filter_block' => 'grid_like_filter', ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', ),
+ 'Priority' => Array ('title' => 'la_col_Order', 'filter_block' => 'grid_range_filter', ),
+ 'Sticky' => Array ('title' => 'la_col_Sticky', 'filter_block' => 'grid_options_filter', ),
+ 'CSSClassName' => Array ('title' => 'la_col_CSSClassName', 'filter_block' => 'grid_options_filter', ),
+ 'LinkType' => Array ('title' => 'la_col_LinkType', 'filter_block' => 'grid_options_filter', ),
+ 'CategoryId' => Array ('title' => 'la_col_Category', 'filter_block' => 'grid_options_filter', ),
+ 'ExternalLink' => Array ('title' => 'la_col_ExternalLink', 'filter_block' => 'grid_like_filter', ),
+ 'ScheduleFromDate' => Array ('title' => 'la_col_ScheduleFromDate', 'filter_block' => 'grid_date_range_filter', ),
+ 'ScheduleToDate' => Array ('title' => 'la_col_ScheduleToDate', 'filter_block' => 'grid_date_range_filter', ),
+ 'NumberOfClicks' => Array ('title' => 'la_col_NumberOfClicks', 'filter_block' => 'grid_range_filter', ),
+ 'NumberOfViews' => Array ('title' => 'la_col_NumberOfViews', 'filter_block' => 'grid_range_filter', ),
+ 'ConversionPercent' => Array ('title' => 'la_col_ConversionPercent', 'filter_block' => 'grid_range_filter', ),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: core/units/sections/sections_config.php
===================================================================
--- core/units/sections/sections_config.php (revision 14592)
+++ core/units/sections/sections_config.php (working copy)
@@ -182,6 +182,16 @@
'type' => stTREE,
),
+ 'in-portal:configure_promo_blocks' => Array (
+ 'parent' => 'in-portal:website_setting_folder',
+ 'icon' => 'custom',
+ 'label' => 'la_title_PromoBlocks',
+ 'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array ('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
// "Tools" section
'in-portal:tools' => Array (
'parent' => 'in-portal:root',
promo_theme.patch [^] (10,959 bytes) 2011-09-27 12:03
[Show Content]
Index: designs/default_design.des.tpl
===================================================================
--- designs/default_design.des.tpl (revision 14592)
+++ designs/default_design.des.tpl (working copy)
@@ -71,6 +71,57 @@
<div id="content-main">
<div class="movable-area">
+
+ <div class="new-row top-margined" id="promo">
+ <inp2:m_DefineElement name="promo_first_image">
+ <div class="left-column">
+ <a id="promo_link" rel="nofollow" href="<inp2:PromoLink/>" promo_id="<inp2:Field name='BlockId'/>" target="<inp2:m_if check='LinkInNewWindow'>_blank<inp2:m_else/>_self</inp2:m_if>"><img class="bottom" src="<inp2:Field name="l1_Image" format="full_url"/>" <inp2:Field name="l1_Image" format="img_size"/> alt="<inp2:Field name="Title" html_escape="1"/>"/></a>
+ </div>
+ <div class="promo-back-container <inp2:Field name="CSSClassName" db="1"/>" style="<inp2:m_ifnot check="m_ConfigEquals" var="PromoTransitionControls" value="1">display:none;</inp2:m_ifnot>"></div>
+ <div id="promo_right_box" class="promo-choice <inp2:Field name="CSSClassName" db="1"/>" style="<inp2:m_ifnot check="m_ConfigEquals" var="PromoTransitionControls" value="1">display:none;</inp2:m_ifnot>">
+ <script type="text/javascript">var current_promo = <inp2:m_Param name="num"/>;</script>
+ </inp2:m_DefineElement>
+ <inp2:promo-block_PrintList render_as="promo_first_image" limit="1"/>
+ <div class="corner-wrap t r"><div class="corner transp-corner"></div></div>
+ <div style="height: 100%; overflow: hidden;<inp2:m_ifnot check="m_ConfigEquals" var="PromoTransitionControls" value="1">display:none;</inp2:m_ifnot>">
+ <div id="promo_selector" class="promo-selector">
+ <div class="promo-left-ear"></div>
+ <div class="promo-middle" style="width: 240px"></div>
+ <div class="promo-right-ear"></div>
+ </div>
+ <div style="padding-left: 40px; padding-top: 50px;">
+ <inp2:m_DefineElement name="promo_item">
+ <div id="promo_title<inp2:m_Param name="num"/>" class="promo-item"><inp2:Field name="Title" html_escape="1"/></div>
+ </inp2:m_DefineElement>
+ <inp2:promo-block.home_PrintList render_as="promo_item"/>
+ </div>
+ </div>
+ <div class="corner-wrap b r"><div class="corner transp-corner"></div></div>
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ //<![CDATA[
+ <inp2:m_DefineElement name="promo_json">
+ <inp2:m_Param name="num"/>: {
+ id: '<inp2:Field name="BlockId" js_escape="1"/>',
+ image: '<inp2:Field name="l1_Image" format="full_url" js_escape="1"/>',
+ name: '<inp2:Field name="Title" js_escape="1" html_escape="1"/>',
+ rightClass: '<inp2:Field name="CSSClassName" db="1" js_escape="1"/>',
+ promoLink: '<inp2:PromoLink js_escape="1"/>',
+ openInNewWindow: <inp2:m_if check="LinkInNewWindow">true<inp2:m_else/>false</inp2:m_if>,
+ viewed: false
+ }<inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
+ </inp2:m_DefineElement>
+ var promo_blocks = {<inp2:promo-block.home_PrintList render_as="promo_json"/>};
+ var promo_speed = <inp2:m_GetConfig var="PromoRotationDelay"/> * 1000;
+ var promo_transition_effect = <inp2:m_GetConfig var="PromoTransitionTime"/> * 1000;
+ var promo_transition_controls = '<inp2:m_GetConfig var="PromoTransitionControls"/>';
+ var $promo_stats_url = '<inp2:m_Link promo-block_id="#ID#" promo-block_event="#EVENT#" __NO_REWRITE__="1" pass="m,promo-block" no_amp="1" js_escape="1"/>';
+ //]]>
+ </script>
+
+
<inp2:m_RenderElement name="content"/>
</div>
Index: inc/content.css
===================================================================
--- inc/content.css (revision 14592)
+++ inc/content.css (working copy)
@@ -213,3 +213,93 @@
float: left;
width: 245px;
}
+
+/** ======= START Promo block =============== **/
+.promo-choice {
+ float: right;
+ height: 218px;
+ width: 329px;
+ position: relative;
+}
+
+.promo-back-container {
+ height: 218px;
+ width: 329px;
+ position: absolute;
+ display: none;
+}
+
+.promo-orange {
+ background: #f49d13 url(../img/homepromo_orange_grad.gif) repeat-x;
+}
+
+.promo-green {
+ background: #75af02 url(../img/homepromo_green_grad.gif) repeat-x;
+}
+
+.promo-blue {
+ background: #05b3d3 url(../img/homepromo_blue_grad.gif) repeat-x;
+}
+
+.promo-shadow-right {
+ background-color: #878787;
+ float: left;
+ margin-top: 1px;
+ height: 217px;
+ width: 1px;
+}
+
+.promo-shadow-bottom {
+ clear: left;
+ background-color: #878787;
+ margin-left: 4px;
+ height: 1px;
+ width: 647px;
+}
+
+.promo-item {
+ color: #fff;
+ font-size: 1.25em;
+ font-weight: bold;
+ height: 28px;
+ z-index: 10;
+ position: relative;
+ cursor: pointer;
+}
+
+.promo-item.active {
+ color: #1b91b1;
+ height: 28px;
+}
+
+.promo-selector {
+ position: absolute;
+ overflow: hidden;
+ float: left;
+ left: 30px;
+ top: 0px;
+ display: none;
+}
+
+.promo-left-ear {
+ background: transparent url(../img/promo_ears.png) top left no-repeat;
+ width: 14px;
+ height: 28px;
+ position: relative;
+ float: left;
+}
+
+.promo-middle {
+ height: 28px;
+ background: #fff;
+ float: left;
+}
+
+.promo-right-ear {
+ background: transparent url(../img/promo_ear_r.png) top right no-repeat;
+ width: 14px;
+ height: 28px;
+ position: relative;
+ float: left;
+}
+/** ======= END Promo block =============== **/
Index: inc/general.js
===================================================================
--- inc/general.js (revision 14592)
+++ inc/general.js (working copy)
@@ -76,4 +76,166 @@
return false;
});
-});
\ No newline at end of file
+ if ($('#promo').length) {
+ initPromo();
+ }
+
+});
+
+function register_promo_view (target_num) {
+ var $block_id = promo_blocks[target_num].id;
+
+ if ( !promo_blocks[target_num].viewed ) {
+ promo_blocks[target_num].viewed = true;
+
+ $.get( $promo_stats_url.replace('#ID#', $block_id).replace('#EVENT#', 'OnRegisterView') );
+ }
+}
+
+function switchPromo(target_num, quick) {
+
+ register_promo_view(target_num);
+
+ var target = $('#promo_title' + target_num);
+ var current = $('#promo_title' + current_promo);
+
+ /*if (target_num == 1 && current_promo == 4) {
+ quick = 1;
+ }*/
+
+ var duration = promo_transition_effect;
+ if ($('#promo_selector').css('display') == 'none') {
+ duration = 1;
+ }
+
+ var target_top = target.position().top - 6;
+
+ $('#promo_selector:hidden').css('top', target_top);
+
+ if (quick) {
+ $('#promo_selector').stop().show();
+ fadeImg($('#promo_link img:visible'), promo_blocks[target_num].image, duration, null, target_num);
+ if (promo_transition_controls == '1') {
+ fadeBackground('.promo-back-container:visible', promo_blocks[target_num].rightClass, duration);
+ }
+ $('#promo_selector').css('top', target_top).show();
+ target.animate({color: '#1b91b1'}, duration/2);
+
+// $('#promo_selector').stop().show().fadeOut(duration/2, function() {
+// fadeImg($('#promo_link img:visible'), promo_blocks[target_num].image, duration, null, target_num);
+// fadeBackground('.promo-back-container:visible', promo_blocks[target_num].rightClass, duration);
+// $(this).css('top', target_top).show(); //fadeIn(duration)
+// target.animate({color: '#1b91b1'}, duration/2);
+// } );
+
+ current.animate({color: '#fff'}, duration/2);
+ }
+ else {
+ current.animate({color: '#fff'}, duration/2);
+ $('#promo_selector').stop().show().animate( { top: target_top }, duration, '', function() {
+
+ } );
+ target.animate({color: '#1b91b1'}, duration);
+ fadeImg($('#promo_link img:visible'), promo_blocks[target_num].image, duration, null, target_num)
+ if (promo_transition_controls == '1') {
+ fadeBackground('.promo-back-container:visible', promo_blocks[target_num].rightClass, duration);
+ }
+ }
+ $('.corner-wrap .transp-corner').css('display', 'block').css('z-index', 10); // this is for IE6 to re-render the corners, otherwise they are left on old position
+ $('#promo_link').attr('href', promo_blocks[target_num].promoLink);
+ $('#promo_link').attr('target', promo_blocks[target_num].openInNewWindow ? '_blank' : '_self');
+ $('#promo_link').attr('promo_id', promo_blocks[target_num].id);
+ current_promo = parseInt(target_num);
+}
+
+function fadeImg(img, target_src, duration, callback, target_num)
+{
+ if ($(img).attr('src') == target_src) return;
+
+ var the_img = $(img);
+
+ tmp = $('[src='+target_src+']', img.parentNode);
+ if (!tmp.length) {
+ var tmp = the_img.clone().css({position: 'absolute', display: 'none'}).attr('src', target_src);
+ the_img.before(tmp);
+ }
+ tmp.fadeIn(duration, 'linear', callback).attr('alt', promo_blocks[target_num].name);
+ the_img.fadeOut(duration, 'linear');
+}
+
+function fadeBackground(elem, targetClass, duration)
+{
+ if ($(elem+':visible').hasClass(targetClass)) {
+ $('.corner-wrap .transp-corner').css('display', 'none').css('display', 'block'); // this is for IE6 to re-render the corners, otherwise they are left on old position
+ return;
+ }
+
+ var the_elem = $(elem);
+
+ tmp = $('.'+targetClass, the_elem[0].parentNode);
+ if (!tmp.length) {
+ if (promo_transition_controls == '1') {
+ var tmp = the_elem.clone().empty().css({display: 'none'}).removeClass().addClass('promo-back-container '+targetClass);
+ the_elem.after(tmp);
+ }
+ }
+ tmp.fadeIn(duration, function() {
+ $('.corner-wrap').css('display', 'none').css('display', 'block'); // this is for IE6 to re-render the corners, otherwise they are left on old position
+ });
+ the_elem.fadeOut(duration, function() {
+ $('.corner-wrap').css('display', 'none').css('display', 'block'); // this is for IE6 to re-render the corners, otherwise they are left on old position
+ });
+}
+
+var promo_interval = null;
+var promo_count = 0;
+
+function startPromo()
+{
+ promo_interval = window.setInterval(
+ function() {
+ var next_num = current_promo+1;
+ if (next_num > promo_count) {
+ next_num = 1;
+ switchPromo(next_num, 1);
+ }
+ else {
+ switchPromo(next_num);
+ }
+ },
+ promo_speed)
+}
+
+function initPromo()
+{
+ pos = $('#promo_right_box').position();
+ w = $('#promo_right_box').width();
+ h = $('#promo_right_box').height();
+ if (promo_transition_controls == '1') {
+ $('.promo-back-container').css({left: pos.left, top: pos.top, width: w, height: h}).show();
+ $('#promo_right_box').removeClass().addClass('promo-choice');
+ }
+ // preload images and count promo_block
+ for (var i in promo_blocks) {
+ $("<img>").attr("src", promo_blocks[i].image);
+ promo_count++;
+ }
+ switchPromo(1);
+
+ $('.promo-item').click(function() {
+ switchPromo(this.id.replace(/^promo_title/, ''));
+ });
+
+ startPromo();
+
+ $(window).resize(function() {
+ $('.promo-back-container').css('left', $('#promo_right_box').position().left)
+ })
+
+ $('#promo')
+ .mouseover(function() {
+ clearInterval(promo_interval);
+ })
+ .mouseout(startPromo);
+}
+
promo_blocks_core_v2.patch [^] (60,181 bytes) 2011-12-08 08:39
[Show Content]
Index: admin/system_presets/simple/promo_blocks_promo-block.php
===================================================================
--- admin/system_presets/simple/promo_blocks_promo-block.php (revision 0)
+++ admin/system_presets/simple/promo_blocks_promo-block.php (revision 0)
@@ -0,0 +1,48 @@
+<?php
+
+ defined('FULL_PATH') or die('restricted access!');
+
+ // section removal
+ $remove_sections = Array (
+ 'in-portal:promo-blocks',
+ );
+
+ // debug only sections
+ $debug_only_sections = Array (
+
+ );
+
+ // toolbar buttons
+ $remove_buttons = Array (
+
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+
+ );
Property changes on: admin\system_presets\simple\promo_blocks_promo-block.php
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ LF
Index: admin/system_presets/simple/sections_core-sections.php
===================================================================
--- admin/system_presets/simple/sections_core-sections.php (revision 14826)
+++ admin/system_presets/simple/sections_core-sections.php (working copy)
@@ -17,5 +17,6 @@
$debug_only_sections = Array (
'in-portal:configure_advanced',
'in-portal:tools',
-
+ 'in-portal:promo_blocks',
+ 'in-portal:configure_promo_blocks',
);
Index: core/admin_templates/promo_blocks/promo_block_edit.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_edit.tpl (revision 0)
+++ core/admin_templates/promo_blocks/promo_block_edit.tpl (revision 0)
@@ -0,0 +1,189 @@
+<inp2:adm_SetPopupSize width="700" height="585"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_edit"/>
+
+<!-- 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" escape="1"/>', function() {
+ submit_event('promo-block', '<inp2:promo-block_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ cancel_edit('promo-block', 'OnCancelEdit','<inp2:promo-block_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
+ reset_form('promo-block', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('promo-block', '<inp2:promo-block_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('promo-block', '<inp2:promo-block_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if check="promo-block_IsSingle" >
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if check="promo-block_IsLast" >
+ a_toolbar.DisableButton('next');
+ </inp2:m_if>
+ <inp2:m_if check="promo-block_IsFirst" >
+ a_toolbar.DisableButton('prev');
+ </inp2:m_if>
+ </inp2:m_if>
+ </script>
+
+ <script type="text/javascript" src="js/swfobject.js"></script>
+ <script type="text/javascript" src="<inp2:m_Compress files='js/uploader/upload_manager.js|js/uploader/uploader.js'/>"></script>
+
+ <inp2:m_RenderElement name="ml_selector" prefix="promo-block"/>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_DefineElement name="multilang_field_caption_element">
+ <label for="<inp2:m_param name='NamePrefix'/><inp2:{$prefix}_InputName field='$field'/>">
+ <span class="<inp2:m_if check='{$prefix}_HasError' field='$field'>error-cell</inp2:m_if>"><inp2:m_if check="m_Param" name="title"><inp2:lang_Field field="LocalName"/> <inp2:m_phrase label="$title"/></inp2:m_else/><inp2:lang_Field field="LocalName"/> <inp2:m_Param name="title_text"/></inp2:m_if></span></span><inp2:m_if check="{$prefix}_IsRequired" field="$field"><span class="field-required"> *</span></inp2:m_if>:<inp2:m_if check="m_Param" name="hint_label"><span> <img src="<inp2:m_TemplatesBase/>/img/hint_icon.png" width="12" height="13" title="<inp2:m_Phrase label='$hint_label' html_escape='1'/>" alt="<inp2:m_Phrase label='$hint_label' html_escape='1'/>"/></inp2:m_if>
+ </label>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="date_field_caption_element">
+ <label for="<inp2:m_param name='NamePrefix'/><inp2:{$prefix}_InputName field='$field'/>">
+ <span class="<inp2:m_if check='{$prefix}_HasError' field='$field'>error-cell</inp2:m_if>"><inp2:m_if check="m_Param" name="title"><inp2:m_phrase label="$title"/></inp2:m_else/><inp2:m_Param name="title_text"/></inp2:m_if> <span class="small">(<inp2:promo-block_Format field="ScheduleFromDate_date" input_format="1" human="true"/>)</span></span></span><inp2:m_if check="{$prefix}_IsRequired" field="$field"><span class="field-required"> *</span></inp2:m_if>:<inp2:m_if check="m_Param" name="hint_label"><span> <img src="<inp2:m_TemplatesBase/>/img/hint_icon.png" width="12" height="13" title="<inp2:m_Phrase label='$hint_label' html_escape='1'/>" alt="<inp2:m_Phrase label='$hint_label' html_escape='1'/>"/></inp2:m_if>
+ </label>
+</inp2:m_DefineElement>
+
+<inp2:promo-block_SaveWarning name="grid_save_warning"/>
+<inp2:promo-block_ErrorWarning name="form_error_warning"/>
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="inp_id_label" prefix="promo-block" field="BlockId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block" field="Title" maxlength="50"/>
+ <inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="promo-block" field="Html" title="la_fld_Text" control_options="{min_height: 60}" rows="4" cols="70"/>
+
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="Priority" title="la_fld_Order"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block" field="Status"/>
+
+ <inp2:m_DefineElement name="image_block">
+ <inp2:Field field="LanguageId" result_to_var="langId"/>
+ <inp2:m_RenderElement name="inp_edit_swf_upload" caption_render_as="multilang_field_caption_element" prefix="promo-block" field="l{$langId}_Image" title="la_fld_Image"/>
+ </inp2:m_DefineElement>
+
+ <inp2:lang_ListLanguages render_as="image_block" row_start_render_as="html:" row_end_render_as="html:"/>
+
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="CSSClassName" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="LinkType" onchange="select_link_type()"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="CategoryId" title="la_fld_Category" style="width: 400px;" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block" field="ExternalLink"/>
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="promo-block" field="OpenInNewWindow"/>
+
+ <inp2:m_RenderElement design="form_row" caption_render_as="date_field_caption_element" prefix="promo-block" field="ScheduleFromDate" title="la_fld_ScheduleDate" to_field="ScheduleToDate">
+ <td class="control-cell">
+ <inp2:m_Phrase label="la_From"/>
+ <input type="text" name="<inp2:{$prefix}_InputName field="{$field}_date"/>" id="<inp2:{$prefix}_InputName field="{$field}_date"/>" value="<inp2:{$prefix}_Field field="{$field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$field}_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
+ <img src="img/calendar_icon.gif" id="cal_img_<inp2:{$prefix}_InputName field="{$field}"/>"
+ style="cursor: pointer; margin-right: 5px"
+ title="Date selector"
+ />
+
+ <script type="text/javascript">
+ Calendar.setup({
+ inputField : "<inp2:{$prefix}_InputName field="{$field}_date"/>",
+ ifFormat : Calendar.phpDateFormat("<inp2:{$prefix}_Format field="{$field}_date" input_format="1"/>"),
+ button : "cal_img_<inp2:{$prefix}_InputName field="{$field}"/>",
+ align : "br",
+ singleClick : true,
+ showsTime : true,
+ weekNumbers : false,
+ firstDay : <inp2:m_GetConfig var="FirstDayOfWeek"/>,
+ onUpdate : function(cal) {
+ runOnChange('<inp2:$prefix_InputName field="{$field}_date"/>');
+ }
+ });
+ </script>
+ <input type="hidden" name="<inp2:{$prefix}_InputName field="{$field}_time"/>" id="<inp2:{$prefix}_InputName field="{$field}_time" input_format="1"/>" value="">
+
+
+ <inp2:m_Phrase label="la_To"/>
+ <input type="text" name="<inp2:{$prefix}_InputName field="{$to_field}_date"/>" id="<inp2:{$prefix}_InputName field="{$to_field}_date"/>" value="<inp2:{$prefix}_Field field="{$to_field}_date" format="_regional_InputDateFormat"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:{$prefix}_Format field="{$to_field}_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>core/admin_templates/img/calendar_icon.gif">
+ <img src="img/calendar_icon.gif" id="cal_img_<inp2:{$prefix}_InputName field="{$to_field}"/>"
+ style="cursor: pointer; margin-right: 5px"
+ title="Date selector"
+ />
+
+ <script type="text/javascript">
+ Calendar.setup({
+ inputField : "<inp2:{$prefix}_InputName field="{$to_field}_date"/>",
+ ifFormat : Calendar.phpDateFormat("<inp2:{$prefix}_Format field="{$to_field}_date" input_format="1"/>"),
+ button : "cal_img_<inp2:{$prefix}_InputName field="{$to_field}"/>",
+ align : "br",
+ singleClick : true,
+ showsTime : true,
+ weekNumbers : false,
+ firstDay : <inp2:m_GetConfig var="FirstDayOfWeek"/>,
+ onUpdate : function(cal) {
+ runOnChange('<inp2:$prefix_InputName field="{$to_field}_date"/>');
+ }
+ });
+ </script>
+ <input type="hidden" name="<inp2:{$prefix}_InputName field="{$to_field}_time"/>" id="<inp2:{$prefix}_InputName field="{$to_field}_time" input_format="1"/>" value="">
+
+ </td>
+ </inp2:m_RenderElement>
+
+ <inp2:m_RenderElement name="inp_edit_checkbox" prefix="promo-block" field="Sticky"/>
+
+ <inp2:m_ifnot check="promo-block_IsNewItem">
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block" field="NumberOfClicks"/>
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block" field="NumberOfViews"/>
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block" field="ConversionPercent"/>
+ </inp2:m_ifnot>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
+<script type="text/javascript">
+ var otpl = document.getElementById('<inp2:promo-block_InputName field="LinkType"/>');
+ var orow_category = document.getElementById('<inp2:promo-block_InputName field="CategoryId"/>').parentNode.parentNode;
+ var orow_external_link = document.getElementById('<inp2:promo-block_InputName field="ExternalLink"/>').parentNode.parentNode;
+ var orow_open_in_new_window = document.getElementById('<inp2:promo-block_InputName field="OpenInNewWindow"/>').parentNode.parentNode;
+
+ function select_link_type() {
+ if (otpl.value == 1) {
+ // internal
+ orow_category.style.display = '';
+ orow_external_link.style.display = 'none';
+ orow_open_in_new_window.style.display = 'none';
+ } else {
+ // external
+ orow_category.style.display = 'none';
+ orow_external_link.style.display = '';
+ orow_open_in_new_window.style.display = '';
+ }
+ }
+
+ select_link_type();
+</script>
+
+<inp2:m_include t="incs/footer"/>
Index: core/admin_templates/promo_blocks/promo_block_list.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_list.tpl (revision 0)
+++ core/admin_templates/promo_blocks/promo_block_list.tpl (revision 0)
@@ -0,0 +1,81 @@
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_list" />
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+ std_edit_item('promo-block', 'promo_blocks/promo_block_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
+ function() {
+ std_precreate_item('promo-block', 'promo_blocks/promo_block_edit');
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('promo-block')
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('setprimary', '<inp2:m_phrase label="la_ToolTip_SetSticky" escape="1"/>', function() {
+ submit_event('promo-block', 'OnSetSticky');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_ResetCounters" escape="1"/>', function() {
+ submit_event('promo-block', 'OnResetCounters');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>', function() {
+ submit_event('promo-block','OnMassMoveUp');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>', function() {
+ submit_event('promo-block','OnMassMoveDown');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function edit_promoblock(doc_id)
+ {
+ set_hidden_field('promo-block[' + doc_id + ']BlockId', 'on');
+ std_edit_item('promo-block', 'promo_blocks/promo_block_edit');
+ }
+ </script>
+ </td>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="promo-block" grid="Default"/>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_DefineElement name="file_block">
+ <a target="_blank" href="<inp2:m_BaseURL/>system/images/<inp2:Field field='Image'/>"><inp2:Field field="Image"/></a>
+</inp2:m_DefineElement>
+
+<inp2:m_RenderElement name="grid" PrefixSpecial="promo-block" IdField="BlockId" grid="Default" grid_filters="1"/>
+<script type="text/javascript">
+ Grids['promo-block'].SetDependantToolbarButtons( new Array('edit','delete','setprimary','reset_edit','move_up','move_down') );
+</script>
+<inp2:m_include t="incs/footer"/>
Property changes on: core\admin_templates\promo_blocks\promo_block_list.tpl
___________________________________________________________________
Added: svn:eol-style
+ LF
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14840)
+++ core/install/english.lang (working copy)
@@ -88,7 +88,6 @@
<PHRASE Label="la_col_IP" Module="Core" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_col_IsPopular" Module="Core" Type="1">UG9wdWxhcg==</PHRASE>
<PHRASE Label="la_col_IsPrimaryLanguage" Module="Core" Type="1">VXNlciBQcmltYXJ5</PHRASE>
- <PHRASE Label="la_col_ItemPrefix" Module="Core" Type="1">SXRlbSBQcmVmaXg=</PHRASE>
<PHRASE Label="la_col_Keyword" Module="Core" Type="1">S2V5d29yZA==</PHRASE>
<PHRASE Label="la_col_Label" Module="Core" Type="1">TGFiZWw=</PHRASE>
<PHRASE Label="la_col_LanguagePackInstalled" Module="Core" Type="1">TGFuZ3VhZ2UgUGFjayBJbnN0YWxsZWQ=</PHRASE>
@@ -119,6 +118,8 @@
<PHRASE Label="la_col_ResetToDefaultSorting" Module="Core" Type="1">UmVzZXQgdG8gZGVmYXVsdA==</PHRASE>
<PHRASE Label="la_col_ReviewCount" Module="Core" Type="1">Q29tbWVudHM=</PHRASE>
<PHRASE Label="la_col_ReviewedBy" Module="Core" Type="1">Q3JlYXRlZCBieQ==</PHRASE>
+ <PHRASE Label="la_col_ScheduleFromDate" Module="Core" Type="1">U2NoZWR1bGUgRnJvbSBEYXRl</PHRASE>
+ <PHRASE Label="la_col_ScheduleToDate" Module="Core" Type="1">U2NoZWR1bGUgVG8gRGF0ZQ==</PHRASE>
<PHRASE Label="la_col_SendRetries" Module="Core" Type="1">QXR0ZW1wdHMg</PHRASE>
<PHRASE Label="la_col_SessionEnd" Module="Core" Type="1">U2Vzc2lvbiBFbmQ=</PHRASE>
<PHRASE Label="la_col_SessionStart" Module="Core" Type="1">U2Vzc2lvbiBTdGFydA==</PHRASE>
@@ -172,6 +173,10 @@
<PHRASE Label="la_config_PathToWebsite" Module="Core" Type="1">UGF0aCB0byBXZWJzaXRl</PHRASE>
<PHRASE Label="la_config_PerformExactSearch" Module="Core" Type="1">UGVyZm9ybSBFeGFjdCBTZWFyY2g=</PHRASE>
<PHRASE Label="la_config_PerpageReviews" Module="Core" Type="1">Q29tbWVudHMgcGVyIHBhZ2U=</PHRASE>
+ <PHRASE Label="la_config_PromoRotationDelay" Module="Core" Type="1">UHJvbW8gUm90YXRpb24gRGVsYXkgKHNlY29uZHMp</PHRASE>
+ <PHRASE Label="la_config_PromoTransitionControls" Module="Core" Type="1">UHJvbW8gVHJhbnNpdGlvbiBDb250cm9scw==</PHRASE>
+ <PHRASE Label="la_config_PromoTransitionEffect" Module="Core" Type="1">UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3Q=</PHRASE>
+ <PHRASE Label="la_config_PromoTransitionTime" Module="Core" Type="1">VHJhbnNpdGlvbiBEZWxheSAoc2Vjb25kcyk=</PHRASE>
<PHRASE Label="la_config_QuickCategoryPermissionRebuild" Module="Core" Type="1">UXVpY2sgU2VjdGlvbiBQZXJtaXNzaW9uIFJlYnVpbGQ=</PHRASE>
<PHRASE Label="la_config_RecycleBinFolder" Module="Core" Type="1">IlJlY3ljbGUgQmluIiBTZWN0aW9uSWQ=</PHRASE>
<PHRASE Label="la_config_RegistrationUsernameRequired" Module="Core" Type="1">VXNlcm5hbWUgUmVxdWlyZWQgRHVyaW5nIFJlZ2lzdHJhdGlvbg==</PHRASE>
@@ -332,11 +337,13 @@
<PHRASE Label="la_fld_Company" Module="Core" Type="1">Q29tcGFueQ==</PHRASE>
<PHRASE Label="la_fld_ConfigHeader" Module="Core" Type="1">Q29uZmlndXJhdGlvbiBIZWFkZXIgTGFiZWw=</PHRASE>
<PHRASE Label="la_fld_ContentBlock" Module="Core" Type="1">Q29udGVudCBCbG9jaw==</PHRASE>
+ <PHRASE Label="la_fld_ConversionPercent" Module="Core" Type="1" Column="Q1RSLCAl">Q1RSLCAl</PHRASE>
<PHRASE Label="la_fld_CopyLabels" Module="Core" Type="1">Q29weSBMYWJlbHMgZnJvbSB0aGlzIExhbmd1YWdl</PHRASE>
<PHRASE Label="la_fld_Country" Module="Core" Type="1" Column="Q291bnRyeQ==">Q291bnRyeQ==</PHRASE>
<PHRASE Label="la_fld_CreatedById" Module="Core" Type="1">Q3JlYXRlZCBCeQ==</PHRASE>
<PHRASE Label="la_fld_CreatedOn" Module="Core" Type="1" Column="Q3JlYXRlZCBPbg==">Q3JlYXRlZCBPbg==</PHRASE>
<PHRASE Label="la_fld_CSS" Module="Core" Type="1">Q1NTIFRlbXBsYXRl</PHRASE>
+ <PHRASE Label="la_fld_CSSClassName" Module="Core" Type="1" Column="Q1NTIENsYXNzIE5hbWU=">Q1NTIENsYXNzIE5hbWU=</PHRASE>
<PHRASE Label="la_fld_Cursor" Module="Core" Type="1">Q3Vyc29y</PHRASE>
<PHRASE Label="la_fld_CustomDetailTemplate" Module="Core" Type="1">Q3VzdG9tIERldGFpbHMgVGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_fld_CustomRecipient" Module="Core" Type="1">U2VuZCBFbWFpbCBUbw==</PHRASE>
@@ -381,6 +388,7 @@
<PHRASE Label="la_fld_ExportPresetName" Module="Core" Type="1">RXhwb3J0IFByZXNldCBUaXRsZQ==</PHRASE>
<PHRASE Label="la_fld_ExportPresets" Module="Core" Type="1">RXhwb3J0IFByZXNldA==</PHRASE>
<PHRASE Label="la_fld_ExportSavePreset" Module="Core" Type="1">U2F2ZS9VcGRhdGUgRXhwb3J0IFByZXNldA==</PHRASE>
+ <PHRASE Label="la_fld_ExternalLink" Module="Core" Type="1" Column="RXh0ZXJuYWwgTGluaw==">RXh0ZXJuYWwgTGluaw==</PHRASE>
<PHRASE Label="la_fld_ExternalUrl" Module="Core" Type="1">RXh0ZXJuYWwgVVJM</PHRASE>
<PHRASE Label="la_fld_ExtraHeaders" Module="Core" Type="1">RXh0cmEgSGVhZGVycw==</PHRASE>
<PHRASE Label="la_fld_Fax" Module="Core" Type="1">RmF4</PHRASE>
@@ -455,6 +463,7 @@
<PHRASE Label="la_fld_Left" Module="Core" Type="1">TGVmdA==</PHRASE>
<PHRASE Label="la_fld_LineEndings" Module="Core" Type="1">TGluZSBlbmRpbmdz</PHRASE>
<PHRASE Label="la_fld_LineEndingsInside" Module="Core" Type="1">TGluZSBFbmRpbmdzIEluc2lkZSBGaWVsZHM=</PHRASE>
+ <PHRASE Label="la_fld_LinkType" Module="Core" Type="1" Column="TGluayBUeXBl">TGluayBUeXBl</PHRASE>
<PHRASE Label="la_fld_ListingId" Module="Core" Type="1" Column="TGlzdGluZyBJZA==">SUQ=</PHRASE>
<PHRASE Label="la_fld_ListingType" Module="Core" Type="1" Column="TGlzdGluZyBUeXBl">TGlzdGluZyBUeXBl</PHRASE>
<PHRASE Label="la_fld_Locale" Module="Core" Type="1">TG9jYWxl</PHRASE>
@@ -491,9 +500,13 @@
<PHRASE Label="la_fld_NextRunOn" Module="Core" Type="1" Column="TmV4dCBSdW4gT24=">TmV4dCBSdW4gT24=</PHRASE>
<PHRASE Label="la_fld_Notes" Module="Core" Type="1">Tm90ZXM=</PHRASE>
<PHRASE Label="la_fld_NotHelpfulCount" Module="Core" Type="1">UmV2aWV3IFdhc24ndCBIZWxwZnVs</PHRASE>
+ <PHRASE Label="la_fld_NumberOfClicks" Module="Core" Type="1" Column="TnVtYmVyIE9mIENsaWNrcw==">TnVtYmVyIE9mIENsaWNrcw==</PHRASE>
+ <PHRASE Label="la_fld_NumberOfViews" Module="Core" Type="1" Column="TnVtYmVyIE9mIFZpZXdz">TnVtYmVyIE9mIFZpZXdz</PHRASE>
<PHRASE Label="la_fld_OccuredOn" Module="Core" Type="1" Column="T2NjdXJlZCBPbg==">T2NjdXJlZCBPbg==</PHRASE>
+ <PHRASE Label="la_fld_OpenInNewWindow" Module="Core" Type="1">T3BlbiBJbiBOZXcgV2luZG93</PHRASE>
<PHRASE Label="la_fld_Options" Module="Core" Type="1">T3B0aW9ucw==</PHRASE>
<PHRASE Label="la_fld_OptionTitle" Module="Core" Type="1">T3B0aW9uIFRpdGxl</PHRASE>
+ <PHRASE Label="la_fld_Order" Module="Core" Type="1" Column="T3JkZXI=">T3JkZXI=</PHRASE>
<PHRASE Label="la_fld_OverridePageCacheKey" Module="Core" Type="1">T3ZlcndyaXRlIERlZmF1bHQgQ2FjaGluZyBLZXk=</PHRASE>
<PHRASE Label="la_fld_PackName" Module="Core" Type="1" Column="UGFjayBOYW1l">UGFjayBOYW1l</PHRASE>
<PHRASE Label="la_fld_PaddingBottom" Module="Core" Type="1">UGFkZGluZyBCb3R0b20=</PHRASE>
@@ -556,6 +569,7 @@
<PHRASE Label="la_fld_RunMode" Module="Core" Type="1" Column="UnVuIE1vZGU=">UnVuIE1vZGU=</PHRASE>
<PHRASE Label="la_fld_RunTime" Module="Core" Type="1" Column="UnVuIFRpbWU=">UnVuIFRpbWU=</PHRASE>
<PHRASE Label="la_fld_SameAsThumb" Module="Core" Type="1">U2FtZSBBcyBUaHVtYg==</PHRASE>
+ <PHRASE Label="la_fld_ScheduleDate" Module="Core" Type="1">U2NoZWR1bGUgRGF0ZQ==</PHRASE>
<PHRASE Label="la_fld_SearchTerm" Module="Core" Type="1" Column="U2VhcmNoIFRlcm0=">U2VhcmNoIFRlcm0=</PHRASE>
<PHRASE Label="la_fld_SenderAddress" Module="Core" Type="1">U2VuZGVyJ3MgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_fld_SenderName" Module="Core" Type="1">U2VuZGVyJ3MgTmFtZQ==</PHRASE>
@@ -574,6 +588,7 @@
<PHRASE Label="la_fld_State" Module="Core" Type="1">U3RhdGU=</PHRASE>
<PHRASE Label="la_fld_StateCountry" Module="Core" Type="1" Column="U3RhdGUgQ291bnRyeQ==">U3RhdGUgQ291bnRyeQ==</PHRASE>
<PHRASE Label="la_fld_Status" Module="Core" Type="1" Column="U3RhdHVz">U3RhdHVz</PHRASE>
+ <PHRASE Label="la_fld_Sticky" Module="Core" Type="1" Column="U3RpY2t5">U3RpY2t5</PHRASE>
<PHRASE Label="la_fld_StopWord" Module="Core" Type="1" Column="U3RvcCBXb3Jk">U3RvcCBXb3Jk</PHRASE>
<PHRASE Label="la_fld_Subject" Module="Core" Type="1" Column="U3ViamVjdA==">U3ViamVjdA==</PHRASE>
<PHRASE Label="la_fld_SubmissionTime" Module="Core" Type="1">U3VibWl0dGVkIE9u</PHRASE>
@@ -586,6 +601,7 @@
<PHRASE Label="la_fld_TargetId" Module="Core" Type="1" Column="SXRlbQ==">SXRlbQ==</PHRASE>
<PHRASE Label="la_fld_TemplateFile" Module="Core" Type="1">VGVtcGxhdGUgRmlsZQ==</PHRASE>
<PHRASE Label="la_fld_TemplateType" Module="Core" Type="1" Column="VGVtcGxhdGU=">VGVtcGxhdGU=</PHRASE>
+ <PHRASE Label="la_fld_Text" Module="Core" Type="1">VGV4dA==</PHRASE>
<PHRASE Label="la_fld_TextAlign" Module="Core" Type="1">VGV4dCBBbGlnbg==</PHRASE>
<PHRASE Label="la_fld_TextDecoration" Module="Core" Type="1">VGV4dCBEZWNvcmF0aW9u</PHRASE>
<PHRASE Label="LA_FLD_TEXTVERSION" Module="Core" Type="1">VGV4dCBWZXJzaW9u</PHRASE>
@@ -624,6 +640,7 @@
<PHRASE Label="la_Font" Module="Core" Type="1">Rm9udCBQcm9wZXJ0aWVz</PHRASE>
<PHRASE Label="la_FormCancelConfirmation" Module="Core" Type="1">RG8geW91IHdhbnQgdG8gc2F2ZSB0aGUgY2hhbmdlcz8=</PHRASE>
<PHRASE Label="la_FormResetConfirmation" Module="Core" Type="1">QXJlIHlvdSBzdXJlIHlvdSB3b3VsZCBsaWtlIHRvIGRpc2NhcmQgdGhlIGNoYW5nZXM/</PHRASE>
+ <PHRASE Label="la_From" Module="Core" Type="1">RnJvbQ==</PHRASE>
<PHRASE Label="la_from_date" Module="Core" Type="1">RnJvbSBEYXRl</PHRASE>
<PHRASE Label="la_GeneralSections" Module="Core" Type="1">R2VuZXJhbCBTZWN0aW9ucw==</PHRASE>
<PHRASE Label="la_HeadFrame" Module="Core" Type="1">SGVhZCBGcmFtZQ==</PHRASE>
@@ -728,6 +745,8 @@
<PHRASE Label="la_opt_Address" Module="Core" Type="1">QWRkcmVzcw==</PHRASE>
<PHRASE Label="la_opt_After" Module="Core" Type="1">QWZ0ZXI=</PHRASE>
<PHRASE Label="la_opt_Allow" Module="Core" Type="1">QWxsb3c=</PHRASE>
+ <PHRASE Label="la_opt_AnimationFade" Module="Core" Type="1">RmFkZQ==</PHRASE>
+ <PHRASE Label="la_opt_AnimationSlide" Module="Core" Type="1">U2xpZGU=</PHRASE>
<PHRASE Label="la_opt_AutoDetect" Module="Core" Type="1">QXV0by1EZXRlY3Q=</PHRASE>
<PHRASE Label="la_opt_Before" Module="Core" Type="1">QmVmb3Jl</PHRASE>
<PHRASE Label="la_opt_Bounce" Module="Core" Type="1">Qm91bmNlZA==</PHRASE>
@@ -755,6 +774,7 @@
<PHRASE Label="la_opt_Everyone" Module="Core" Type="1">RXZlcnlvbmU=</PHRASE>
<PHRASE Label="la_opt_Exact" Module="Core" Type="1">RXhhY3Q=</PHRASE>
<PHRASE Label="la_opt_Expired" Module="Core" Type="1">RXhwaXJlZA==</PHRASE>
+ <PHRASE Label="la_opt_External" Module="Core" Type="1">RXh0ZXJuYWw=</PHRASE>
<PHRASE Label="la_opt_ExternalUrl" Module="Core" Type="1">RXh0ZXJuYWwgVXJs</PHRASE>
<PHRASE Label="la_opt_Failed" Module="Core" Type="1">RmFpbGVk</PHRASE>
<PHRASE Label="la_opt_FirstName" Module="Core" Type="1">Rmlyc3QgTmFtZQ==</PHRASE>
@@ -762,6 +782,7 @@
<PHRASE Label="la_opt_GuestsOnly" Module="Core" Type="1">R3Vlc3RzIE9ubHk=</PHRASE>
<PHRASE Label="la_opt_hour" Module="Core" Type="1">aG91cihzKQ==</PHRASE>
<PHRASE Label="la_opt_InheritFromParent" Module="Core" Type="1">SW5oZXJpdCBmcm9tIFBhcmVudA==</PHRASE>
+ <PHRASE Label="la_opt_Internal" Module="Core" Type="1">SW50ZXJuYWw=</PHRASE>
<PHRASE Label="la_opt_Invalid" Module="Core" Type="1">SW52YWxpZA==</PHRASE>
<PHRASE Label="la_opt_IP_Address" Module="Core" Type="1">SVAgQWRkcmVzcw==</PHRASE>
<PHRASE Label="la_opt_IsUnique" Module="Core" Type="1">SXMgdW5pcXVl</PHRASE>
@@ -1096,6 +1117,7 @@
<PHRASE Label="la_tab_PackageContent" Module="Core" Type="1">UGFja2FnZSBDb250ZW50</PHRASE>
<PHRASE Label="la_tab_Permissions" Module="Core" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_tab_PermissionTypes" Module="Core" Type="1">UGVybWlzc2lvbiBUeXBlcw==</PHRASE>
+ <PHRASE Label="la_tab_PromoBlocks" Module="Core" Type="1">UHJvbW8gQmxvY2tz</PHRASE>
<PHRASE Label="la_tab_Properties" Module="Core" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_tab_QueryDB" Module="Core" Type="1">UXVlcnkgRGF0YWJhc2U=</PHRASE>
<PHRASE Label="la_tab_Regional" Module="Core" Type="1">UmVnaW9uYWw=</PHRASE>
@@ -1170,6 +1192,7 @@
<PHRASE Label="la_Text_Phone" Module="Core" Type="1">UGhvbmU=</PHRASE>
<PHRASE Label="la_Text_Pop" Module="Core" Type="1">UG9wdWxhcg==</PHRASE>
<PHRASE Label="la_text_popularity" Module="Core" Type="1">UG9wdWxhcml0eQ==</PHRASE>
+ <PHRASE Label="la_Text_PromoSettings" Module="Core" Type="1">UHJvbW8gU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_text_ready_to_install" Module="Core" Type="1">UmVhZHkgdG8gSW5zdGFsbA==</PHRASE>
<PHRASE Label="la_text_RecordsAdded" Module="Core" Type="1">cmVjb3JkcyBhZGRlZA==</PHRASE>
<PHRASE Label="la_text_RecordsUpdated" Module="Core" Type="1">cmVjb3JkcyB1cGRhdGVk</PHRASE>
@@ -1196,6 +1219,7 @@
<PHRASE Label="la_title_AddingFile" Module="Core" Type="1">QWRkaW5nIEZpbGU=</PHRASE>
<PHRASE Label="la_title_AddingMailingList" Module="Core" Type="1">QWRkaW5nIE1haWxpbmcgTGlzdA==</PHRASE>
<PHRASE Label="la_title_AddingPermissionType" Module="Core" Type="1">QWRkaW5nIFBlcm1pc3Npb24gVHlwZQ==</PHRASE>
+ <PHRASE Label="la_title_AddingPromoBlock" Module="Core" Type="1">QWRkaW5nIFByb21vIEJsb2Nr</PHRASE>
<PHRASE Label="la_title_AddingSiteDomain" Module="Core" Type="1">QWRkaW5nIFNpdGUgRG9tYWlu</PHRASE>
<PHRASE Label="la_title_AddingSkin" Module="Core" Type="1">QWRkaW5nIFNraW4=</PHRASE>
<PHRASE Label="la_title_AddingSpellingDictionary" Module="Core" Type="1">QWRkaW5nIFNwZWxsaW5nIERpY3Rpb25hcnk=</PHRASE>
@@ -1245,6 +1269,7 @@
<PHRASE Label="la_title_EditingFile" Module="Core" Type="1">RWRpdGluZyBGaWxl</PHRASE>
<PHRASE Label="la_title_EditingMembership" Module="Core" Type="1">RWRpdGluZyBNZW1iZXJzaGlw</PHRASE>
<PHRASE Label="la_title_EditingPermissionType" Module="Core" Type="1">RWRpdGluZyBQZXJtaXNzaW9uIFR5cGU=</PHRASE>
+ <PHRASE Label="la_title_EditingPromoBlock" Module="Core" Type="1">RWRpdGluZyBQcm9tbyBCbG9jaw==</PHRASE>
<PHRASE Label="la_title_EditingSiteDomain" Module="Core" Type="1">RWRpdGluZyBTaXRlIERvbWFpbg==</PHRASE>
<PHRASE Label="la_title_EditingSkin" Module="Core" Type="1">RWRpdGluZyBTa2lu</PHRASE>
<PHRASE Label="la_title_EditingSpamReport" Module="Core" Type="1">RWRpdGluZyBTUEFNIFJlcG9ydA==</PHRASE>
@@ -1312,6 +1337,7 @@
<PHRASE Label="la_title_Permissions" Module="Core" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_title_Phrases" Module="Core" Type="1">TGFiZWxzICYgUGhyYXNlcw==</PHRASE>
<PHRASE Label="la_Title_PleaseWait" Module="Core" Type="1">UGxlYXNlIFdhaXQ=</PHRASE>
+ <PHRASE Label="la_title_PromoBlocks" Module="Core" Type="1">UHJvbW8gQmxvY2tz</PHRASE>
<PHRASE Label="la_title_Properties" Module="Core" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_title_RelatedSearches" Module="Core" Type="1">UmVsYXRlZCBTZWFyY2hlcw==</PHRASE>
<PHRASE Label="la_title_Relations" Module="Core" Type="1">UmVsYXRpb25z</PHRASE>
@@ -1354,6 +1380,7 @@
<PHRASE Label="la_title_ViewingReply" Module="Core" Type="1">Vmlld2luZyBSZXBseQ==</PHRASE>
<PHRASE Label="la_title_Visits" Module="Core" Type="1">VmlzaXRz</PHRASE>
<PHRASE Label="la_title_Website" Module="Core" Type="1">V2Vic2l0ZQ==</PHRASE>
+ <PHRASE Label="la_To" Module="Core" Type="1">dG8=</PHRASE>
<PHRASE Label="la_ToolTipShort_Edit_Current_Category" Module="Core" Type="1">Q3Vyci4gU2VjdGlvbg==</PHRASE>
<PHRASE Label="la_ToolTipShort_Move_Down" Module="Core" Type="1">RG93bg==</PHRASE>
<PHRASE Label="la_ToolTipShort_Move_Up" Module="Core" Type="1">VXA=</PHRASE>
@@ -1427,6 +1454,7 @@
<PHRASE Label="la_ToolTip_RescanThemes" Module="Core" Type="1">UmVzY2FuIFRoZW1lcw==</PHRASE>
<PHRASE Label="la_ToolTip_Resend" Module="Core" Type="1">UmVzZW5k</PHRASE>
<PHRASE Label="la_ToolTip_Reset" Module="Core" Type="1">UmVzZXQ=</PHRASE>
+ <PHRASE Label="la_ToolTip_ResetCounters" Module="Core" Type="1">UmVzZXQgQ291bnRlcnM=</PHRASE>
<PHRASE Label="la_ToolTip_ResetSettings" Module="Core" Type="1">UmVzZXQgUGVyc2lzdGVudCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_ToolTip_ResetToBase" Module="Core" Type="1">UmVzZXQgVG8gQmFzZQ==</PHRASE>
<PHRASE Label="la_ToolTip_Run" Module="Core" Type="1">UnVu</PHRASE>
@@ -1442,6 +1470,7 @@
<PHRASE Label="la_ToolTip_setPrimary" Module="Core" Type="1">U2V0IFByaW1hcnk=</PHRASE>
<PHRASE Label="la_ToolTip_setprimarycategory" Module="Core" Type="1">U2V0IFByaW1hcnkgU2VjdGlvbg==</PHRASE>
<PHRASE Label="la_ToolTip_SetPrimaryLanguage" Module="Core" Type="1">U2V0IFByaW1hcnkgTGFuZ3VhZ2U=</PHRASE>
+ <PHRASE Label="la_ToolTip_SetSticky" Module="Core" Type="1">U2V0IFN0aWNreQ==</PHRASE>
<PHRASE Label="la_ToolTip_ShowMenu" Module="Core" Type="1">U2hvdyBNZW51</PHRASE>
<PHRASE Label="la_ToolTip_SynchronizeLanguages" Module="Core" Type="1">U3luY2hyb25pemUgTGFuZ3VhZ2Vz</PHRASE>
<PHRASE Label="la_ToolTip_Tools" Module="Core" Type="1">VG9vbHM=</PHRASE>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14840)
+++ core/install/install_data.sql (working copy)
@@ -95,6 +95,12 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux||1=la_Windows', 70.03, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode||1=la_Regular', 70.04, 0, 1, NULL);
+# Section "in-portal:configure_promo_blocks":
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.6', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'fade', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'fade=la_opt_AnimationFade||slide=la_opt_AnimationSlide', 10.04, 0, 0, NULL);
+
# Section "in-portal:configure_users":
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_allow_new', 'radio', '', '1=la_opt_UserInstantRegistration||2=la_opt_UserNotAllowedRegistration||3=la_opt_UserUponApprovalRegistration||4=la_opt_UserEmailActivation', 10.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AdvancedUserManagement', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_prompt_AdvancedUserManagement', 'checkbox', NULL, NULL, 10.011, 0, 1, NULL);
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 14826)
+++ core/install/install_schema.sql (working copy)
@@ -1242,4 +1242,34 @@
KEY ResponseDate (ResponseDate),
KEY ResponseHttpCode (ResponseHttpCode),
KEY CurlError (CurlError)
+);
+
+CREATE TABLE PromoBlocks (
+ BlockId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(50) NOT NULL DEFAULT '',
+ Priority int(11) NOT NULL DEFAULT '0',
+ Status tinyint(1) NOT NULL DEFAULT '0',
+ l1_Image varchar(255) NOT NULL DEFAULT '',
+ l2_Image varchar(255) NOT NULL DEFAULT '',
+ l3_Image varchar(255) NOT NULL DEFAULT '',
+ l4_Image varchar(255) NOT NULL DEFAULT '',
+ l5_Image varchar(255) NOT NULL DEFAULT '',
+ CSSClassName varchar(255) NOT NULL DEFAULT '',
+ LinkType tinyint(1) NOT NULL DEFAULT '1',
+ CategoryId int(11) NOT NULL DEFAULT '0',
+ ExternalLink varchar(255) NOT NULL DEFAULT '',
+ OpenInNewWindow tinyint(3) unsigned NOT NULL DEFAULT '0',
+ ScheduleFromDate int(11) DEFAULT NULL,
+ ScheduleToDate int(11) DEFAULT NULL,
+ NumberOfClicks int(11) NOT NULL DEFAULT '0',
+ NumberOfViews int(11) NOT NULL DEFAULT '0',
+ Sticky tinyint(1) NOT NULL DEFAULT '0',
+ Html text,
+ l1_Html text,
+ l2_Html text,
+ l3_Html text,
+ l4_Html text,
+ l5_Html text,
+ PRIMARY KEY (BlockId),
+ KEY OpenInNewWindow (OpenInNewWindow)
);
\ No newline at end of file
Index: core/install/upgrades.php
===================================================================
--- core/install/upgrades.php (revision 14826)
+++ core/install/upgrades.php (working copy)
@@ -1769,6 +1769,16 @@
return ;
}
+ $this->transformFieldPhrases();
+ }
+
+ /**
+ * Merges column and field phrases
+ *
+ * @return void
+ */
+ protected function transformFieldPhrases()
+ {
$sql = 'SELECT *
FROM ' . TABLE_PREFIX . 'Phrase
WHERE PhraseKey LIKE "LA_COL_%"';
@@ -1825,6 +1835,7 @@
{
if ($mode == 'after') {
$this->transformSortings();
+ $this->transformFieldPhrases(); // because of "la_col_ItemPrefix" phrase
}
}
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14840)
+++ core/install/upgrades.sql (working copy)
@@ -2301,4 +2301,43 @@
'LA_SECTION_SETTINGSCACHING', 'LA_CONFIG_CACHEHANDLER', 'LA_CONFIG_MEMCACHESERVERS', 'LA_HINT_MEMCACHESERVERS'
);
-DELETE FROM ConfigurationValues WHERE VariableName IN ('CacheHandler', 'MemcacheServers');
\ No newline at end of file
+DELETE FROM ConfigurationValues WHERE VariableName IN ('CacheHandler', 'MemcacheServers');
+
+CREATE TABLE PromoBlocks (
+ BlockId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(50) NOT NULL DEFAULT '',
+ Priority int(11) NOT NULL DEFAULT '0',
+ Status tinyint(1) NOT NULL DEFAULT '0',
+ l1_Image varchar(255) NOT NULL DEFAULT '',
+ l2_Image varchar(255) NOT NULL DEFAULT '',
+ l3_Image varchar(255) NOT NULL DEFAULT '',
+ l4_Image varchar(255) NOT NULL DEFAULT '',
+ l5_Image varchar(255) NOT NULL DEFAULT '',
+ CSSClassName varchar(255) NOT NULL DEFAULT '',
+ LinkType tinyint(1) NOT NULL DEFAULT '1',
+ CategoryId int(11) NOT NULL DEFAULT '0',
+ ExternalLink varchar(255) NOT NULL DEFAULT '',
+ OpenInNewWindow tinyint(3) unsigned NOT NULL DEFAULT '0',
+ ScheduleFromDate int(11) DEFAULT NULL,
+ ScheduleToDate int(11) DEFAULT NULL,
+ NumberOfClicks int(11) NOT NULL DEFAULT '0',
+ NumberOfViews int(11) NOT NULL DEFAULT '0',
+ Sticky tinyint(1) NOT NULL DEFAULT '0',
+ Html text,
+ l1_Html text,
+ l2_Html text,
+ l3_Html text,
+ l4_Html text,
+ l5_Html text,
+ PRIMARY KEY (BlockId),
+ KEY OpenInNewWindow (OpenInNewWindow)
+);
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.6', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'fade', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'fade=la_opt_AnimationFade||slide=la_opt_AnimationSlide', 10.04, 0, 0, NULL);
+
+UPDATE Phrase
+SET l<%PRIMARY_LANGUAGE%>_ColumnTranslation = l<%PRIMARY_LANGUAGE%>_Translation
+WHERE PhraseKey IN ('LA_FLD_CATEGORY', 'LA_FLD_ORDER');
\ No newline at end of file
Index: core/kernel/constants.php
===================================================================
--- core/kernel/constants.php (revision 14826)
+++ core/kernel/constants.php (working copy)
@@ -175,4 +175,9 @@
const PHRASE_TYPE_FRONT = 0;
const PHRASE_TYPE_ADMIN = 1;
const PHRASE_TYPE_COMMON = 2;
+ }
+
+ class PromoBlockType {
+ const INTERNAL = 1;
+ const EXTERNAL = 2;
}
\ No newline at end of file
Index: core/units/logs/change_logs/change_logs_config.php
===================================================================
--- core/units/logs/change_logs/change_logs_config.php (revision 14826)
+++ core/units/logs/change_logs/change_logs_config.php (working copy)
@@ -151,7 +151,7 @@
'OccuredOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 150, ),
'MasterPrefix' => Array ('filter_block' => 'grid_options_filter', 'width' => 120, ),
'MasterId' => Array ('filter_block' => 'grid_range_filter', 'width' => 90, ),
- 'Prefix' => Array ('title' => 'la_col_ItemPrefix', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
+ 'Prefix' => Array ('title' => 'column:la_fld_ItemPrefix', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
'ItemId' => Array ('filter_block' => 'grid_range_filter', 'width' => 120, ),
'Changes' => Array ('data_block' => 'grid_changes_td', 'filter_block' => 'grid_like_filter', 'format' => 'auto_cut', 'width' => 225, ),
),
Index: core/units/priorites/priorites_config.php
===================================================================
--- core/units/priorites/priorites_config.php (revision 14826)
+++ core/units/priorites/priorites_config.php (working copy)
@@ -13,7 +13,7 @@
*/
defined('FULL_PATH') or die('restricted access!');
-
+
$config = Array (
'Prefix' => 'priority',
'EventHandlerClass' => Array ('class' => 'PriorityEventHandler', 'file' => 'priority_eh.php', 'build_event' => 'OnBuild'),
@@ -40,6 +40,6 @@
'PermSection' => Array ('main' => 'custom'),
'ProcessPrefixes' => Array(
- 'c', 'st'
+ 'c', 'st', 'promo-block',
),
);
Index: core/units/promo_blocks/promo_block_eh.php
===================================================================
--- core/units/promo_blocks/promo_block_eh.php (revision 0)
+++ core/units/promo_blocks/promo_block_eh.php (revision 0)
@@ -0,0 +1,311 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class PromoBlockEventHandler extends kDBEventHandler {
+
+ /**
+ * Categories are sorted using special sorting event
+ *
+ */
+ function mapEvents()
+ {
+ parent::mapEvents();
+
+ $events_map = Array (
+ 'OnMassMoveUp' => 'OnChangePriority',
+ 'OnMassMoveDown' => 'OnChangePriority',
+ );
+
+ $this->eventMethods = array_merge($this->eventMethods, $events_map);
+ }
+
+ /**
+ * Allows to override standard permission mapping
+ *
+ */
+ function mapPermissions()
+ {
+ parent::mapPermissions();
+
+ $permissions = Array (
+ 'OnItemBuild' => Array ('self' => true),
+ 'OnSetSticky' => Array ('self' => 'view'),
+ 'OnRegisterView' => Array ('self' => true),
+ 'OnFollowLink' => Array ('self' => true),
+ 'OnResetCounters' => Array ('self' => 'add|edit'),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Processes OnMassMoveUp, OnMassMoveDown events
+ *
+ * @param kEvent $event
+ */
+ function OnChangePriority(&$event)
+ {
+ $this->Application->SetVar('priority_prefix', $event->getPrefixSpecial());
+ $event->CallSubEvent('priority:' . $event->Name);
+ }
+
+ /**
+ * Apply any custom changes to list's sql query
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ * @see kDBEventHandler::OnListBuild()
+ */
+ protected function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ if ( $this->Application->isAdminUser ) {
+ return;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ if ( $event->Special == 'home' ) {
+ $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ $object->addFilter('scheduled_from_filter', '%1$s.ScheduleFromDate IS NULL OR %1$s.ScheduleFromDate <= ' . TIMENOW);
+ $object->addFilter('scheduled_to_filter', '%1$s.ScheduleToDate IS NULL OR %1$s.ScheduleToDate >= ' . TIMENOW);
+ }
+ }
+
+ /**
+ * Set's block as sticky
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnSetSticky(kEvent &$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ /* @var $object kDBItem */
+
+ $ids = $this->StoreSelectedIDs($event);
+
+ if ( $ids ) {
+ $id = array_shift($ids);
+
+ $sql = 'UPDATE ' . $object->TableName . '
+ SET Sticky = 0';
+ $this->Conn->Query($sql);
+
+ $sql = 'UPDATE ' . $object->TableName . '
+ SET Sticky = 1, Status = ' . STATUS_ACTIVE . '
+ WHERE BlockId = ' . $id;
+ $this->Conn->Query($sql);
+ }
+
+ $this->clearSelectedIDs($event);
+ }
+
+
+ /**
+ * Set Required fields
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+ $this->_itemChanged($event);
+ }
+
+ /**
+ * Set Required fields
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+ $this->_itemChanged($event);
+ }
+
+ /**
+ * Schedule dates
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function _itemChanged(kEvent &$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $date_from = $object->GetDBField('ScheduleFromDate_date');
+ $date_to = $object->GetDBField('ScheduleToDate_date');
+
+ if ( $date_from && $date_to && $date_from >= $date_to ) {
+ $object->SetError('ScheduleFromDate_date', 'wrong_date_interval');
+ }
+
+ $object->setRequired('CategoryId', $object->GetDBField('LinkType') == PromoBlockType::INTERNAL);
+ $object->setRequired('ExternalLink', $object->GetDBField('LinkType') == PromoBlockType::EXTERNAL);
+ }
+
+ /**
+ * Registers view of the promo block
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnRegisterView(kEvent &$event)
+ {
+ $this->_incrementField($event, 'NumberOfViews');
+ }
+
+ /**
+ * Registers click on the promo block
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnFollowLink(kEvent &$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $this->_incrementField($event, 'NumberOfClicks', false);
+
+ if ( $object->GetDBField('LinkType') == 1 ) { // Internal
+ $sql = 'SELECT NamedParentPath
+ FROM ' . TABLE_PREFIX . 'Category
+ WHERE CategoryId = ' . $object->GetDBField('CategoryId');
+ $event->redirect = $this->Conn->GetOne($sql);
+
+ $event->SetRedirectParam('pass', 'm');
+ }
+ else {
+ $ext_url = $object->GetDBField('ExternalLink');
+ $event->redirect = 'external:' . (preg_match('/^(http|ftp):\\/\\/.*/', $ext_url) ? $ext_url : $this->Application->BaseURL() . $ext_url);
+ }
+ }
+
+ /**
+ * Increment given promo block counters
+ *
+ * @param kEvent $event
+ * @param string $field
+ * @param bool $is_ajax
+ * @return void
+ * @access protected
+ */
+ protected function _incrementField(kEvent &$event, $field, $is_ajax = true)
+ {
+ if ( $is_ajax ) {
+ $event->status = kEvent::erSTOP;
+
+ if ( $this->Application->GetVar('ajax') != 'yes' ) {
+ return ;
+ }
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ( !$object->isLoaded() ) {
+ echo 'FAILED';
+ return ;
+ }
+
+ // don't use kDBItem::Update to support concurrent view updates from different visitors
+ $sql = 'UPDATE ' . $object->TableName . '
+ SET ' . $field . ' = ' . $field . ' + 1
+ WHERE ' . $object->IDField . ' = ' . $object->GetID();
+ $this->Conn->Query($sql);
+
+ echo 'OK';
+ }
+
+ /**
+ * Resets promo block counters
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnResetCounters(kEvent &$event)
+ {
+ $object =& $event->getObject( Array ('skip_autoload' => true) );
+ /* @var $object kDBItem */
+
+ $ids = $this->StoreSelectedIDs($event);
+
+ foreach ($ids as $id) {
+ $object->Load($id);
+ $object->SetDBField('NumberOfViews', 0);
+ $object->SetDBField('NumberOfClicks', 0);
+ $object->Update();
+ }
+
+ $this->clearSelectedIDs($event);
+ }
+
+ /**
+ * Occurs, when config was parsed, allows to change config data dynamically
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnAfterConfigRead(kEvent &$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ $category_helper =& $this->Application->recallObject('CategoryHelper');
+ /* @var $category_helper CategoryHelper */
+
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+
+ $fields['CategoryId']['options'] = $category_helper->getStructureTreeAsOptions();
+
+ // images multilang fields
+ $a_image = Array(
+ 'type' => 'string', 'max_len' => 255,
+ 'formatter' => 'kUploadFormatter', 'upload_dir' => IMAGES_PATH,
+ 'multiple' => 1, 'thumb_format' => 'resize:100x100',
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_Image_Files!',
+ 'required' => 1, 'not_null' => 1, 'default' => '',
+ );
+
+ // get active languages
+ $sql = 'SELECT LanguageId
+ FROM ' . TABLE_PREFIX . 'Language';
+ $languages = $this->Conn->GetCol($sql);
+
+ foreach ($languages AS $lang_id) {
+ $fields['l' . $lang_id . '_Image'] = $a_image;
+ }
+
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+ }
+}
Index: core/units/promo_blocks/promo_block_tp.php
===================================================================
--- core/units/promo_blocks/promo_block_tp.php (revision 0)
+++ core/units/promo_blocks/promo_block_tp.php (revision 0)
@@ -0,0 +1,58 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class PromoBlockTagProcessor extends kDBtagProcessor {
+
+ /**
+ * Returns link that registers promotion click and redirect user to the page, associated with the promotion
+ *
+ * @param Array $params
+ * @return string
+ * @access protected
+ */
+ protected function PromoLink($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $url_params = Array (
+ $this->Prefix . '_event' => 'OnFollowLink',
+ 'pass' => 'm,' . $this->Prefix,
+ '__NO_REWRITE__' => 1,
+ );
+
+ return $this->Application->HREF('index', '', $url_params);
+ }
+
+ /**
+ * Checks, that link should be opened in new window
+ *
+ * @param Array $params
+ * @return bool
+ * @access protected
+ */
+ protected function LinkInNewWindow($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ if ( $object->GetDBField('LinkType') == 1 ) { // Internal
+ return false;
+ }
+
+ return $object->GetDBField('OpenInNewWindow');
+ }
+}
Property changes on: core\units\promo_blocks\promo_block_tp.php
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ LF
Index: core/units/promo_blocks/promo_blocks_config.php
===================================================================
--- core/units/promo_blocks/promo_blocks_config.php (revision 0)
+++ core/units/promo_blocks/promo_blocks_config.php (revision 0)
@@ -0,0 +1,156 @@
+<?php
+
+$config = Array (
+ 'Prefix' => 'promo-block',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'PromoBlockEventHandler', 'file' => 'promo_block_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'PromoBlockTagProcessor', 'file' => 'promo_block_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'PerPage',
+ 4 => 'event',
+ 5 => 'mode',
+ ),
+
+ 'IDField' => 'BlockId',
+
+ 'TableName' => TABLE_PREFIX . 'PromoBlocks',
+
+ 'TitleField' => 'Title',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('promo-block' => '!la_title_AddingPromoBlock!'),
+ 'edit_status_labels' => Array ('promo-block' => '!la_title_EditingPromoBlock!'),
+ ),
+
+ 'promo_block_list' => Array ('prefixes' => Array ('promo-block_List'), 'format' => "!la_tab_PromoBlocks! (#promo-block_recordcount#)"),
+ 'promo_block_edit' => Array ('prefixes' => Array ('promo-block'), 'format' => "#promo-block_status# '#promo-block_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:promo_blocks'),
+
+ 'Sections' => Array (
+ 'in-portal:promo_blocks' => Array(
+ 'parent' => 'in-portal:site',
+ 'icon' => 'custom',
+ 'label' => 'la_tab_PromoBlocks',
+ 'url' => Array('t' => 'promo_blocks/promo_block_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:configure_promo_blocks' => Array (
+ 'parent' => 'in-portal:website_setting_folder',
+ 'icon' => 'custom',
+ 'label' => 'la_title_PromoBlocks',
+ 'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array ('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'ConversionPercent' => 'IF(%1$s.NumberOfViews > 0, NumberOfClicks / NumberOfViews * 100, NULL)',
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('Priority' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'BlockId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array (
+ 'type' => 'string', 'max_len' => 50,
+ 'not_null' => 1, 'required' => 1, 'default' => '',
+ ),
+ 'Status' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 1,
+ ),
+ 'Priority' => Array(
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (),
+ 'not_null' => 1, 'required' => 1, 'default' => 0
+ ),
+ 'Sticky' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 0,
+ ),
+ 'CSSClassName' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter',
+ 'options' => Array('promo-orange' => 'Orange', 'promo-green' => 'Green', 'promo-blue' => 'Blue'),
+ 'not_null' => 1, 'default' => '',
+ ),
+ 'LinkType' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Internal', 2 => 'la_opt_External'), 'use_phrases' => 1,
+ 'not_null' => 1, 'required' => 1, 'default' => 0,
+ ),
+ 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'default' => NULL),
+ 'ExternalLink' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OpenInNewWindow' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 0
+ ),
+ 'ScheduleFromDate' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '',
+ 'error_msgs' => Array ('wrong_date_interval' => '!la_ToDateMustBeGreaterThanFromDate!'),
+ 'default' => null,
+ ),
+ 'ScheduleToDate' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '',
+ 'error_field' => 'ScheduleFromDate',
+ 'default' => null,
+ ),
+ 'NumberOfClicks' => Array ('type' => 'int', 'default' => 0, 'not_null' => 1),
+ 'NumberOfViews' => Array ('type' => 'int', 'default' => 0, 'not_null' => 1),
+ 'Html' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null),
+ ),
+
+ 'VirtualFields' => Array(
+ 'ConversionPercent' => Array('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.0f', 'default' => NULL),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Fields' => Array (
+ 'BlockId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'Title' => Array ('filter_block' => 'grid_like_filter'),
+ 'Status' => Array ('filter_block' => 'grid_options_filter'),
+ 'Priority' => Array ('title' => 'column:la_fld_Order', 'filter_block' => 'grid_range_filter'),
+ 'Sticky' => Array ('filter_block' => 'grid_options_filter'),
+ 'CSSClassName' => Array ('filter_block' => 'grid_options_filter'),
+ 'LinkType' => Array ('filter_block' => 'grid_options_filter'),
+ 'CategoryId' => Array ('title' => 'column:la_fld_Category', 'filter_block' => 'grid_options_filter'),
+ 'ExternalLink' => Array ('filter_block' => 'grid_like_filter'),
+ 'ScheduleFromDate' => Array ('title' => 'la_col_ScheduleFromDate', 'filter_block' => 'grid_date_range_filter'),
+ 'ScheduleToDate' => Array ('title' => 'la_col_ScheduleToDate', 'filter_block' => 'grid_date_range_filter'),
+ 'NumberOfClicks' => Array ('filter_block' => 'grid_range_filter'),
+ 'NumberOfViews' => Array ('filter_block' => 'grid_range_filter'),
+ 'ConversionPercent' => Array ('filter_block' => 'grid_range_filter'),
+ ),
+ ),
+ ),
+);
promo_blocks_themes_v2.patch [^] (18,571 bytes) 2011-12-08 08:42
[Show Content]
Index: elements/promo.elm.tpl
===================================================================
--- elements/promo.elm.tpl (revision 14841)
+++ elements/promo.elm.tpl (working copy)
@@ -1,15 +1,56 @@
-<div id="slider">
- <ul class="slides">
- <li>
- <img src="<inp2:m_TemplatesBase />img/samples/slider.jpg" />
- </li>
- <li>
- <img src="<inp2:m_TemplatesBase />img/samples/slider.jpg" />
- </li>
-
- <!--##
- <inp2:promo-block.home_PrintList render_as="promo_item"/>
- ##-->
- </ul>
-</div>
-<div class="clear"></div>
\ No newline at end of file
+<inp2:m_DefineElement name="promo_block_element">
+ <li>
+ <a href="<inp2:PromoLink/>" class="<inp2:Field name='CSSClassName' db='db'/>" title="<inp2:Field name='Title' html_escape='1'/>"<inp2:m_if check="LinkInNewWindow"> target="_blank"</inp2:m_if>>
+ <img src="<inp2:Field name='l1_Image' format='resize:710x260;crop:C|C'/>" />
+ </a>
+
+ <script type="text/javascript">
+ $slide_ids.push(<inp2:Field name="BlockId"/>);
+ $slide_viewed.push(false);
+ </script>
+ </li>
+</inp2:m_DefineElement>
+
+<inp2:m_IfDataExists>
+ <div id="slider">
+ <script type="text/javascript">
+ var $slide_ids = [], $slide_viewed = [];
+ </script>
+
+ <ul class="slides">
+ <inp2:promo-block.home_PrintList render_as="promo_block_element"/>
+ </ul>
+ </div>
+ <div class="clear"></div>
+
+ <script type="text/javascript">
+ $(document).ready(
+ function() {
+ function register_promo_view (slider) {
+ var $block_id = $slide_ids[slider.currentSlide],
+ $promo_stats_url = '<inp2:m_Link promo-block_id="#ID#" promo-block_event="OnRegisterView" __NO_REWRITE__="1" pass="m,promo-block" no_amp="1" js_escape="1"/>';
+
+ if ( !$slide_viewed[slider.currentSlide] ) {
+ $slide_viewed[slider.currentSlide] = true;
+
+ $.get( $promo_stats_url.replace('#ID#', $block_id) );
+ }
+ }
+
+ $('#slider').flexslider(
+ {
+ animation: '<inp2:m_GetConfig name="PromoTransitionEffect"/>',
+ animationDuration: <inp2:m_GetConfig name="PromoTransitionTime"/> * 1000, // in milliseconds
+ slideshowSpeed: <inp2:m_GetConfig name="PromoRotationDelay"/> * 1000, // in seconds
+ controlNav: <inp2:m_GetConfig name="PromoTransitionControls"/> ? true: false,
+ directionNav: false,
+ prevText: '',
+ nextText: '',
+ start: register_promo_view,
+ after: register_promo_view
+ }
+ );
+ }
+ );
+ </script>
+</inp2:m_IfDataExists>
\ No newline at end of file
Index: inc/js/jquery.flexslider-min.js
===================================================================
--- inc/js/jquery.flexslider-min.js (revision 14841)
+++ inc/js/jquery.flexslider-min.js (working copy)
@@ -1,9 +1,6 @@
/*
- * jQuery FlexSlider v1.0 (Release)
+ * jQuery FlexSlider v1.8
* http://flex.madebymufffin.com
- *
* Copyright 2011, Tyler Smith
- * Free to use under the MIT license.
- * http://www.opensource.org/licenses/mit-license.php
*/
-(function(a){a.fn.extend({flexslider:function(q){var h={animation:"fade",slideshow:true,slideshowSpeed:7000,animationDuration:500,directionNav:true,controlNav:true,keyboardNav:true,prevText:"Previous",nextText:"Next",slideToStart:0,pauseOnAction:true,pauseOnHover:false,controlsContainer:""};var q=a.extend(h,q),d=a(this),c=a(".slides",d),b=a(".slides li",d),g=false,m=q.slideToStart;if(q.animation.toLowerCase()=="slide"){b.show();d.css({overflow:"hidden"});b.width(d.width()).css({"float":"left"});c.width((b.length*d.width())+200)}else{b.hide().eq(m).fadeIn(400)}function o(i){if(!g){g=true;if(q.animation.toLowerCase()=="slide"){c.animate({"margin-left":(-1*i)*d.width()+"px"},q.animationDuration,function(){g=false;m=i})}else{d.css({minHeight:b.eq(m).height()});b.eq(m).fadeOut(q.animationDuration,function(){b.eq(i).fadeIn(q.animationDuration,function(){g=false;m=i});d.css({minHeight:"inherit"})})}}}if(q.controlNav){if(b.size()>1){var e=a('<ol class="flex-control-nav"></ol>');var k=1;for(var l=0;l<b.size();l++){e.append("<li><a>"+k+"</a></li>");k++}if(a(q.controlsContainer).length>0){a(q.controlsContainer).append(e)}else{d.append(e)}}e=a(".flex-control-nav li a");e.eq(m).addClass("active");e.click(function(j){j.preventDefault();if(a(this).hasClass("active")||g){return}else{e.removeClass("active");a(this).addClass("active");var i=e.index(a(this));o(i);if(q.pauseOnAction){clearInterval(n)}}})}if(q.directionNav){if(a(q.controlsContainer).length>0){a(q.controlsContainer).append(a('<ul class="flex-direction-nav"><li><a class="prev" href="#">'+q.prevText+'</a></li><li><a class="next" href="#">'+q.nextText+"</a></li></ul>"))}else{d.append(a('<ul class="flex-direction-nav"><li><a class="prev" href="#">'+q.prevText+'</a></li><li><a class="next" href="#">'+q.nextText+"</a></li></ul>"))}a(".flex-direction-nav li a").click(function(i){i.preventDefault();if(g){return}else{if(a(this).hasClass("next")){var j=(m==b.length-1)?0:m+1}else{var j=(m==0)?b.length-1:m-1}if(q.controlNav){e.removeClass("active");e.eq(j).addClass("active")}o(j);if(q.pauseOnAction){clearInterval(n)}}})}if(q.keyboardNav){a(document).keyup(function(i){if(g){return}else{if(i.keyCode!=39&&i.keyCode!=37){return}else{if(i.keyCode==39){var j=(m==b.length-1)?0:m+1}else{if(i.keyCode==37){var j=(m==0)?b.length-1:m-1}}if(q.controlNav){e.removeClass("active");e.eq(j).addClass("active")}o(j);if(q.pauseOnAction){clearInterval(n)}}}})}if(q.slideshow){var n;function p(){if(g){return}else{var i=(m==b.length-1)?0:m+1;if(q.controlNav){e.removeClass("active");e.eq(i).addClass("active")}o(i)}}if(q.pauseOnHover){d.hover(function(){clearInterval(n)},function(){n=setInterval(p,q.slideshowSpeed)})}if(b.length>1){n=setInterval(p,q.slideshowSpeed)}}if(q.animation.toLowerCase()=="slide"){var f;a(window).resize(function(){b.width(d.width());c.width((b.length*d.width())+200);clearTimeout(f);f=setTimeout(function(){o(m)},300)})}}})})(jQuery);
\ No newline at end of file
+(function(a){a.flexslider=function(c,b){var d=c;d.init=function(){d.vars=a.extend({},a.flexslider.defaults,b);d.data("flexslider",true);d.container=a(".slides",d);d.slides=a(".slides > li",d);d.count=d.slides.length;d.animating=false;d.currentSlide=d.vars.slideToStart;d.animatingTo=d.currentSlide;d.atEnd=(d.currentSlide==0)?true:false;d.eventType=("ontouchstart" in document.documentElement)?"touchstart":"click";d.cloneCount=0;d.cloneOffset=0;d.manualPause=false;d.vertical=(d.vars.slideDirection=="vertical");d.prop=(d.vertical)?"top":"marginLeft";d.args={};d.transitions="webkitTransition" in document.body.style;if(d.transitions){d.prop="-webkit-transform"}if(d.vars.controlsContainer!=""){d.controlsContainer=a(d.vars.controlsContainer).eq(a(".slides").index(d.container));d.containerExists=d.controlsContainer.length>0}if(d.vars.manualControls!=""){d.manualControls=a(d.vars.manualControls,((d.containerExists)?d.controlsContainer:d));d.manualExists=d.manualControls.length>0}if(d.vars.randomize){d.slides.sort(function(){return(Math.round(Math.random())-0.5)});d.container.empty().append(d.slides)}if(d.vars.animation.toLowerCase()=="slide"){if(d.transitions){d.setTransition(0)}d.css({overflow:"hidden"});if(d.vars.animationLoop){d.cloneCount=2;d.cloneOffset=1;d.container.append(d.slides.filter(":first").clone().addClass("clone")).prepend(d.slides.filter(":last").clone().addClass("clone"))}d.newSlides=a(".slides > li",d);var m=(-1*(d.currentSlide+d.cloneOffset));if(d.vertical){d.newSlides.css({display:"block",width:"100%","float":"left"});d.container.height((d.count+d.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){d.css({position:"relative"}).height(d.slides.filter(":first").height());d.args[d.prop]=(d.transitions)?"translate3d(0,"+m*d.height()+"px,0)":m*d.height()+"px";d.container.css(d.args)},100)}else{d.args[d.prop]=(d.transitions)?"translate3d("+m*d.width()+"px,0,0)":m*d.width()+"px";d.container.width((d.count+d.cloneCount)*200+"%").css(d.args);setTimeout(function(){d.newSlides.width(d.width()).css({"float":"left",display:"block"})},100)}}else{d.transitions=false;d.slides.css({width:"100%","float":"left",marginRight:"-100%"}).eq(d.currentSlide).fadeIn(d.vars.animationDuration)}if(d.vars.controlNav){if(d.manualExists){d.controlNav=d.manualControls}else{var e=a('<ol class="flex-control-nav"></ol>');var s=1;for(var t=0;t<d.count;t++){e.append("<li><a>"+s+"</a></li>");s++}if(d.containerExists){a(d.controlsContainer).append(e);d.controlNav=a(".flex-control-nav li a",d.controlsContainer)}else{d.append(e);d.controlNav=a(".flex-control-nav li a",d)}}d.controlNav.eq(d.currentSlide).addClass("active");d.controlNav.bind(d.eventType,function(i){i.preventDefault();if(!a(this).hasClass("active")){(d.controlNav.index(a(this))>d.currentSlide)?d.direction="next":d.direction="prev";d.flexAnimate(d.controlNav.index(a(this)),d.vars.pauseOnAction)}})}if(d.vars.directionNav){var v=a('<ul class="flex-direction-nav"><li><a class="prev" href="#">'+d.vars.prevText+'</a></li><li><a class="next" href="#">'+d.vars.nextText+"</a></li></ul>");if(d.containerExists){a(d.controlsContainer).append(v);d.directionNav=a(".flex-direction-nav li a",d.controlsContainer)}else{d.append(v);d.directionNav=a(".flex-direction-nav li a",d)}if(!d.vars.animationLoop){if(d.currentSlide==0){d.directionNav.filter(".prev").addClass("disabled")}else{if(d.currentSlide==d.count-1){d.directionNav.filter(".next").addClass("disabled")}}}d.directionNav.bind(d.eventType,function(i){i.preventDefault();var j=(a(this).hasClass("next"))?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}})}if(d.vars.keyboardNav&&a("ul.slides").length==1){function h(i){if(d.animating){return}else{if(i.keyCode!=39&&i.keyCode!=37){return}else{if(i.keyCode==39){var j=d.getTarget("next")}else{if(i.keyCode==37){var j=d.getTarget("prev")}}if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}}}}a(document).bind("keyup",h)}if(d.vars.mousewheel){d.mousewheelEvent=(/Firefox/i.test(navigator.userAgent))?"DOMMouseScroll":"mousewheel";d.bind(d.mousewheelEvent,function(y){y.preventDefault();y=y?y:window.event;var i=y.detail?y.detail*-1:y.wheelDelta/40,j=(i<0)?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(j)){d.flexAnimate(j,d.vars.pauseOnAction)}})}if(d.vars.slideshow){if(d.vars.pauseOnHover&&d.vars.slideshow){d.hover(function(){d.pause()},function(){if(!d.manualPause){d.resume()}})}d.animatedSlides=setInterval(d.animateSlides,d.vars.slideshowSpeed)}if(d.vars.pausePlay){var q=a('<div class="flex-pauseplay"><span></span></div>');if(d.containerExists){d.controlsContainer.append(q);d.pausePlay=a(".flex-pauseplay span",d.controlsContainer)}else{d.append(q);d.pausePlay=a(".flex-pauseplay span",d)}var n=(d.vars.slideshow)?"pause":"play";d.pausePlay.addClass(n).text((n=="pause")?d.vars.pauseText:d.vars.playText);d.pausePlay.bind(d.eventType,function(i){i.preventDefault();if(a(this).hasClass("pause")){d.pause();d.manualPause=true}else{d.resume();d.manualPause=false}})}if("ontouchstart" in document.documentElement){var w,u,l,r,o,x,p=false;d.each(function(){if("ontouchstart" in document.documentElement){this.addEventListener("touchstart",g,false)}});function g(i){if(d.animating){i.preventDefault()}else{if(i.touches.length==1){d.pause();r=(d.vertical)?d.height():d.width();x=Number(new Date());l=(d.vertical)?(d.currentSlide+d.cloneOffset)*d.height():(d.currentSlide+d.cloneOffset)*d.width();w=(d.vertical)?i.touches[0].pageY:i.touches[0].pageX;u=(d.vertical)?i.touches[0].pageX:i.touches[0].pageY;d.setTransition(0);this.addEventListener("touchmove",k,false);this.addEventListener("touchend",f,false)}}}function k(i){o=(d.vertical)?w-i.touches[0].pageY:w-i.touches[0].pageX;p=(d.vertical)?(Math.abs(o)<Math.abs(i.touches[0].pageX-u)):(Math.abs(o)<Math.abs(i.touches[0].pageY-u));if(!p){i.preventDefault();if(d.vars.animation=="slide"&&d.transitions){if(!d.vars.animationLoop){o=o/((d.currentSlide==0&&o<0||d.currentSlide==d.count-1&&o>0)?(Math.abs(o)/r+2):1)}d.args[d.prop]=(d.vertical)?"translate3d(0,"+(-l-o)+"px,0)":"translate3d("+(-l-o)+"px,0,0)";d.container.css(d.args)}}}function f(j){d.animating=false;if(d.animatingTo==d.currentSlide&&!p&&!(o==null)){var i=(o>0)?d.getTarget("next"):d.getTarget("prev");if(d.canAdvance(i)&&Number(new Date())-x<550&&Math.abs(o)>20||Math.abs(o)>r/2){d.flexAnimate(i,d.vars.pauseOnAction)}else{d.flexAnimate(d.currentSlide,d.vars.pauseOnAction)}}this.removeEventListener("touchmove",k,false);this.removeEventListener("touchend",f,false);w=null;u=null;o=null;l=null}}if(d.vars.animation.toLowerCase()=="slide"){a(window).resize(function(){if(!d.animating){if(d.vertical){d.height(d.slides.filter(":first").height());d.args[d.prop]=(-1*(d.currentSlide+d.cloneOffset))*d.slides.filter(":first").height()+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}else{d.newSlides.width(d.width());d.args[d.prop]=(-1*(d.currentSlide+d.cloneOffset))*d.width()+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}}})}d.vars.start(d)};d.flexAnimate=function(g,f){if(!d.animating){d.animating=true;d.animatingTo=g;d.vars.before(d);if(f){d.pause()}if(d.vars.controlNav){d.controlNav.removeClass("active").eq(g).addClass("active")}d.atEnd=(g==0||g==d.count-1)?true:false;if(!d.vars.animationLoop&&d.vars.directionNav){if(g==0){d.directionNav.removeClass("disabled").filter(".prev").addClass("disabled")}else{if(g==d.count-1){d.directionNav.removeClass("disabled").filter(".next").addClass("disabled")}else{d.directionNav.removeClass("disabled")}}}if(!d.vars.animationLoop&&g==d.count-1){d.pause();d.vars.end(d)}if(d.vars.animation.toLowerCase()=="slide"){var e=(d.vertical)?d.slides.filter(":first").height():d.slides.filter(":first").width();if(d.currentSlide==0&&g==d.count-1&&d.vars.animationLoop&&d.direction!="next"){d.slideString="0px"}else{if(d.currentSlide==d.count-1&&g==0&&d.vars.animationLoop&&d.direction!="prev"){d.slideString=(-1*(d.count+1))*e+"px"}else{d.slideString=(-1*(g+d.cloneOffset))*e+"px"}}d.args[d.prop]=d.slideString;if(d.transitions){d.setTransition(d.vars.animationDuration);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.slideString+",0)":"translate3d("+d.slideString+",0,0)";d.container.css(d.args).one("webkitTransitionEnd transitionend",function(){d.wrapup(e)})}else{d.container.animate(d.args,d.vars.animationDuration,function(){d.wrapup(e)})}}else{d.slides.eq(d.currentSlide).fadeOut(d.vars.animationDuration);d.slides.eq(g).fadeIn(d.vars.animationDuration,function(){d.wrapup()})}}};d.wrapup=function(e){if(d.vars.animation=="slide"){if(d.currentSlide==0&&d.animatingTo==d.count-1&&d.vars.animationLoop){d.args[d.prop]=(-1*d.count)*e+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}else{if(d.currentSlide==d.count-1&&d.animatingTo==0&&d.vars.animationLoop){d.args[d.prop]=-1*e+"px";if(d.transitions){d.setTransition(0);d.args[d.prop]=(d.vertical)?"translate3d(0,"+d.args[d.prop]+",0)":"translate3d("+d.args[d.prop]+",0,0)"}d.container.css(d.args)}}}d.animating=false;d.currentSlide=d.animatingTo;d.vars.after(d)};d.animateSlides=function(){if(!d.animating){d.flexAnimate(d.getTarget("next"))}};d.pause=function(){clearInterval(d.animatedSlides);if(d.vars.pausePlay){d.pausePlay.removeClass("pause").addClass("play").text(d.vars.playText)}};d.resume=function(){d.animatedSlides=setInterval(d.animateSlides,d.vars.slideshowSpeed);if(d.vars.pausePlay){d.pausePlay.removeClass("play").addClass("pause").text(d.vars.pauseText)}};d.canAdvance=function(e){if(!d.vars.animationLoop&&d.atEnd){if(d.currentSlide==0&&e==d.count-1&&d.direction!="next"){return false}else{if(d.currentSlide==d.count-1&&e==0&&d.direction=="next"){return false}else{return true}}}else{return true}};d.getTarget=function(e){d.direction=e;if(e=="next"){return(d.currentSlide==d.count-1)?0:d.currentSlide+1}else{return(d.currentSlide==0)?d.count-1:d.currentSlide-1}};d.setTransition=function(e){d.container.css({"-webkit-transition-duration":(e/1000)+"s"})};d.init()};a.flexslider.defaults={animation:"fade",slideDirection:"horizontal",slideshow:true,slideshowSpeed:7000,animationDuration:600,directionNav:true,controlNav:true,keyboardNav:true,mousewheel:false,prevText:"Previous",nextText:"Next",pausePlay:false,pauseText:"Pause",playText:"Play",randomize:false,slideToStart:0,animationLoop:true,pauseOnAction:true,pauseOnHover:false,controlsContainer:"",manualControls:"",start:function(){},before:function(){},after:function(){},end:function(){}};a.fn.flexslider=function(b){return this.each(function(){if(a(this).find(".slides li").length==1){a(this).find(".slides li").fadeIn(400)}else{if(a(this).data("flexslider")!=true){new a.flexslider(a(this),b)}}})}})(jQuery);
\ No newline at end of file
Index: index.tpl
===================================================================
--- index.tpl (revision 14841)
+++ index.tpl (working copy)
@@ -10,9 +10,9 @@
<!--## SIDE-BAR ELEMENT ##-->
<inp2:m_DefineElement name="sidebar">
- <inp2:m_Include template="elements/side_boxes/categories.elm" data_exists="1"/>
- <inp2:m_Include template="elements/side_boxes/picks.elm" data_exists="1"/>
- <inp2:m_Include template="elements/side_boxes/subscribe.elm"/>
+ <inp2:m_Include template="elements/side_boxes/categories.elm" data_exists="1"/>
+ <inp2:m_Include template="elements/side_boxes/picks.elm" data_exists="1"/>
+ <inp2:m_Include template="elements/side_boxes/subscribe.elm"/>
</inp2:m_DefineElement>
<!--## /SIDE-BAR ELEMENT ##-->
@@ -20,11 +20,11 @@
<inp2:m_DefineElement name="content">
<inp2:m_Include template="elements/promo.elm" strip_nl="2"/>
-
+
<inp2:m_Include template="elements/content_boxes/special_deals.elm" data_exists="1" strip_nl="2"/>
-
+
<inp2:m_Include template="elements/content_boxes/new_products.elm" data_exists="1" strip_nl="2"/>
-
+
<inp2:m_RenderElement design="content_box">
<inp2:m_Capture to_var="header">
<inp2:m_phrase name="lu_title_WelcomeTitle"/>
@@ -32,7 +32,7 @@
<inp2:st_ContentBlock num="1"/>
</inp2:m_RenderElement>
-
+
</inp2:m_DefineElement>
<!--## /MAIN CONTENT ##-->
@@ -63,11 +63,6 @@
autoHeight: false,
event: "mouseover"
});
- $('#slider').flexslider({
- directionNav: false,
- prevText: "",
- nextText: ""
- });
});
</script>
</inp2:m_DefineElement>
promo_blocks_core_v2-MissingDropSchema.patch [^] (311 bytes) 2011-12-19 18:10
[Show Content]
Index: install/remove_schema.sql
===================================================================
--- install/remove_schema.sql (revision 14884)
+++ install/remove_schema.sql (working copy)
@@ -72,3 +72,4 @@
DROP TABLE CachedUrls;
DROP TABLE SiteDomains;
DROP TABLE CurlLog;
+DROP TABLE PromoBlocks;
promo_blocks_core_v3_1128.patch [^] (75,325 bytes) 2011-12-27 09:54
[Show Content]
Index: admin/system_presets/simple/promo_block_groups_promo-block-group.php
===================================================================
--- admin/system_presets/simple/promo_block_groups_promo-block-group.php (revision 0)
+++ admin/system_presets/simple/promo_block_groups_promo-block-group.php (revision 0)
@@ -0,0 +1,53 @@
+<?php
+
+ defined('FULL_PATH') or die('restricted access!');
+
+ // section removal
+ $remove_sections = Array (
+// 'in-portal:promo_block_groups',
+ );
+
+ // sections shown with debug on
+ $debug_only_sections = Array (
+ 'in-portal:promo_block_groups',
+ );
+
+ // toolbar buttons
+ $remove_buttons = Array (
+// list of promo block groups
+// 'promo_block_groups_list' => Array ('new_item', 'edit', 'delete', 'view', 'dbl-click'),
+
+// editing promo block group
+// 'promo_block_groups_edit' => Array ('select', 'cancel', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'PromoBlockGroupId', 'Title', 'CreatedOn', 'Status', 'RotationDelay', 'TransitionTime', 'TransitionControls', 'TransitionEffect', 'TransitionEffectCustom', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'PromoBlockGroupId', */ 'Title', /* 'CreatedOn', 'Status', 'RotationDelay', 'TransitionTime', 'TransitionControls', 'TransitionEffect', 'TransitionEffectCustom', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// tabs during form editing
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// list of promo block groups
+// 'Default' => Array ('PromoBlockGroupId', 'Title'),
+ );
Index: core/admin_templates/categories/categories_edit.tpl
===================================================================
--- core/admin_templates/categories/categories_edit.tpl (revision 14902)
+++ core/admin_templates/categories/categories_edit.tpl (working copy)
@@ -139,6 +139,7 @@
<inp2:m_RenderElement name="inp_edit_options" prefix="c" field="FormId" title="la_fld_Form"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="FormSubmittedTemplate" title="la_fld_FormSubmittedTemplate" size="60"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="c" field="IsMenu" title="la_fld_MenuStatus"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="c" field="PromoBlockGroupId" title="la_fld_PromoBlockGroup" has_empty="1"/>
<inp2:m_if check="m_IsDebugMode">
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c" field="Protected" title="la_fld_Protected"/>
Index: core/admin_templates/promo_block_groups/promo_block_group_edit.tpl
===================================================================
--- core/admin_templates/promo_block_groups/promo_block_group_edit.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/promo_block_group_edit.tpl (revision 0)
@@ -0,0 +1,130 @@
+<inp2:adm_SetPopupSize width="700" height="585"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_block_groups" prefix="promo-block-group" title_preset="promo_block_group_edit"/>
+
+<!-- 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" escape="1"/>', function() {
+ submit_event('promo-block-group', '<inp2:promo-block-group_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ cancel_edit('promo-block-group', 'OnCancelEdit','<inp2:promo-block-group_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
+ reset_form('promo-block-group', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('promo-block-group', '<inp2:promo-block-group_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('promo-block-group', '<inp2:promo-block-group_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if check="promo-block-group_IsSingle" >
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if check="promo-block-group_IsLast" >
+ a_toolbar.DisableButton('next');
+ </inp2:m_if>
+ <inp2:m_if check="promo-block-group_IsFirst" >
+ a_toolbar.DisableButton('prev');
+ </inp2:m_if>
+ </inp2:m_if>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:promo-block-group_SaveWarning name="grid_save_warning"/>
+<inp2:promo-block-group_ErrorWarning name="form_error_warning"/>
+
+<inp2:m_DefineElement name="inp_edit_options_custom" onchange="" has_empty="0" empty_value="" style="" style_custom="" " format="" maxlength="" size="" class="">
+ <inp2:m_RenderElement design="form_row" pass_params="1">
+ <td class="control-cell">
+ <select tabindex="<inp2:m_Get name='tab_index'/>" name="<inp2:{$prefix}_InputName field='$field'/>" id="<inp2:{$prefix}_InputName field='$field'/>" onchange="setup_custom_input_<inp2:m_param name='field'/>();<inp2:m_Param name='onchange'/>" style="<inp2:m_Param name='style'/>">
+ <inp2:m_if check="{$prefix}_FieldOption" field="$field" option="use_phrases">
+ <inp2:{$prefix}_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
+ <inp2:m_else/>
+ <inp2:{$prefix}_PredefinedOptions field="$field" block="inp_option_item" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
+ </inp2:m_if>
+ </select>
+
+ <input style="<inp2:m_Param name='style_custom'/>" type="text" name="<inp2:{$prefix}_InputName field='{$field}Custom'/>" id="<inp2:{$prefix}_InputName field='{$field}Custom'/>" value="<inp2:{$prefix}_Field field='{$field}Custom' format='$format'/>" tabindex="<inp2:m_Get name='tab_index'/>" size="<inp2:m_param name='size'/>" maxlength="<inp2:m_param name='maxlength'/>" class="<inp2:m_param name='class'/>">
+
+ <script type="text/javascript">
+ function setup_custom_input_<inp2:m_param name='field'/>() {
+ var custom_id = '<inp2:{$prefix}_InputName field="{$field}Custom"/>';
+ if ( $('#' + jq('<inp2:{$prefix}_InputName field="{$field}"/>')).val() == '-1' ) {
+ $('#' + jq(custom_id)).show();
+ } else {
+ $('#' + jq(custom_id)).hide();
+ }
+
+ }
+ </script>
+ </td>
+ </inp2:m_RenderElement>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="category_caption">
+ <inp2:m_ifnot check="m_Param" name="is_first">
+ <inp2:m_param name="separator"/>
+ </inp2:m_ifnot>
+ <inp2:m_param name="cat_name"/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="category_path">
+ <inp2:c_CategoryPath cat_id="$cat_id" render_as="category_caption" separator=">"/><br/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="inp_sections_label" style="" format="" db="" as_label="" currency="" no_special="" nl2br="0" with_hidden="0" after_text="">
+ <inp2:m_RenderElement design="form_row" pass_params="1">
+ <td class="control-cell" valign="top">
+ <span style="<inp2:m_Param name='style'/>" id="<inp2:$prefix_InputName field='$field'/>">
+ <inp2:{$prefix}_PrintCategories field="$field" render_as="category_path"/>
+ </span>
+ </td>
+ </inp2:m_RenderElement>
+</inp2:m_DefineElement>
+
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" prefix="promo-block-group" fields="PromoBlockGroupId,Title,CreatedOn,Status,AssignedToSections" title="la_section_General"/>
+
+ <inp2:m_RenderElement name="inp_id_label" prefix="promo-block-group" field="PromoBlockGroupId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="Title" maxlength="50"/>
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block-group" field="CreatedOn"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block-group" field="Status"/>
+ <inp2:m_RenderElement name="inp_sections_label" prefix="promo-block-group" field="AssignedToSections"/>
+ <inp2:m_RenderElement name="subsection" prefix="promo-block-group" fields="RotationDelay,TransitionTime,TransitionControls,TransitionEffect" title="la_section_Settings"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="RotationDelay"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="TransitionTime"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block-group" field="TransitionControls"/>
+ <inp2:m_RenderElement name="inp_edit_options_custom" prefix="promo-block-group" field="TransitionEffect" has_empty="1"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
+<inp2:m_include t="incs/footer"/>
Index: core/admin_templates/promo_block_groups/promo_block_group_list.tpl
===================================================================
--- core/admin_templates/promo_block_groups/promo_block_group_list.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/promo_block_group_list.tpl (revision 0)
@@ -0,0 +1,71 @@
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_block_groups" prefix="promo-block-group" title_preset="promo_block_group_list" />
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ <inp2:m_include t="promo_block_groups/section_reload"/>
+
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+ std_edit_item('promo-block-group', 'promo_block_groups/promo_block_group_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
+ function() {
+ std_precreate_item('promo-block-group', 'promo_block_groups/promo_block_group_edit');
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('promo-block-group')
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
+ submit_event('promo-block-group', 'OnMassApprove');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
+ submit_event('promo-block-group', 'OnMassDecline');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="promo-block-group" grid="Default"/>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_if check="m_Recall" var="promo_group_has_block">
+ <inp2:m_RenderElement design="form_message" pass_params="1">
+ <inp2:m_Phrase name="la_Warning_CantDeletePromoBlockGroup"/><br/>
+ <span style="font-weight: bold;"><inp2:m_Phrase name="la_Warning_PromoBlockGroupHasBlock"/> #<inp2:m_Recall var="promo_group_has_block"/> <br/></span>
+ </inp2:m_RenderElement>
+ <inp2:m_RemoveVar name="promo_group_has_block" />
+</inp2:m_if>
+
+
+<inp2:m_RenderElement name="grid" PrefixSpecial="promo-block-group" IdField="PromoBlockGroupId" grid="Default" grid_filters="1"/>
+<script type="text/javascript">
+ Grids['promo-block-group'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline') );
+</script>
+
+<inp2:m_include t="incs/footer"/>
Index: core/admin_templates/promo_block_groups/section_reload.tpl
===================================================================
--- core/admin_templates/promo_block_groups/section_reload.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/section_reload.tpl (revision 0)
@@ -0,0 +1,13 @@
+var $menu_frame = getFrame('menu');
+
+if ( $menu_frame.ajax_requests_count == 0 ) {
+ <inp2:m_if check="m_Recall" var="RefreshPromoBlocksTree">
+ <inp2:m_DefineElement name="structure_node">
+ $menu_frame.ReloadFolder('<inp2:m_param name="section_url" js_escape="1"/>', true);
+ </inp2:m_DefineElement>
+ <inp2:adm_PrintSection render_as="structure_node" section_name="in-portal:promo_block_groups"/>
+ <inp2:m_RemoveVar var="RefreshPromoBlocksTree"/>
+ </inp2:m_if>
+
+ $menu_frame.SyncActive('<inp2:m_t pass="m" m_opener="r"/>');
+}
Index: core/admin_templates/promo_block_groups/tree_section_xml.tpl
===================================================================
--- core/admin_templates/promo_block_groups/tree_section_xml.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/tree_section_xml.tpl (revision 0)
@@ -0,0 +1,8 @@
+<inp2:m_XMLTemplate/>
+<tree>
+<inp2:m_DefineElement name="xml_node" icon_module="">
+ <inp2:Field field="PromoBlockGroupId" result_to_var="group_id"/>
+ <item href="<inp2:m_Link t="promo_blocks/promo_block_list" group_id="$group_id" js_escape="1" direct_link='1' pass='m' m_opener='r'/>" icon="<inp2:c_ModulePath module='core'/>img/icons/icon24_section.png"><inp2:Field field="Title"/></item>
+</inp2:m_DefineElement>
+<inp2:promo-block-group_PrintList render_as="xml_node"/>
+</tree>
\ No newline at end of file
Index: core/admin_templates/promo_blocks/promo_block_edit.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_edit.tpl (revision 14902)
+++ core/admin_templates/promo_blocks/promo_block_edit.tpl (working copy)
@@ -1,6 +1,5 @@
<inp2:adm_SetPopupSize width="700" height="585"/>
<inp2:m_include t="incs/header"/>
-
<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_edit"/>
<!-- ToolBar --->
@@ -78,6 +77,7 @@
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="promo-block" field="BlockId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="PromoBlockGroupId" title="la_fld_PromoBlockGroup" has_empty="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="promo-block" field="Title" maxlength="50"/>
<inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="promo-block" field="Html" title="la_fld_Text" control_options="{min_height: 60}" rows="4" cols="70"/>
Index: core/admin_templates/promo_blocks/promo_block_list.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_list.tpl (revision 14902)
+++ core/admin_templates/promo_blocks/promo_block_list.tpl (working copy)
@@ -1,5 +1,5 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_list" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" pagination="1" title_preset="promo_block_list" />
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -7,6 +7,9 @@
<tr>
<td>
<script type="text/javascript">
+
+ <inp2:m_include t="promo_block_groups/section_reload"/>
+
//do not rename - this function is used in default grid for double click!
function edit()
{
@@ -51,6 +54,12 @@
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+ a_toolbar.AddButton( new ToolBarButton('tools', '<inp2:m_phrase label="la_ToolTip_Settings" escape="1"/>', function() {
+ <inp2:m_Get var="group_id" result_to_var="group_id"/>
+ direct_edit('promo-block', '<inp2:m_Link t="promo_block_groups/promo_block_group_edit" pass="m,promo-block-group" m_opener="d" promo-block-group_mode="t" promo-block-group_event="OnEdit" promo-block-group_id="$group_id" no_pass_through="1" no_amp="1"/>');
+ }
+ ) );
+
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
Index: core/admin_templates/tree.tpl
===================================================================
--- core/admin_templates/tree.tpl (revision 14902)
+++ core/admin_templates/tree.tpl (working copy)
@@ -182,6 +182,15 @@
<inp2:adm_PrintSection render_as="forms_node" section_name="in-portal:forms"/>
</inp2:m_ifnot>
</inp2:m_if>
+ <inp2:m_if check="m_GetConfig" name="DebugOnlyPromoBlockGroupConfigurator">
+ <inp2:m_ifnot check="m_IsDebugMode">
+ <inp2:m_DefineElement name="promo_blocks_node">
+ var $promo_blocks_node = the_tree.locateItemByURL('<inp2:m_param name="section_url" js_escape="1"/>');
+ $promo_blocks_node.Container = true;
+ </inp2:m_DefineElement>
+ <inp2:adm_PrintSection render_as="promo_blocks_node" section_name="in-portal:promo_block_groups"/>
+ </inp2:m_ifnot>
+ </inp2:m_if>
</script>
<!--## when form is on top, then 100% height is broken ##-->
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14902)
+++ core/install/english.lang (working copy)
@@ -149,6 +149,7 @@
<PHRASE Label="la_config_CSVExportEncoding" Module="Core" Type="1">RGVmYXVsdCBDU1YgRXhwb3J0IEVuY29kaW5n</PHRASE>
<PHRASE Label="la_config_CSVExportSeparator" Module="Core" Type="1">RGVmYXVsdCBDU1YgRXhwb3J0IE5ldyBMaW5lIFNlcGFyYXRvcg==</PHRASE>
<PHRASE Label="la_config_DebugOnlyFormConfigurator" Module="Core" Type="1">U2hvdyAiRm9ybXMgRWRpdG9yIiBpbiBERUJVRyBtb2RlIG9ubHk=</PHRASE>
+ <PHRASE Label="la_config_DebugOnlyPromoBlockGroupConfigurator" Module="Core" Type="1">U2hvdyAiUHJvbW8gQmxvY2sgR3JvdXBzIEVkaXRvciIgaW4gREVCVUcgbW9kZSBvbmx5</PHRASE>
<PHRASE Label="la_config_DefaultDesignTemplate" Module="Core" Type="1">RGVmYXVsdCBEZXNpZ24gVGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_config_DefaultRegistrationCountry" Module="Core" Type="1">RGVmYXVsdCBSZWdpc3RyYXRpb24gQ291bnRyeQ==</PHRASE>
<PHRASE Label="la_config_DefaultTrackingCode" Module="Core" Type="1">RGVmYXVsdCBBbmFseXRpY3MgVHJhY2tpbmcgQ29kZQ==</PHRASE>
@@ -306,6 +307,7 @@
<PHRASE Label="la_fld_AllowChangingSender" Module="Core" Type="1">QWxsb3cgQ2hhbmdpbmcgU2VuZGVy</PHRASE>
<PHRASE Label="la_fld_AltValue" Module="Core" Type="1">QWx0IFZhbHVl</PHRASE>
<PHRASE Label="la_fld_Answer" Module="Core" Type="1">QW5zd2Vy</PHRASE>
+ <PHRASE Label="la_fld_AssignedToSections" Module="Core" Type="1">QXNzaWduZWQgdG8gU2VjdGlvbnM=</PHRASE>
<PHRASE Label="LA_FLD_ATTACHMENT" Module="Core" Type="1">QXR0YWNobWVudA==</PHRASE>
<PHRASE Label="la_fld_AutoCreateFileName" Module="Core" Type="1">QXV0byBDcmVhdGUgRmlsZSBOYW1l</PHRASE>
<PHRASE Label="la_fld_AutomaticFilename" Module="Core" Type="1">QXV0b21hdGljIEZpbGVuYW1l</PHRASE>
@@ -540,6 +542,7 @@
<PHRASE Label="la_fld_PrimaryTranslation" Module="Core" Type="1">UHJpbWFyeSBMYW5ndWFnZSBQaHJhc2U=</PHRASE>
<PHRASE Label="la_fld_Priority" Module="Core" Type="1" Column="T3JkZXI=">T3JkZXI=</PHRASE>
<PHRASE Label="la_fld_ProcessUnmatchedEmails" Module="Core" Type="1">Q29udmVydCB1bm1hdGNoZWQgZS1tYWlscyBpbnRvIG5ldyBzdWJtaXNzaW9ucw==</PHRASE>
+ <PHRASE Label="la_fld_PromoBlockGroup" Module="Core" Type="1">UHJvbW8gQmxvY2sgR3JvdXA=</PHRASE>
<PHRASE Label="la_fld_Protected" Module="Core" Type="1" Column="UHJvdGVjdGVk">UHJvdGVjdGVk</PHRASE>
<PHRASE Label="la_fld_Qty" Module="Core" Type="1" Column="UXR5">UXVhbnRpdHk=</PHRASE>
<PHRASE Label="la_fld_Rating" Module="Core" Type="1" Column="UmF0aW5n">UmF0aW5n</PHRASE>
@@ -568,6 +571,7 @@
<PHRASE Label="la_fld_Required" Module="Core" Type="1" Column="UmVxdWlyZWQ=">UmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_fld_RequireLogin" Module="Core" Type="1" Column="UmVxdWlyZSBMb2dpbg==">UmVxdWlyZSBMb2dpbg==</PHRASE>
<PHRASE Label="la_fld_ReviewText" Module="Core" Type="1" Column="Q29tbWVudA==">Q29tbWVudA==</PHRASE>
+ <PHRASE Label="la_fld_RotationDelay" Module="Core" Type="1" Column="UHJvbW8gUm90YXRpb24gRGVsYXkgKHNlY29uZHMp">UHJvbW8gUm90YXRpb24gRGVsYXkgKHNlY29uZHMp</PHRASE>
<PHRASE Label="la_fld_RuleType" Module="Core" Type="1" Column="UnVsZSBUeXBl">UnVsZSBUeXBl</PHRASE>
<PHRASE Label="la_fld_RunInterval" Module="Core" Type="1" Column="UnVuIEludGVydmFs">UnVuIEludGVydmFs</PHRASE>
<PHRASE Label="la_fld_RunMode" Module="Core" Type="1" Column="UnVuIE1vZGU=">UnVuIE1vZGU=</PHRASE>
@@ -621,6 +625,9 @@
<PHRASE Label="la_fld_ToEmail" Module="Core" Type="1" Column="VG8gRS1tYWls">VG8gRS1tYWls</PHRASE>
<PHRASE Label="la_fld_Top" Module="Core" Type="1">VG9w</PHRASE>
<PHRASE Label="la_fld_TrackingCode" Module="Core" Type="1">QW5hbHl0aWNzIFRyYWNraW5nIENvZGU=</PHRASE>
+ <PHRASE Label="la_fld_TransitionControls" Module="Core" Type="1" Column="UHJvbW8gVHJhbnNpdGlvbiBDb250cm9scw==">UHJvbW8gVHJhbnNpdGlvbiBDb250cm9scw==</PHRASE>
+ <PHRASE Label="la_fld_TransitionEffect" Module="Core" Type="1" Column="UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3Q=">UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3Q=</PHRASE>
+ <PHRASE Label="la_fld_TransitionTime" Module="Core" Type="1" Column="VHJhbnNpdGlvbiBEZWxheSAoc2Vjb25kcyk=">VHJhbnNpdGlvbiBEZWxheSAoc2Vjb25kcyk=</PHRASE>
<PHRASE Label="la_fld_Translation" Module="Core" Type="1" Column="VmFsdWU=">UGhyYXNl</PHRASE>
<PHRASE Label="la_fld_Type" Module="Core" Type="1" Column="VHlwZQ==">VHlwZQ==</PHRASE>
<PHRASE Label="la_fld_UnitSystem" Module="Core" Type="1">TWVhc3VyZXMgU3lzdGVt</PHRASE>
@@ -749,6 +756,7 @@
<PHRASE Label="la_opt_Address" Module="Core" Type="1">QWRkcmVzcw==</PHRASE>
<PHRASE Label="la_opt_After" Module="Core" Type="1">QWZ0ZXI=</PHRASE>
<PHRASE Label="la_opt_Allow" Module="Core" Type="1">QWxsb3c=</PHRASE>
+ <PHRASE Label="la_opt_AnimationCustom" Module="Core" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_opt_AnimationFade" Module="Core" Type="1">RmFkZQ==</PHRASE>
<PHRASE Label="la_opt_AnimationSlide" Module="Core" Type="1">U2xpZGU=</PHRASE>
<PHRASE Label="la_opt_AutoDetect" Module="Core" Type="1">QXV0by1EZXRlY3Q=</PHRASE>
@@ -1254,6 +1262,7 @@
<PHRASE Label="la_title_Adding_Review" Module="Core" Type="1">QWRkaW5nIENvbW1lbnQ=</PHRASE>
<PHRASE Label="la_title_Adding_Theme" Module="Core" Type="1">QWRkaW5nIFRoZW1l</PHRASE>
<PHRASE Label="la_title_Adding_User" Module="Core" Type="1">QWRkaW5nIFVzZXI=</PHRASE>
+ <PHRASE Label="la_title_AddingPromoBlockGroup" Module="Core" Type="1">QWRkaW5nIFByb21vIEJsb2NrIEdyb3Vw</PHRASE>
<PHRASE Label="la_title_AdditionalPermissions" Module="Core" Type="1">QWRkaXRpb25hbCBQZXJtaXNzaW9ucw==</PHRASE>
<PHRASE Label="la_title_Administrators" Module="Core" Type="1">QWRtaW5pc3RyYXRvcnM=</PHRASE>
<PHRASE Label="la_title_Advanced" Module="Core" Type="1">QWR2YW5jZWQ=</PHRASE>
@@ -1308,6 +1317,7 @@
<PHRASE Label="la_title_Editing_Review" Module="Core" Type="1">RWRpdGluZyBDb21tZW50</PHRASE>
<PHRASE Label="la_title_Editing_Theme" Module="Core" Type="1">RWRpdGluZyBUaGVtZQ==</PHRASE>
<PHRASE Label="la_title_Editing_User" Module="Core" Type="1">RWRpdGluZyBVc2Vy</PHRASE>
+ <PHRASE Label="la_title_EditingPromoBlockGroup" Module="Core" Type="1">RWRpdGluZyBQcm9tbyBCbG9jayBHcm91cA==</PHRASE>
<PHRASE Label="la_title_EmailCommunication" Module="Core" Type="1">RS1tYWlsIENvbW11bmljYXRpb24=</PHRASE>
<PHRASE Label="la_title_EmailEvents" Module="Core" Type="1">RS1tYWlsIEV2ZW50cw==</PHRASE>
<PHRASE Label="la_title_EmailMessages" Module="Core" Type="1">RS1tYWlscw==</PHRASE>
@@ -1489,6 +1499,7 @@
<PHRASE Label="la_ToolTip_setprimarycategory" Module="Core" Type="1">U2V0IFByaW1hcnkgU2VjdGlvbg==</PHRASE>
<PHRASE Label="la_ToolTip_SetPrimaryLanguage" Module="Core" Type="1">U2V0IFByaW1hcnkgTGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_ToolTip_SetSticky" Module="Core" Type="1">U2V0IFN0aWNreQ==</PHRASE>
+ <PHRASE Label="la_ToolTip_Settings" Module="Core" Type="1">U2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_ToolTip_ShowMenu" Module="Core" Type="1">U2hvdyBNZW51</PHRASE>
<PHRASE Label="la_ToolTip_SynchronizeLanguages" Module="Core" Type="1">U3luY2hyb25pemUgTGFuZ3VhZ2Vz</PHRASE>
<PHRASE Label="la_ToolTip_Tools" Module="Core" Type="1">VG9vbHM=</PHRASE>
@@ -1531,9 +1542,11 @@
<PHRASE Label="la_ValidationEmail" Module="Core" Type="1">RS1tYWlsIGFkZHJlc3M=</PHRASE>
<PHRASE Label="la_Value" Module="Core" Type="1">VmFsdWU=</PHRASE>
<PHRASE Label="la_visit_DirectReferer" Module="Core" Type="1">RGlyZWN0IGFjY2VzcyBvciBib29rbWFyaw==</PHRASE>
+ <PHRASE Label="la_Warning_CantDeletePromoBlockGroup" Module="Core" Type="1">Q2FuJ3QgRGVsZXRlIFByb21vIEJsb2NrIEdyb3Vw</PHRASE>
<PHRASE Label="la_Warning_Enable_HTML" Module="Core" Type="1">V2FybmluZzogRW5hYmxpbmcgSFRNTCBpcyBhIHNlY3VyaXR5IHJpc2sgYW5kIGNvdWxkIGRhbWFnZSB0aGUgc3lzdGVtIGlmIHVzZWQgaW1wcm9wZXJseSE=</PHRASE>
<PHRASE Label="la_Warning_Filter" Module="Core" Type="1">QSBzZWFyY2ggb3IgYSBmaWx0ZXIgaXMgaW4gZWZmZWN0LiBZb3UgbWF5IG5vdCBiZSBzZWVpbmcgYWxsIG9mIHRoZSBkYXRhLg==</PHRASE>
<PHRASE Label="la_Warning_NewFormError" Module="Core" Type="1">T25lIG9yIG1vcmUgZmllbGRzIG9uIHRoaXMgZm9ybSBoYXMgYW4gZXJyb3IuPGJyLz4NCjxzbWFsbD5QbGVhc2UgbW92ZSB5b3VyIG1vdXNlIG92ZXIgdGhlIGZpZWxkcyBtYXJrZWQgd2l0aCByZWQgdG8gc2VlIHRoZSBlcnJvciBkZXRhaWxzLjwvc21hbGw+</PHRASE>
+ <PHRASE Label="la_Warning_PromoBlockGroupHasBlock" Module="Core" Type="1">UHJvbW8gQmxvY2sgR3JvdXAgSGFzIEJsb2Nr</PHRASE>
<PHRASE Label="la_Warning_Save_Item" Module="Core" Type="1">TW9kaWZpY2F0aW9ucyB3aWxsIG5vdCB0YWtlIGVmZmVjdCB1bnRpbCB5b3UgY2xpY2sgdGhlIFNhdmUgYnV0dG9uIQ==</PHRASE>
<PHRASE Label="la_week" Module="Core" Type="1">d2Vlaw==</PHRASE>
<PHRASE Label="la_Windows" Module="Core" Type="1">V2luZG93cw==</PHRASE>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14902)
+++ core/install/install_data.sql (working copy)
@@ -67,11 +67,12 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ResizableFrames', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_ResizableFrames', 'checkbox', '', '', 40.10, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AutoRefreshIntervals', '1,5,15,30,60,120,240', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_AutoRefreshIntervals', 'text', '', '', 40.11, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DebugOnlyFormConfigurator', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DebugOnlyFormConfigurator', 'checkbox', '', '', 40.12, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'RememberLastAdminTemplate', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_RememberLastAdminTemplate', 'checkbox', '', '', 40.13, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseHTTPAuth', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseHTTPAuth', 'checkbox', '', '', 40.14, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthUsername', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthUsername', 'text', '', '', 40.15, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthPassword', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthPassword', 'password', NULL, NULL, 40.16, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthBypassIPs', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthBypassIPs', 'text', '', '', 40.17, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DebugOnlyPromoBlockGroupConfigurator', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DebugOnlyPromoBlockGroupConfigurator', 'checkbox', '', '', 40.13, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'RememberLastAdminTemplate', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_RememberLastAdminTemplate', 'checkbox', '', '', 40.14, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseHTTPAuth', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseHTTPAuth', 'checkbox', '', '', 40.15, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthUsername', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthUsername', 'text', '', '', 40.16, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthPassword', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthPassword', 'password', NULL, NULL, 40.17, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthBypassIPs', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthBypassIPs', 'text', '', '', 40.18, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_Server', NULL, 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_mailserver', 'text', NULL, NULL, 50.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_Port', NULL, 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_mailport', 'text', NULL, NULL, 50.02, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_Authenticate', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_mailauthenticate', 'checkbox', NULL, NULL, 50.03, 0, 1, NULL);
@@ -95,12 +96,6 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux||1=la_Windows', 70.03, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode||1=la_Regular', 70.04, 0, 1, NULL);
-# Section "in-portal:configure_promo_blocks":
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.6', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'fade', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'fade=la_opt_AnimationFade||slide=la_opt_AnimationSlide', 10.04, 0, 0, NULL);
-
# Section "in-portal:configure_users":
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_allow_new', 'radio', '', '1=la_opt_UserInstantRegistration||2=la_opt_UserNotAllowedRegistration||3=la_opt_UserUponApprovalRegistration||4=la_opt_UserEmailActivation', 10.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AdvancedUserManagement', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_prompt_AdvancedUserManagement', 'checkbox', NULL, NULL, 10.011, 0, 1, NULL);
@@ -705,6 +700,16 @@
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:permission_types.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:permission_types.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.delete', 11, 1, 1, 0);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.delete', 11, 1, 1, 0);
+
INSERT INTO Skins VALUES (DEFAULT, 'Default', '/* General elements */\r\n\r\nhtml {\r\n height: 100%;\r\n}\r\n\r\nbody {\r\n font-family: verdana,arial,helvetica,sans-serif;\r\n color: #000000;\r\n overflow-x: auto; overflow-y: auto;\r\n margin: 0px 0px 0px 0px;\r\n text-decoration: none;\r\n}\r\n\r\nbody, td {\r\n /* fix for Firefox, when font-size was not inherited in table cells */\r\n font-size: 9pt;\r\n}\r\n\r\na {\r\n color: #006699;\r\n text-decoration: none;\r\n}\r\n\r\na:hover {\r\n color: #009ff0;\r\n text-decoration: none;\r\n}\r\n\r\nform {\r\n display: inline;\r\n}\r\n\r\nimg { border: 0px; }\r\n\r\nbody.height-100 {\r\n height: 100%;\r\n}\r\n\r\nbody.regular-body {\r\n margin: 0px 10px 5px 10px;\r\n color: #000000;\r\n background-color: @@SectionBgColor@@;\r\n}\r\n\r\nbody.edit-popup {\r\n margin: 0px 0px 0px 0px;\r\n}\r\n\r\ntable.collapsed {\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered, table.bordered, .bordered-no-bottom {\r\n border: 1px solid #000000 !important;\r\n border-top-width: 0px;\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered-no-bottom {\r\n border-top-width: 1px;\r\n border-bottom: none;\r\n}\r\n\r\n.login-table td {\r\n padding: 1px;\r\n}\r\n\r\n.disabled {\r\n background-color: #ebebeb;\r\n}\r\n\r\n/* Head frame */\r\ntable.head-table {\r\n background: url(''@@base_url@@/core/admin_templates/img/top_frame/right_background.png'') top right @@HeadBgColor@@ no-repeat;\r\n}\r\n\r\n.head-table tr td, .head-table tr td a {\r\n color: @@HeadColor@@\r\n}\r\n\r\ndiv#extra_toolbar td.button-active {\r\n background: url(''@@base_url@@/core/admin_templates/img/top_frame/toolbar_button_background.gif'') bottom left repeat-x;\r\n height: 22px;\r\n}\r\n\r\ndiv#extra_toolbar td.button-active a {\r\n color: black;\r\n text-decoration: none;\r\n}\r\n\r\ntd.kx-block-header, .head-table tr td.kx-block-header{\r\n color: @@HeadBarColor@@;\r\n background: url(''@@base_url@@/core/admin_templates/img/top_frame/toolbar_background.gif'') repeat-x top left;\r\n /*background-color: @@HeadBarBgColor@@;*/\r\n padding-left: 7px;\r\n padding-right: 7px;\r\n}\r\n\r\na.kx-header-link {\r\n text-decoration: underline;\r\n font-weight: bold;\r\n color: #0080C8;\r\n}\r\n\r\na.kx-header-link:hover {\r\n color: #FFCB05;\r\n text-decoration: none;\r\n}\r\n\r\n.kx-secondary-foreground {\r\n color: #FFFFFF;\r\n /*background-color: @@HeadBarBgColor@@;*/\r\n}\r\n\r\n.kx-login-button {\r\n background-color: #2D79D6;\r\n color: #FFFFFF;\r\n}\r\n\r\n/* General form button (yellow) */\r\n.button {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #000000;\r\n background: url(''@@base_url@@/core/admin_templates/img/button_back.gif'') #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Disabled (grayed-out) form button */\r\n.button-disabled {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #676767;\r\n background: url(''@@base_url@@/core/admin_templates/img/button_back_disabled.gif'') #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Tabs bar */\r\n\r\n.tab, .tab-active {\r\n background-color: #F0F1EB;\r\n padding: 3px 7px 2px 7px;\r\n border-top: 1px solid black;\r\n border-left: 1px solid black;\r\n border-right: 1px solid black;\r\n margin-left: 3px !important;\r\n white-space: nowrap;\r\n}\r\n\r\n.tab-active {\r\n background-color: #4487D9;\r\n}\r\n\r\n.tab a {\r\n color: #4487D9;\r\n font-weight: bold;\r\n}\r\n\r\n.tab-active a {\r\n color: #FFFFFF;\r\n font-weight: bold;\r\n}\r\n\r\na.scroll-left, a.scroll-right {\r\n cursor: pointer;\r\n display: block;\r\n float: left;\r\n height: 18px;\r\n margin: 0px 1px;\r\n width: 18px;\r\n}\r\n\r\na.scroll-left {\r\n background: transparent url(''@@base_url@@/core/admin_templates/img/tabs/left.png'') no-repeat scroll 0 0;\r\n}\r\n\r\na.scroll-right {\r\n background: transparent url(''@@base_url@@/core/admin_templates/img/tabs/right.png'') no-repeat scroll 0 0;\r\n}\r\n\r\na.disabled {\r\n visibility: hidden !important;\r\n}\r\n\r\na.scroll-left:hover, a.scroll-right:hover {\r\n background-position: 0 -18px;\r\n}\r\n\r\ntd.scroll-right-container {\r\n width: 20px;\r\n}\r\n\r\ntd.scroll-right-container.disabled, td.scroll-right-container.disabled * {\r\n width: 0px;\r\n margin: 0px;\r\n}\r\n\r\ntd.scroll-right-container.disabled br {\r\n display: none;\r\n}\r\n\r\n/* Toolbar */\r\n\r\n.toolbar {\r\n font-size: 8pt;\r\n border: 1px solid #000000;\r\n border-width: 0px 1px 1px 1px;\r\n background-color: @@ToolbarBgColor@@;\r\n border-collapse: collapse;\r\n}\r\n\r\n.toolbar td {\r\n height: 100%;\r\n}\r\n\r\n.toolbar-button, .toolbar-button-disabled, .toolbar-button-over {\r\n float: left;\r\n text-align: center;\r\n font-size: 8pt;\r\n padding: 5px 5px 5px 5px;\r\n vertical-align: middle;\r\n color: #006F99;\r\n}\r\n\r\n.toolbar-button-over {\r\n color: #000;\r\n}\r\n\r\n.toolbar-button-disabled {\r\n color: #444;\r\n}\r\n\r\n/* Scrollable Grids */\r\n\r\n\r\n.layout-only-table td {\r\n border: none !important;\r\n}\r\n\r\n/* Main Grid class */\r\n.grid-scrollable {\r\n padding: 0px;\r\n border: 1px solid black !important;\r\n border-top: none !important;\r\n}\r\n\r\n/* Div generated by js, which contains all the scrollable grid elements, affects the style of scrollable area without data (if there are too few rows) */\r\n.grid-container {\r\n background-color: #fff;\r\n}\r\n\r\n.grid-container table {\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Inner div generated in each data-cell */\r\n.grid-cell-div {\r\n overflow: hidden;\r\n height: auto;\r\n}\r\n\r\n/* Main row definition */\r\n.grid-data-row td, .grid-data-row-selected td, .grid-data-row-even-selected td, .grid-data-row-mouseover td, .table-color1, .table-color2 {\r\n font-weight: normal;\r\n color: @@OddColor@@;\r\n background-color: @@OddBgColor@@;\r\n padding: 3px 5px 3px 5px;\r\n overflow: hidden;\r\n border-right: 1px solid #c9c9c9;\r\n}\r\n.grid-data-row-even td, .table-color2 {\r\n background-color: @@EvenBgColor@@;\r\n color: @@EvenColor@@;\r\n}\r\n.grid-data-row td a, .grid-data-row-selected td a, .grid-data-row-mouseover td a {\r\n text-decoration: underline;\r\n}\r\n\r\n/* mouse-over rows */\r\n.grid-data-row-mouseover td, table tr.grid-data-row[_row_highlighted] td {\r\n background: #FFFDF4;\r\n}\r\n\r\n/* Selected row, applies to both checkbox and data areas */\r\n.grid-data-row-selected td, table tr.grid-data-row[_row_selected] td {\r\n background: #FEF2D6;\r\n}\r\n\r\n.grid-data-row-even-selected td, .grid-data-row-even[_row_selected] td {\r\n background: #FFF7E0;\r\n}\r\n\r\n/* General header cell definition */\r\n.grid-header-row td {\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n text-decoration: none;\r\n padding: 3px 5px 3px 5px;\r\n color: @@ColumnTitlesColor@@;\r\n border-right: none;\r\n text-align: left;\r\n vertical-align: middle !important;\r\n white-space: nowrap;\r\n border-right: 1px solid #777;\r\n}\r\n\r\n/* Filters row */\r\ntr.grid-header-row-1 td {\r\n background-color: @@FiltersBgColor@@;\r\n border-bottom: 1px solid black;\r\n}\r\n\r\n/* Grid Filters */\r\ntable.range-filter {\r\n width: 100%;\r\n}\r\n\r\n.range-filter td {\r\n padding: 0px 0px 2px 2px !important;\r\n border: none !important;\r\n font-size: 8pt !important;\r\n font-weight: normal !important;\r\n text-align: left;\r\n color: #000000 !important;\r\n}\r\n\r\ninput.filter, select.filter, input.filter-active, select.filter-active {\r\n margin-bottom: 0px;\r\n border: 1px solid #aaa;\r\n}\r\n\r\ninput.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\nselect.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\ndiv.filter, div.filter-active {\r\n background-color: white;\r\n border: 1px solid #AAAAAA;\r\n color: black;\r\n font-weight: normal;\r\n padding: 3px;\r\n}\r\n\r\ndiv.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\ndiv.multioptions_filter {\r\n position: absolute;\r\n z-index: 100;\r\n color: black;\r\n background-color: white;\r\n border: 1px solid black;\r\n padding: 3px 5px;\r\n display: none;\r\n vertical-align: middle;\r\n}\r\n\r\n/* Column titles row */\r\ntr.grid-header-row-0 td {\r\n height: 25px;\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n color: @@ColumnTitlesColor@@;\r\n border-bottom: 1px solid black;\r\n}\r\n\r\ntr.grid-header-row-0 td a {\r\n color: @@ColumnTitlesColor@@;\r\n}\r\n\r\ntr.grid-header-row-0 td a:hover {\r\n color: #FFCC00;\r\n}\r\n\r\n\r\n.grid-footer-row td {\r\n background-color: #D7D7D7;\r\n font-weight: bold;\r\n border-right: 1px solid #C9C9C9;\r\n padding: 3px 5px 3px 5px;\r\n}\r\n\r\ntd.grid-header-last-cell, td.grid-data-last-cell, td.grid-footer-last-cell {\r\n border-right: none !important;\r\n}\r\n\r\ntd.grid-data-col-0, td.grid-data-col-0 div {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-1 td.grid-header-col-1 {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-1 td.grid-header-col-1 div {\r\n display: table-cell;\r\n vertical-align: middle;\r\n}\r\n\r\n.grid-status-bar {\r\n border: 1px solid black;\r\n border-top: none;\r\n padding: 0px;\r\n width: 100%;\r\n border-collapse: collapse;\r\n height: 30px;\r\n}\r\n\r\n.grid-status-bar td {\r\n background-color: @@TitleBarBgColor@@;\r\n color: @@TitleBarColor@@;\r\n font-size: 11pt;\r\n font-weight: normal;\r\n padding: 2px 8px 2px 8px;\r\n}\r\n\r\n/* /Scrollable Grids */\r\n\r\n\r\n/* Forms */\r\ntable.edit-form {\r\n border: none;\r\n border-top-width: 0px !important;\r\n border-collapse: collapse;\r\n width: 100%;\r\n}\r\n\r\n.edit-form-odd, .edit-form-even {\r\n padding: 0px;\r\n}\r\n\r\n.subsectiontitle {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #4A92CE;\r\n color: #fff;\r\n height: 25px;\r\n border-top: 1px solid black;\r\n vertical-align: middle;\r\n}\r\n\r\n/* remove top-border from first sub-section element */\r\ntable.edit-form .subsectiontitle:first-child, table.bordered .subsectiontitle:first-child {\r\n border-top-width: 0;\r\n}\r\n\r\n.subsectiontitle td {\r\n vertical-align: middle;\r\n /*padding: 3px 5px 3px 5px;*/\r\n padding: 1px 5px;\r\n}\r\n\r\n.label-cell {\r\n background: #DEE7F6 url(''@@base_url@@/core/admin_templates/img/bgr_input_name_line.gif'') no-repeat right bottom;\r\n font: 12px arial, sans-serif;\r\n padding: 4px 20px;\r\n width: 160px;\r\n}\r\n\r\n.control-mid {\r\n width: 13px;\r\n border-left: 1px solid #7A95C2;\r\n background: #fff url(''@@base_url@@/core/admin_templates/img/bgr_mid.gif'') repeat-x left bottom;\r\n}\r\n\r\n.control-cell {\r\n font: 11px arial, sans-serif;\r\n padding: 4px 10px 5px 5px;\r\n background: #fff url(''@@base_url@@/core/admin_templates/img/bgr_input_line.gif'') no-repeat left bottom;\r\n width: auto;\r\n vertical-align: middle;\r\n}\r\n\r\n.label-cell-filler {\r\n background: #DEE7F6 none;\r\n}\r\n.control-mid-filler {\r\n background: #fff none;\r\n border-left: 1px solid #7A95C2;\r\n}\r\n.control-cell-filler {\r\n background: #fff none;\r\n}\r\n\r\n.error {\r\n color: red;\r\n}\r\n.error-cell {\r\n color: red;\r\n}\r\n\r\n.field-required {\r\n color: red;\r\n}\r\n\r\n.warning-table {\r\n background-color: #F0F1EB;\r\n border: 1px solid #000000;\r\n border-collapse: collapse;\r\n border-top-width: 0px;\r\n}\r\n\r\n.form-notice, .form-warning {\r\n font-size: 11px;\r\n}\r\n\r\n.form-warning {\r\n color: red;\r\n}\r\n\r\n.form-notice {\r\n color: green;\r\n}\r\n\r\n.priority {\r\n color: red;\r\n padding-left: 1px;\r\n padding-right: 1px;\r\n font-size: 11px;\r\n}\r\n\r\n.small-statistics {\r\n font-size: 11px;\r\n color: #707070;\r\n}\r\n\r\n.req-note {\r\n font-style: italic;\r\n color: #333;\r\n}\r\n\r\n#scroll_container table.tableborder {\r\n border-collapse: separate\r\n}\r\n\r\n/* Uploader */\r\n.uploader-queue div.file {\r\n font-size: 11px;\r\n border: 1px solid #7F99C5;\r\n padding: 3px;\r\n background-color: #DEE7F6;\r\n margin-bottom: 2px;\r\n}\r\n\r\n.uploader-queue .left {\r\n float: left;\r\n vertical-align: top;\r\n}\r\n\r\n.uploader-queue .file-label {\r\n margin-left: 5px;\r\n}\r\n\r\n.uploader-queue .preview .delete-checkbox {\r\n margin-top: -3px;\r\n}\r\n\r\n.uploader-queue .progress-container {\r\n margin: 2px 5px 0px 5px;\r\n}\r\n\r\n.uploader-queue .progress-empty {\r\n width: 150px;\r\n height: 9px;\r\n border: 1px solid black;\r\n background: url(''@@base_url@@/core/admin_templates/img/progress_left.gif'') repeat-x;\r\n}\r\n\r\n.uploader-queue .progress-full {\r\n height: 9px;\r\n background: url(''@@base_url@@/core/admin_templates/img/progress_done.gif'');\r\n}\r\n\r\n.uploader-queue .thumbnail {\r\n /*margin-bottom: 2px;*/\r\n border: 1px solid black;\r\n background-color: grey;\r\n}\r\n\r\n/* To be sorted */\r\nspan#category_path, span#category_path a {\r\n color: #FFFFFF;\r\n}\r\n\r\nspan#category_path a {\r\n text-decoration: underline;\r\n}\r\n\r\n/* Section title, right to the big icon */\r\n.admintitle {\r\n font-size: 16pt;\r\n font-weight: bold;\r\n color: @@SectionColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Left side of bluebar */\r\n.header_left_bg {\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n padding-left: 5px;\r\n}\r\n\r\n/* Right side of bluebar */\r\n.tablenav, tablenav a {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n\r\n text-decoration: none;\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n}\r\n\r\n/* Section title in the bluebar * -- why ''link''? :S */\r\n.tablenav_link {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Active page in top and bottom bluebars pagination */\r\n.current_page {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #fff;\r\n color: #2D79D6;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Other pages and arrows in pagination on blue */\r\n.nav_url {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n color: #fff;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Tree */\r\n.tree-body {\r\n background-color: @@TreeBgColor@@;\r\n height: 100%\r\n}\r\n\r\n.tree_head.td, .tree_head, .tree_head:hover {\r\n font-weight: bold;\r\n font-size: 10px;\r\n color: #FFFFFF;\r\n font-family: Verdana, Arial;\r\n text-decoration: none;\r\n}\r\n\r\n.tree {\r\n padding: 0px;\r\n border: none;\r\n border-collapse: collapse;\r\n}\r\n\r\n.tree tr td {\r\n padding: 0px;\r\n margin: 0px;\r\n font-family: helvetica, arial, verdana,;\r\n font-size: 11px;\r\n white-space: nowrap;\r\n}\r\n\r\n.tree tr td a {\r\n font-size: 11px;\r\n color: @@TreeColor@@;\r\n font-family: Helvetica, Arial, Verdana;\r\n text-decoration: none;\r\n padding: 2px;\r\n}\r\n\r\n.tree tr td a:hover, .tree tr td a.debug-only-item:hover {\r\n color: @@TreeHoverColor@@;\r\n}\r\n\r\n.tree tr.highlighted td a, .tree tr.highlighted td a.debug-only-item {\r\n color: @@TreeHighColor@@;\r\n background-color: @@TreeHighBgColor@@;\r\n}\r\n\r\n.tree tr.highlighted td a:hover {\r\n color: @@TreeHighHoverColor@@;\r\n}\r\n\r\n.tree tr td a.debug-only-item {\r\n color: grey;\r\n}\r\n\r\n/* Ajax Dropdown */\r\n.suggest-box {\r\n border: 1px solid #999;\r\n background-color: #fff;\r\n}\r\n\r\n.suggest-item, .suggest-item-over {\r\n padding: 1px 2px 0px 2px;\r\n font-family: arial,verdana;\r\n font-size: 12px;\r\n}\r\n\r\n.suggest-item-over {\r\n background-color: #3366CC;\r\n color: #fff;\r\n}\r\n\r\n/* Dashboard Summary Boxes */\r\n.summary-box {\r\n border: 1px solid black;\r\n margin-bottom: 4px;\r\n}\r\n\r\n.summary-box .title {\r\n color: white;\r\n font-weight: bold;\r\n padding: 6px 5px;\r\n vertical-align: middle;\r\n background-color: #4A92CE;\r\n border-bottom: 1px solid black;\r\n}\r\n\r\n.summary-box .content {\r\n padding: 4px;\r\n background-color: #F6F6F6;\r\n}\r\n\r\n.summary-box .group {\r\n border-bottom: 1px solid black;\r\n margin-bottom: 10px;\r\n padding: 0 0 10px 10px;\r\n}\r\n\r\n.summary-box .group.last {\r\n border-width: 0px;\r\n margin-bottom: 0;\r\n padding-bottom: 5px;\r\n}\r\n\r\n.summary-box h4 {\r\n margin: 0;\r\n padding: 0 0 3px 0;\r\n font-size: 11px;\r\n font-weight: bold;\r\n}\r\n\r\n.summary-box .hint {\r\n font-size: 10px;\r\n color: grey;\r\n margin-bottom: 3px;\r\n}\r\n\r\n.summary-box .hint .cache-key {\r\n margin-bottom: 7px;\r\n margin-left: 3px;\r\n}\r\n\r\n.summary-box ul {\r\n margin-top: 5px;\r\n margin-bottom: 3px;\r\n padding-left: 30px;\r\n}\r\n\r\n.summary-box li {\r\n padding-bottom: 4px;\r\n}', 'in-portal_logo_img.jpg', 'in-portal_logo_img2.jpg', 'in-portal_logo_login.gif', 'a:22:{s:11:"HeadBgColor";a:2:{s:11:"Description";s:27:"Head frame background color";s:5:"Value";s:7:"#007BF4";}s:9:"HeadColor";a:2:{s:11:"Description";s:21:"Head frame text color";s:5:"Value";s:7:"#FFFFFF";}s:14:"SectionBgColor";a:2:{s:11:"Description";s:28:"Section bar background color";s:5:"Value";s:7:"#FFFFFF";}s:12:"SectionColor";a:2:{s:11:"Description";s:22:"Section bar text color";s:5:"Value";s:7:"#2D79D6";}s:12:"HeadBarColor";a:1:{s:5:"Value";s:7:"#000000";}s:14:"HeadBarBgColor";a:1:{s:5:"Value";s:7:"#1961B8";}s:13:"TitleBarColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TitleBarBgColor";a:1:{s:5:"Value";s:7:"#2D79D6";}s:14:"ToolbarBgColor";a:1:{s:5:"Value";s:7:"#F0F1EB";}s:14:"FiltersBgColor";a:1:{s:5:"Value";s:7:"#D7D7D7";}s:17:"ColumnTitlesColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:19:"ColumnTitlesBgColor";a:1:{s:5:"Value";s:7:"#999999";}s:8:"OddColor";a:1:{s:5:"Value";s:7:"#000000";}s:10:"OddBgColor";a:1:{s:5:"Value";s:7:"#F6F6F6";}s:9:"EvenColor";a:1:{s:5:"Value";s:7:"#000000";}s:11:"EvenBgColor";a:1:{s:5:"Value";s:7:"#EBEBEB";}s:9:"TreeColor";a:1:{s:5:"Value";s:7:"#000000";}s:14:"TreeHoverColor";a:1:{s:5:"Value";s:7:"#009FF0";}s:13:"TreeHighColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:18:"TreeHighHoverColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TreeHighBgColor";a:1:{s:5:"Value";s:7:"#4A92CE";}s:11:"TreeBgColor";a:1:{s:5:"Value";s:7:"#DCECF6";}}', 1319019189, 1, 1);
INSERT INTO LocalesList VALUES
@@ -995,4 +1000,6 @@
#INSERT INTO PageContent VALUES (DEFAULT, 1, 1, '<span style="font-weight: bold;">In-portal</span> is a revolutionary Web Site management system that allows you to automate and facilitate management of large portal and community web sites. Regardless of whether you are running a directory site or a content news portal, a community site or an online mall, In-portal will enhance your web site management experience with innovative.</span><br><br>We are proud to present our newly developed <b>"default"</b> theme that introduces a fresh look as well totally new approach in the template system.</span><br>', NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0);
INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL, NULL);
-INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
+
+INSERT INTO PromoBlockGroups (DEFAULT, 'Promo Block Group', UNIX_TIMESTAMP(), 1, '', '7.00', '0.60', 1, '', '');
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 14902)
+++ core/install/install_schema.sql (working copy)
@@ -478,6 +478,7 @@
LiveRevisionNumber int(11) NOT NULL DEFAULT '1',
DirectLinkEnabled tinyint(4) NOT NULL DEFAULT '1',
DirectLinkAuthKey varchar(20) NOT NULL,
+ PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (CategoryId),
UNIQUE KEY ResourceId (ResourceId),
KEY ParentId (ParentId),
@@ -506,7 +507,8 @@
KEY OverridePageCacheKey (OverridePageCacheKey),
KEY PageExpiration (PageExpiration),
KEY Protected (Protected),
- KEY LiveRevisionNumber (LiveRevisionNumber)
+ KEY LiveRevisionNumber (LiveRevisionNumber),
+ KEY PromoBlockGroupId (PromoBlockGroupId)
);
CREATE TABLE CategoryCustomData (
@@ -1304,6 +1306,21 @@
l3_Html text,
l4_Html text,
l5_Html text,
+ PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (BlockId),
- KEY OpenInNewWindow (OpenInNewWindow)
+ KEY OpenInNewWindow (OpenInNewWindow),
+ KEY PromoBlockGroupId (PromoBlockGroupId)
+);
+
+CREATE TABLE PromoBlockGroups (
+ PromoBlockGroupId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ CreatedOn int(10) unsigned DEFAULT NULL,
+ Status tinyint(1) NOT NULL DEFAULT '1',
+ RotationDelay decimal(9,2) NOT NULL DEFAULT 7.00,
+ TransitionTime decimal(9,2) NOT NULL DEFAULT 0.60,
+ TransitionControls tinyint(1) NOT NULL DEFAULT '0',
+ TransitionEffect varchar(255) NOT NULL DEFAULT '',
+ TransitionEffectCustom varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (PromoBlockGroupId)
);
\ No newline at end of file
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14902)
+++ core/install/upgrades.sql (working copy)
@@ -2333,11 +2333,6 @@
KEY OpenInNewWindow (OpenInNewWindow)
);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.6', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'fade', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'fade=la_opt_AnimationFade||slide=la_opt_AnimationSlide', 10.04, 0, 0, NULL);
-
UPDATE Phrase
SET l<%PRIMARY_LANGUAGE%>_ColumnTranslation = l<%PRIMARY_LANGUAGE%>_Translation
WHERE PhraseKey IN ('LA_FLD_CATEGORY', 'LA_FLD_ORDER');
@@ -2425,3 +2420,41 @@
KEY ItemPrefix (ItemPrefix),
KEY Enabled (Enabled)
);
+
+CREATE TABLE PromoBlockGroups (
+ PromoBlockGroupId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ CreatedOn int(10) unsigned DEFAULT NULL,
+ Status tinyint(1) NOT NULL DEFAULT '1',
+ RotationDelay decimal(9,2) NOT NULL DEFAULT 7.00,
+ TransitionTime decimal(9,2) NOT NULL DEFAULT 0.60,
+ TransitionControls tinyint(1) NOT NULL DEFAULT '0',
+ TransitionEffect varchar(255) NOT NULL DEFAULT '',
+ TransitionEffectCustom varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (PromoBlockGroupId)
+);
+
+ALTER TABLE Category ADD PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
+ADD INDEX ( `PromoBlockGroupId` );
+
+ALTER TABLE PromoBlocks ADD PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
+ADD INDEX ( `PromoBlockGroupId` );
+
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DebugOnlyPromoBlockGroupConfigurator', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DebugOnlyPromoBlockGroupConfigurator', 'checkbox', '', '', 40.13, 0, 0, NULL);
+UPDATE ConfigurationValues SET DisplayOrder = '40.14' WHERE VariableName = 'RememberLastAdminTemplate';
+UPDATE ConfigurationValues SET DisplayOrder = '40.15' WHERE VariableName = 'UseHTTPAuth';
+UPDATE ConfigurationValues SET DisplayOrder = '40.16' WHERE VariableName = 'HTTPAuthUsername';
+UPDATE ConfigurationValues SET DisplayOrder = '40.17' WHERE VariableName = 'HTTPAuthPassword';
+UPDATE ConfigurationValues SET DisplayOrder = '40.18' WHERE VariableName = 'HTTPAuthBypassIPs';
+
+INSERT INTO PromoBlockGroups (DEFAULT, 'Promo Block Group', UNIX_TIMESTAMP(), 1, '', '7.00', '0.60', 1, '', '');
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_blocks.delete', 11, 1, 1, 0);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.delete', 11, 1, 1, 0);
\ No newline at end of file
Index: core/units/categories/categories_config.php
===================================================================
--- core/units/categories/categories_config.php (revision 14902)
+++ core/units/categories/categories_config.php (working copy)
@@ -407,7 +407,16 @@
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 1
),
- 'DirectLinkAuthKey' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'default' => '')
+ 'DirectLinkAuthKey' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'default' => ''),
+ 'PromoBlockGroupId' => Array (
+ 'type' => 'int',
+ 'not_null' => 1, 'default' => 0,
+ 'options_sql' => 'SELECT Title, PromoBlockGroupId
+ FROM ' . TABLE_PREFIX . 'PromoBlockGroups
+ ORDER BY Title',
+ 'option_title_field' => 'Title', 'option_key_field' => 'PromoBlockGroupId',
+ ),
+
),
'VirtualFields' => Array (
Index: core/units/promo_block_groups/promo_block_group_eh.php
===================================================================
--- core/units/promo_block_groups/promo_block_group_eh.php (revision 0)
+++ core/units/promo_block_groups/promo_block_group_eh.php (revision 0)
@@ -0,0 +1,142 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class PromoBlockGroupEventHandler extends kDBEventHandler {
+
+ /**
+ * Occurs before creating item
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+ $this->beforeItemChange($event);
+ }
+
+ /**
+ * Occurs before updating item
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+ $this->beforeItemChange($event);
+ }
+
+ /**
+ * Occurs before updating item
+ *
+ * @param kEvent $event
+ * @return void
+ * @access private
+ */
+ private function beforeItemChange(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('TransitionEffect') == '-1') {
+ $object->setRequired('TransitionEffectCustom');
+ }
+ }
+
+ /**
+ * Occures before deleting item
+ *
+ * @param kEvent $event
+ * @access public
+ */
+ public function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'SELECT BlockId FROM '.TABLE_PREFIX.'PromoBlocks
+ WHERE
+ PromoBlockGroupId = '.$object->GetID().'
+ ';
+ $block_id = $this->Conn->GetOne($sql);
+
+ if ( $block_id ) {
+ $this->Application->StoreVar('promo_group_has_block', $block_id);
+ $event->status = kEvent::erFAIL;
+ }
+ }
+
+ /**
+ * After item deleted
+ *
+ * @param kEvent $event
+ * @access public
+ */
+ public function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+ $group_id = $event->getEventParam('id');
+ $sql = 'UPDATE '.TABLE_PREFIX.'Category
+ SET
+ PromoBlockGroupId = 0
+ WHERE
+ PromoBlockGroupId = '.$group_id.'
+ ';
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Set tree update flag
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnSave(&$event)
+ {
+ parent::OnSave($event);
+
+ if ( $event->status != kEvent::erSUCCESS ) {
+ return;
+ }
+
+ $this->Application->StoreVar('RefreshPromoBlocksTree', 1);
+ }
+
+
+ /**
+ * Set tree update flag
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnMassDelete(&$event)
+ {
+ parent::OnMassDelete($event);
+
+ if ( $event->status != kEvent::erSUCCESS ) {
+ return;
+ }
+
+ $this->Application->StoreVar('RefreshPromoBlocksTree', 1);
+ }
+}
Index: core/units/promo_block_groups/promo_block_group_tp.php
===================================================================
--- core/units/promo_block_groups/promo_block_group_tp.php (revision 0)
+++ core/units/promo_block_groups/promo_block_group_tp.php (revision 0)
@@ -0,0 +1,44 @@
+<?php
+/**
+* @version $Id: promo_block_tp.php 14853 2011-12-08 14:45:37Z alex $
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class PromoBlockGroupTagProcessor extends kDBtagProcessor {
+
+ /**
+ * Print list of categories
+ *
+ * @param Array $params
+ * @return string
+ * @access protected
+ */
+ protected function PrintCategories($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $field = $this->SelectParam($params, 'field');
+ $block_params['name'] = $this->SelectParam($params, 'render_as,block');
+ $categories = explode(';', $object->GetDBField($field));
+
+ $o = '';
+ foreach ($categories AS $category_id) {
+ if ($category_id) {
+ $block_params['cat_id'] = $category_id;
+ $o .= $this->Application->ParseBlock($block_params);
+ }
+ }
+ return $o;
+ }
+}
Index: core/units/promo_block_groups/promo_block_groups_config.php
===================================================================
--- core/units/promo_block_groups/promo_block_groups_config.php (revision 0)
+++ core/units/promo_block_groups/promo_block_groups_config.php (revision 0)
@@ -0,0 +1,121 @@
+<?php
+
+$config = Array (
+ 'Prefix' => 'promo-block-group',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'PromoBlockGroupEventHandler', 'file' => 'promo_block_group_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'PromoBlockGroupTagProcessor', 'file' => 'promo_block_group_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'PerPage',
+ 4 => 'event',
+ 5 => 'mode',
+ ),
+
+ 'IDField' => 'PromoBlockGroupId',
+
+ 'TableName' => TABLE_PREFIX . 'PromoBlockGroups',
+
+ 'TitleField' => 'Title',
+
+ 'StatusField' => Array('Status'),
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('promo-block-group' => '!la_title_AddingPromoBlockGroup!'),
+ 'edit_status_labels' => Array ('promo-block-group' => '!la_title_EditingPromoBlockGroup!'),
+ ),
+
+ 'promo_block_group_list' => Array ('prefixes' => Array ('promo-block-group_List'), 'format' => "!la_tab_PromoBlockGroups! (#promo-block-group_recordcount#)"),
+ 'promo_block_group_edit' => Array ('prefixes' => Array ('promo-block-group'), 'format' => "#promo-block-group_status# '#promo-block-group_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:promo_block_groups'),
+
+ 'Sections' => Array (
+ 'in-portal:promo_block_groups' => Array(
+ 'parent' => 'in-portal:site',
+ 'icon' => 'form',
+ 'use_parent_header' => 1,
+ 'label' => 'la_tab_PromoBlocks',
+ 'url' => Array('t' => 'promo_block_groups/promo_block_group_list', 'pass' => 'm'),
+ 'late_load' => Array ('t' => 'promo_block_groups/tree_section_xml', 'pass' => 'm', 'm_cat_id' => 0, 'section_name' => 'in-portal:promo_block_groups'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'AssignedToSections' => '(SELECT GROUP_CONCAT(CategoryId SEPARATOR ";") FROM '.TABLE_PREFIX.'Category WHERE PromoBlockGroupId = %1$s.PromoBlockGroupId)',
+ ),
+ ),
+
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('Title' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'PromoBlockGroupId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'not_null' => 1, 'required' => 1, 'default' => '',
+ ),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ 'Status' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 1,
+ ),
+ 'RotationDelay' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '7.00'),
+ 'TransitionTime' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.60'),
+ 'TransitionControls' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 1,
+ ),
+ 'TransitionEffect' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array ('fade' => 'la_opt_AnimationFade', 'slide' => 'la_opt_AnimationSlide', '-1' => 'la_opt_AnimationCustom'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => '',
+ ),
+ 'TransitionEffectCustom' => Array (
+ 'type' => 'string',
+ 'error_field' => 'TransitionEffect',
+ 'formatter' => 'kFormatter',
+ 'not_null' => 1, 'default' => '',
+ ),
+ ),
+
+ 'VirtualFields' => Array(
+ 'AssignedToSections' => Array('type' => 'string'),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Fields' => Array (
+ 'PromoBlockGroupId' => Array ('title' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'Title' => Array ('filter_block' => 'grid_like_filter'),
+ 'Status' => Array ('filter_block' => 'grid_options_filter'),
+ 'RotationDelay' => Array ('filter_block' => 'grid_range_filter'),
+ 'TransitionTime' => Array ('filter_block' => 'grid_range_filter'),
+ 'TransitionControls' => Array ('filter_block' => 'grid_options_filter'),
+ 'TransitionEffect' => Array ('filter_block' => 'grid_options_filter'),
+ 'TransitionEffectCustom' => Array ('filter_block' => 'grid_like_filter'),
+ ),
+ ),
+ ),
+);
Index: core/units/promo_blocks/promo_block_eh.php
===================================================================
--- core/units/promo_blocks/promo_block_eh.php (revision 14902)
+++ core/units/promo_blocks/promo_block_eh.php (working copy)
@@ -74,18 +74,24 @@
{
parent::SetCustomQuery($event);
- if ( $this->Application->isAdminUser ) {
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ if ( $this->Application->isAdmin ) {
+ $object->addFilter('promo_group', '%1$s.PromoBlockGroupId= ' . $this->Application->GetVar('group_id'));
return;
}
- $object =& $event->getObject();
- /* @var $object kDBList */
+ $group_id = $event->getEventParam('group_id');
+ if (!$group_id) {
+ $group_id = $this->Application->GetVar('m_cat_id');
+;
+ }
- if ( $event->Special == 'home' ) {
- $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
- $object->addFilter('scheduled_from_filter', '%1$s.ScheduleFromDate IS NULL OR %1$s.ScheduleFromDate <= ' . TIMENOW);
- $object->addFilter('scheduled_to_filter', '%1$s.ScheduleToDate IS NULL OR %1$s.ScheduleToDate >= ' . TIMENOW);
- }
+ $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ $object->addFilter('scheduled_from_filter', '%1$s.ScheduleFromDate IS NULL OR %1$s.ScheduleFromDate <= ' . TIMENOW);
+ $object->addFilter('scheduled_to_filter', '%1$s.ScheduleToDate IS NULL OR %1$s.ScheduleToDate >= ' . TIMENOW);
+ $object->addFilter('promo_group', '%1$s.PromoBlockGroupId= ' . $group_id);
}
/**
@@ -288,6 +294,9 @@
$fields['CategoryId']['options'] = $category_helper->getStructureTreeAsOptions();
+ $this->Application->LinkVar('group_id');
+ $fields['PromoBlockGroupId']['default'] = $this->Application->GetVar('group_id');
+
// images multilang fields
$a_image = Array(
'type' => 'string', 'max_len' => 255,
Index: core/units/promo_blocks/promo_block_tp.php
===================================================================
--- core/units/promo_blocks/promo_block_tp.php (revision 14902)
+++ core/units/promo_blocks/promo_block_tp.php (working copy)
@@ -55,4 +55,33 @@
return $object->GetDBField('OpenInNewWindow');
}
+
+ /**
+ * Get value from corresponding PromoGroupBlocks record
+ *
+ * @param Array $params
+ * @return bool
+ * @access protected
+ */
+ protected function GetGroupSetting($params)
+ {
+ static $group_data;
+
+ $category_id = $this->Application->GetVar('m_cat_id');
+
+ if (isset($params['group_id'])) {
+ $category_id = $params['group_id'];
+ }
+
+ if (!isset($group_data[$category_id])) {
+
+ $category = $this->Application->recallObject('st');
+ /* @var $category CategoriesItem */
+
+ $sql = 'SELECT * FROM '.TABLE_PREFIX.'PromoBlockGroups WHERE PromoBlockGroupId = '.$category->GetDBField('PromoBlockGroupId');
+ $group_data[$category_id] = $this->Conn->GetRow($sql);
+ }
+
+ return $group_data[$category_id][$params['name']];
+ }
}
Index: core/units/promo_blocks/promo_blocks_config.php
===================================================================
--- core/units/promo_blocks/promo_blocks_config.php (revision 14902)
+++ core/units/promo_blocks/promo_blocks_config.php (working copy)
@@ -37,26 +37,18 @@
'Sections' => Array (
'in-portal:promo_blocks' => Array(
- 'parent' => 'in-portal:site',
- 'icon' => 'custom',
- 'label' => 'la_tab_PromoBlocks',
- 'url' => Array('t' => 'promo_blocks/promo_block_list', 'pass' => 'm'),
- 'permissions' => Array('view', 'add', 'edit', 'delete'),
- 'priority' => 7,
- 'type' => stTREE,
+ 'parent' => 'in-portal:promo_block_groups',
+ 'icon' => 'form',
+ 'use_parent_header' => 1,
+ 'label' => 'la_tab_PromoBlocks',
+ 'url' => Array('t' => 'promo_blocks/promo_block_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => smHIDE,
),
-
- 'in-portal:configure_promo_blocks' => Array (
- 'parent' => 'in-portal:website_setting_folder',
- 'icon' => 'custom',
- 'label' => 'la_title_PromoBlocks',
- 'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
- 'permissions' => Array ('view', 'edit'),
- 'priority' => 3,
- 'type' => stTREE,
- ),
),
+
'CalculatedFields' => Array (
'' => Array (
'ConversionPercent' => 'IF(%1$s.NumberOfViews > 0, NumberOfClicks / NumberOfViews * 100, NULL)',
@@ -75,6 +67,14 @@
'Fields' => Array (
'BlockId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PromoBlockGroupId' => Array (
+ 'type' => 'int', 'required' => 1,
+ 'not_null' => 1, 'default' => 0,
+ 'options_sql' => 'SELECT Title, PromoBlockGroupId
+ FROM ' . TABLE_PREFIX . 'PromoBlockGroups
+ ORDER BY Title',
+ 'option_title_field' => 'Title', 'option_key_field' => 'PromoBlockGroupId',
+ ),
'Title' => Array (
'type' => 'string', 'max_len' => 50,
'not_null' => 1, 'required' => 1, 'default' => '',
promo_blocks_themes_v3_1128.patch [^] (3,914 bytes) 2011-12-27 09:54
[Show Content]
Index: designs/general.tpl
===================================================================
--- designs/general.tpl (revision 14902)
+++ designs/general.tpl (working copy)
@@ -22,6 +22,64 @@
<div class="round-top"></div>
<div class="content">
<h1 class="movable-header"><inp2:st_PageInfo type="title"/></h1>
+
+
+ <inp2:m_if check="st_Field" name="PromoBlockGroupId">
+ <div class="new-row top-margined" id="promo">
+ <inp2:m_DefineElement name="promo_first_image">
+ <div class="left-column">
+ <a id="promo_link" rel="nofollow" href="<inp2:PromoLink/>" promo_id="<inp2:Field name='BlockId'/>" target="<inp2:m_if check='LinkInNewWindow'>_blank<inp2:m_else/>_self</inp2:m_if>"><img class="bottom" src="<inp2:Field name="l1_Image" format="full_url"/>" <inp2:Field name="l1_Image" format="img_size"/> alt="<inp2:Field name="Title" html_escape="1"/>"/></a>
+ </div>
+ <div class="promo-back-container <inp2:Field name="CSSClassName" db="1"/>" style="<inp2:m_ifnot check="promo-block_GetGroupSetting" name="TransitionControls" value="1">display:none;</inp2:m_ifnot>"></div>
+ <div id="promo_right_box" class="promo-choice <inp2:Field name="CSSClassName" db="1"/>" style="<inp2:m_ifnot check="promo-block_GetGroupSetting" name="TransitionControls" value="1">display:none;</inp2:m_ifnot>">
+ <script type="text/javascript">var current_promo = <inp2:m_Param name="num"/>;</script>
+ </inp2:m_DefineElement>
+ <inp2:promo-block_PrintList render_as="promo_first_image" limit="1"/>
+ <div class="corner-wrap t r"><div class="corner transp-corner"></div></div>
+ <div style="height: 100%; overflow: hidden;<inp2:m_ifnot check="promo-block_GetGroupSetting" name="TransitionControls" value="1">display:none;</inp2:m_ifnot>">
+ <div id="promo_selector" class="promo-selector">
+ <div class="promo-left-ear"></div>
+ <div class="promo-middle" style="width: 240px"></div>
+ <div class="promo-right-ear"></div>
+ </div>
+ <div style="padding-left: 40px; padding-top: 50px;">
+ <inp2:m_DefineElement name="promo_item">
+ <div id="promo_title<inp2:m_Param name="num"/>" class="promo-item"><inp2:Field name="Title" html_escape="1"/></div>
+ </inp2:m_DefineElement>
+ <inp2:promo-block_PrintList render_as="promo_item"/>
+ </div>
+ </div>
+ <div class="corner-wrap b r"><div class="corner transp-corner"></div></div>
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ //<![CDATA[
+ <inp2:m_DefineElement name="promo_json">
+ <inp2:m_Param name="num"/>: {
+ id: '<inp2:Field name="BlockId" js_escape="1"/>',
+ image: '<inp2:Field name="l1_Image" format="full_url" js_escape="1"/>',
+ name: '<inp2:Field name="Title" js_escape="1" html_escape="1"/>',
+ rightClass: '<inp2:Field name="CSSClassName" db="1" js_escape="1"/>',
+ promoLink: '<inp2:PromoLink js_escape="1"/>',
+ openInNewWindow: <inp2:m_if check="LinkInNewWindow">true<inp2:m_else/>false</inp2:m_if>,
+ viewed: false
+ }<inp2:m_if check="m_Param" name="is_last" inverse="1">,</inp2:m_if>
+ </inp2:m_DefineElement>
+ var promo_blocks = {<inp2:promo-block_PrintList render_as="promo_json"/>};
+ var promo_speed = <inp2:promo-block_GetGroupSetting name="RotationDelay"/> * 1000;
+ var promo_transition_effect = <inp2:promo-block_GetGroupSetting name="TransitionTime"/> * 1000;
+ var promo_transition_controls = '<inp2:promo-block_GetGroupSetting name="TransitionControls"/>';
+ var $promo_stats_url = '<inp2:m_Link promo-block_id="#ID#" promo-block_event="#EVENT#" __NO_REWRITE__="1" pass="m,promo-block" no_amp="1" js_escape="1"/>';
+ //]]>
+ </script>
+ </inp2:m_if>
+
+
+
+
+
+
<inp2:st_ContentBlock num="1"/>
</div>
<div class="round-bottom"></div>
promo_block_groups_core_v4.patch [^] (60,592 bytes) 2011-12-28 07:59
[Show Content]
Index: admin/system_presets/simple/categories_c.php
===================================================================
--- admin/system_presets/simple/categories_c.php (revision 14917)
+++ admin/system_presets/simple/categories_c.php (working copy)
@@ -42,7 +42,7 @@
'CachedNavbar',*/ 'CreatedById', /*'ResourceId', 'ParentPath', 'TreeLeft', 'TreeRight', 'NamedParentPath',
'MetaDescription', 'HotItem',*/ 'NewItem', /*'PopItem', 'Modified', 'ModifiedById', 'CachedTemplate',*/
'Template', /*'UseExternalUrl', 'ExternalUrl',*/ 'UseMenuIconUrl', 'MenuIconUrl', 'Title', 'MenuTitle',
- /*'MetaTitle', 'IndexTools', 'IsMenu',*/'Protected', 'Type', 'FormId', 'FormSubmittedTemplate',
+ /*'MetaTitle', 'IndexTools', 'IsMenu',*/'PromoBlockGroupId', 'Protected', 'Type', 'FormId', 'FormSubmittedTemplate',
/*'FriendlyURL', 'ThemeId', 'EnablePageCache', 'OverridePageCacheKey', 'PageCacheKey', 'PageExpiration'*/
);
Index: admin/system_presets/simple/promo_block_groups_promo-block-group.php
===================================================================
--- admin/system_presets/simple/promo_block_groups_promo-block-group.php (revision 0)
+++ admin/system_presets/simple/promo_block_groups_promo-block-group.php (revision 0)
@@ -0,0 +1,53 @@
+<?php
+
+ defined('FULL_PATH') or die('restricted access!');
+
+ // section removal
+ $remove_sections = Array (
+// 'in-portal:promo_block_groups',
+ );
+
+ // sections shown with debug on
+ $debug_only_sections = Array (
+ 'in-portal:promo_block_groups',
+ );
+
+ // toolbar buttons
+ $remove_buttons = Array (
+// list of promo block groups
+// 'promo_block_groups_list' => Array ('new_item', 'edit', 'delete', 'view', 'dbl-click'),
+
+// editing promo block group
+// 'promo_block_groups_edit' => Array ('select', 'cancel', 'prev', 'next'),
+ );
+
+ // fields to hide
+ $hidden_fields = Array (
+ /* 'PromoBlockGroupId', 'Title', 'CreatedOn', 'Status', 'RotationDelay', 'TransitionTime', 'TransitionControls', 'TransitionEffect', 'TransitionEffectCustom', */
+ );
+
+ // virtual fields to hide
+ $virtual_hidden_fields = Array (
+
+ );
+
+ // fields to make required
+ $required_fields = Array (
+ /* 'PromoBlockGroupId', */ 'Title', /* 'CreatedOn', 'Status', 'RotationDelay', 'TransitionTime', 'TransitionControls', 'TransitionEffect', 'TransitionEffectCustom', */
+ );
+
+ // virtual fields to make required
+ $virtual_required_fields = Array (
+
+ );
+
+ // tabs during editing
+ $hide_edit_tabs = Array (
+// tabs during form editing
+ );
+
+ // hide columns in grids
+ $hide_columns = Array (
+// list of promo block groups
+// 'Default' => Array ('PromoBlockGroupId', 'Title'),
+ );
Index: admin/system_presets/simple/sections_core-sections.php
===================================================================
--- admin/system_presets/simple/sections_core-sections.php (revision 14917)
+++ admin/system_presets/simple/sections_core-sections.php (working copy)
@@ -17,6 +17,4 @@
$debug_only_sections = Array (
'in-portal:configure_advanced',
'in-portal:tools',
- 'in-portal:promo_blocks',
- 'in-portal:configure_promo_blocks',
);
Index: core/admin_templates/categories/categories_edit.tpl
===================================================================
--- core/admin_templates/categories/categories_edit.tpl (revision 14924)
+++ core/admin_templates/categories/categories_edit.tpl (working copy)
@@ -139,6 +139,7 @@
<inp2:m_RenderElement name="inp_edit_options" prefix="c" field="FormId" title="la_fld_Form"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="c" field="FormSubmittedTemplate" title="la_fld_FormSubmittedTemplate" size="60"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="c" field="IsMenu" title="la_fld_MenuStatus"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="c" field="PromoBlockGroupId" title="la_fld_PromoBlockGroup" has_empty="1"/>
<inp2:m_if check="m_IsDebugMode">
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="c" field="Protected" title="la_fld_Protected"/>
Index: core/admin_templates/promo_block_groups/promo_block_group_edit.tpl
===================================================================
--- core/admin_templates/promo_block_groups/promo_block_group_edit.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/promo_block_group_edit.tpl (revision 0)
@@ -0,0 +1,119 @@
+<inp2:adm_SetPopupSize width="700" height="585"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_block_groups" prefix="promo-block-group" title_preset="promo_block_group_edit"/>
+
+<!-- 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" escape="1"/>', function() {
+ submit_event('promo-block-group', '<inp2:promo-block-group_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ cancel_edit('promo-block-group', 'OnCancelEdit','<inp2:promo-block-group_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
+ reset_form('promo-block-group', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('promo-block-group', '<inp2:promo-block-group_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('promo-block-group', '<inp2:promo-block-group_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if check="promo-block-group_IsSingle" >
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if check="promo-block-group_IsLast" >
+ a_toolbar.DisableButton('next');
+ </inp2:m_if>
+ <inp2:m_if check="promo-block-group_IsFirst" >
+ a_toolbar.DisableButton('prev');
+ </inp2:m_if>
+ </inp2:m_if>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:promo-block-group_SaveWarning name="grid_save_warning"/>
+<inp2:promo-block-group_ErrorWarning name="form_error_warning"/>
+
+<inp2:m_DefineElement name="category_caption">
+ <inp2:m_ifnot check="m_Param" name="is_first">
+ <inp2:m_param name="separator"/>
+ </inp2:m_ifnot>
+ <inp2:m_param name="cat_name"/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="category_path">
+ <inp2:c_CategoryPath cat_id="$cat_id" render_as="category_caption" separator=">"/><br/>
+</inp2:m_DefineElement>
+
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:m_RenderElement name="subsection" prefix="promo-block-group" fields="PromoBlockGroupId,Title,CreatedOn,Status,AssignedToSections" title="la_section_General"/>
+
+ <inp2:m_RenderElement name="inp_id_label" prefix="promo-block-group" field="PromoBlockGroupId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="Title" maxlength="50"/>
+ <inp2:m_RenderElement name="inp_label" prefix="promo-block-group" field="CreatedOn"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block-group" field="Status"/>
+
+ <inp2:m_RenderElement design="form_row" prefix="promo-block-group" field="AssignedToSections">
+ <td class="control-cell" valign="top">
+ <inp2:$prefix_PrintCategories field="$field" render_as="category_path"/>
+ </td>
+ </inp2:m_RenderElement>
+
+ <inp2:m_RenderElement name="subsection" prefix="promo-block-group" fields="RotationDelay,TransitionTime,TransitionControls,TransitionEffect" title="la_section_Settings"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="RotationDelay"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="TransitionTime"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block-group" field="TransitionControls"/>
+
+ <inp2:m_RenderElement design="form_row" prefix="promo-block-group" field="TransitionEffect" format="" empty_value="" has_empty="1">
+ <td class="control-cell">
+ <select tabindex="<inp2:m_Get name='tab_index'/>" name="<inp2:{$prefix}_InputName field='$field'/>" id="<inp2:{$prefix}_InputName field='$field'/>">
+ <inp2:$prefix_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
+ </select>
+
+ <input style="width: 120px;<inp2:m_ifnot check="{$prefix}_Field" name="$field" equals_to="-1" db="db"> display: none;</inp2:m_ifnot>" type="text" name="<inp2:{$prefix}_InputName field='{$field}Custom'/>" id="<inp2:{$prefix}_InputName field='{$field}Custom'/>" value="<inp2:{$prefix}_Field field='{$field}Custom' format='$format'/>" tabindex="<inp2:m_Get name='tab_index'/>"/>
+ </td>
+ </inp2:m_RenderElement>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
+<script type="text/javascript">
+ $(document).ready(
+ function () {
+ var $field_mask = '<inp2:promo-block-group_InputName name="#FIELD_NAME#" js_escape="1"/>';
+
+ $( get_control($field_mask, 'TransitionEffect') ).change(
+ function ($e) {
+ $( get_control($field_mask, 'TransitionEffectCustom') ).toggle( $(this).val() == '-1' );
+ }
+ );
+ }
+ );
+</script>
+<inp2:m_include t="incs/footer"/>
Index: core/admin_templates/promo_block_groups/promo_block_group_list.tpl
===================================================================
--- core/admin_templates/promo_block_groups/promo_block_group_list.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/promo_block_group_list.tpl (revision 0)
@@ -0,0 +1,69 @@
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_block_groups" prefix="promo-block-group" title_preset="promo_block_group_list" />
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ <inp2:m_include t="promo_block_groups/section_reload"/>
+
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+ std_edit_item('promo-block-group', 'promo_block_groups/promo_block_group_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
+ function() {
+ std_precreate_item('promo-block-group', 'promo_block_groups/promo_block_group_edit');
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('promo-block-group')
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
+ submit_event('promo-block-group', 'OnMassApprove');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
+ submit_event('promo-block-group', 'OnMassDecline');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="promo-block-group" grid="Default"/>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_if check="m_Get" var="grid_error">
+ <inp2:m_RenderElement design="form_message" pass_params="1">
+ <inp2:m_Get name="grid_error" result_to_var="grid_error"/>
+ <inp2:m_Phrase name="$grid_error"/>
+ </inp2:m_RenderElement>
+</inp2:m_if>
+
+<inp2:m_RenderElement name="grid" PrefixSpecial="promo-block-group" IdField="PromoBlockGroupId" grid="Default" grid_filters="1"/>
+<script type="text/javascript">
+ Grids['promo-block-group'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline') );
+</script>
+
+<inp2:m_include t="incs/footer"/>
Index: core/admin_templates/promo_block_groups/section_reload.tpl
===================================================================
--- core/admin_templates/promo_block_groups/section_reload.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/section_reload.tpl (revision 0)
@@ -0,0 +1,12 @@
+<inp2:m_if check="m_Get" var="refresh_tree">
+ var $menu_frame = getFrame('menu');
+
+ <inp2:m_DefineElement name="structure_node">
+ $menu_frame.ReloadFolder('<inp2:m_param name="section_url" js_escape="1"/>', true);
+ </inp2:m_DefineElement>
+ <inp2:adm_PrintSection render_as="structure_node" section_name="in-portal:promo_block_groups"/>
+
+ $menu_frame.SyncActive('<inp2:m_t pass="m" m_opener="r"/>');
+</inp2:m_if>
+
+
Index: core/admin_templates/promo_block_groups/tree_section_xml.tpl
===================================================================
--- core/admin_templates/promo_block_groups/tree_section_xml.tpl (revision 0)
+++ core/admin_templates/promo_block_groups/tree_section_xml.tpl (revision 0)
@@ -0,0 +1,7 @@
+<inp2:m_XMLTemplate/>
+<tree>
+<inp2:m_DefineElement name="xml_node" icon_module="">
+ <item href="<inp2:m_Link template='promo_blocks/promo_block_list' pass='m,$PrefixSpecial' m_opener='r'/>" icon="<inp2:ModulePath module='core'/>img/icons/icon24_section.png"><inp2:Field field="Title"/></item>
+</inp2:m_DefineElement>
+<inp2:promo-block-group_PrintList render_as="xml_node"/>
+</tree>
Index: core/admin_templates/promo_blocks/promo_block_edit.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_edit.tpl (revision 14917)
+++ core/admin_templates/promo_blocks/promo_block_edit.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="700" height="585"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_edit"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_block_groups" prefix="promo-block" title_preset="promo_block_edit"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -78,6 +78,7 @@
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="inp_id_label" prefix="promo-block" field="BlockId" title="la_fld_Id"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="promo-block" field="PromoBlockGroupId" title="la_fld_PromoBlockGroup" has_empty="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="promo-block" field="Title" maxlength="50"/>
<inp2:m_RenderElement name="inp_edit_textarea_ml" prefix="promo-block" field="Html" title="la_fld_Text" control_options="{min_height: 60}" rows="4" cols="70"/>
Index: core/admin_templates/promo_blocks/promo_block_list.tpl
===================================================================
--- core/admin_templates/promo_blocks/promo_block_list.tpl (revision 14917)
+++ core/admin_templates/promo_blocks/promo_block_list.tpl (working copy)
@@ -1,5 +1,5 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" section="in-portal:promo_blocks" prefix="promo-block" title_preset="promo_block_list" />
+<inp2:m_RenderElement name="combined_header" section="in-portal:promo_block_groups" prefix="promo-block" title_preset="promo_block_list" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -7,6 +7,8 @@
<tr>
<td>
<script type="text/javascript">
+ <inp2:m_include t="promo_block_groups/section_reload"/>
+
//do not rename - this function is used in default grid for double click!
function edit()
{
@@ -51,6 +53,11 @@
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+ a_toolbar.AddButton( new ToolBarButton('tools', '<inp2:m_phrase label="la_ToolTip_Settings" escape="1"/>', function() {
+ direct_edit('promo-block', '<inp2:promo-block-group_EditLink edit_template="promo_block_groups/promo_block_group_edit" js_escape="1" no_amp="1"/>');
+ }
+ ) );
+
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
Index: core/admin_templates/tree.tpl
===================================================================
--- core/admin_templates/tree.tpl (revision 14917)
+++ core/admin_templates/tree.tpl (working copy)
@@ -173,15 +173,21 @@
}
}
- <inp2:m_if check="m_GetConfig" name="DebugOnlyFormConfigurator">
- <inp2:m_ifnot check="m_IsDebugMode">
- <inp2:m_DefineElement name="forms_node">
- var $forms_node = the_tree.locateItemByURL('<inp2:m_param name="section_url" js_escape="1"/>');
- $forms_node.Container = true;
- </inp2:m_DefineElement>
- <inp2:adm_PrintSection render_as="forms_node" section_name="in-portal:forms"/>
- </inp2:m_ifnot>
- </inp2:m_if>
+ <inp2:m_DefineElement name="container_node">
+ var $container_node = the_tree.locateItemByURL('<inp2:m_param name="section_url" js_escape="1"/>');
+ $container_node.Container = true;
+ </inp2:m_DefineElement>
+
+ <inp2:m_DefineElement name="container_node_fix">
+ <inp2:m_if check="m_GetConfig" name="$config_var">
+ <inp2:m_ifnot check="m_IsDebugMode">
+ <inp2:adm_PrintSection render_as="container_node" section_name="$section"/>
+ </inp2:m_ifnot>
+ </inp2:m_if>
+ </inp2:m_DefineElement>
+
+ <inp2:m_RenderElement name="container_node_fix" config_var="DebugOnlyFormConfigurator" section="in-portal:forms"/>
+ <inp2:m_RenderElement name="container_node_fix" config_var="DebugOnlyPromoBlockGroupConfigurator" section="in-portal:promo_block_groups"/>
</script>
<!--## when form is on top, then 100% height is broken ##-->
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14926)
+++ core/install/english.lang (working copy)
@@ -149,6 +149,7 @@
<PHRASE Label="la_config_CSVExportEncoding" Module="Core" Type="1">RGVmYXVsdCBDU1YgRXhwb3J0IEVuY29kaW5n</PHRASE>
<PHRASE Label="la_config_CSVExportSeparator" Module="Core" Type="1">RGVmYXVsdCBDU1YgRXhwb3J0IE5ldyBMaW5lIFNlcGFyYXRvcg==</PHRASE>
<PHRASE Label="la_config_DebugOnlyFormConfigurator" Module="Core" Type="1">U2hvdyAiRm9ybXMgRWRpdG9yIiBpbiBERUJVRyBtb2RlIG9ubHk=</PHRASE>
+ <PHRASE Label="la_config_DebugOnlyPromoBlockGroupConfigurator" Module="Core" Type="1">U2hvdyAiUHJvbW8gQmxvY2sgR3JvdXBzIEVkaXRvciIgaW4gREVCVUcgbW9kZSBvbmx5</PHRASE>
<PHRASE Label="la_config_DefaultDesignTemplate" Module="Core" Type="1">RGVmYXVsdCBEZXNpZ24gVGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_config_DefaultRegistrationCountry" Module="Core" Type="1">RGVmYXVsdCBSZWdpc3RyYXRpb24gQ291bnRyeQ==</PHRASE>
<PHRASE Label="la_config_DefaultTrackingCode" Module="Core" Type="1">RGVmYXVsdCBBbmFseXRpY3MgVHJhY2tpbmcgQ29kZQ==</PHRASE>
@@ -175,10 +176,6 @@
<PHRASE Label="la_config_PathToWebsite" Module="Core" Type="1">UGF0aCB0byBXZWJzaXRl</PHRASE>
<PHRASE Label="la_config_PerformExactSearch" Module="Core" Type="1" Hint="U2VhcmNoIGZvciBhbGwgZW50ZXJlZCBrZXl3b3JkcywgaW5zdGVhZCBvZiBhbnkgb25lIG9mIHRoZW0=">UGVyZm9ybSBFeGFjdCBTZWFyY2g=</PHRASE>
<PHRASE Label="la_config_PerpageReviews" Module="Core" Type="1">Q29tbWVudHMgcGVyIHBhZ2U=</PHRASE>
- <PHRASE Label="la_config_PromoRotationDelay" Module="Core" Type="1">UHJvbW8gUm90YXRpb24gRGVsYXkgKHNlY29uZHMp</PHRASE>
- <PHRASE Label="la_config_PromoTransitionControls" Module="Core" Type="1">UHJvbW8gVHJhbnNpdGlvbiBDb250cm9scw==</PHRASE>
- <PHRASE Label="la_config_PromoTransitionEffect" Module="Core" Type="1">UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3Q=</PHRASE>
- <PHRASE Label="la_config_PromoTransitionTime" Module="Core" Type="1">VHJhbnNpdGlvbiBEZWxheSAoc2Vjb25kcyk=</PHRASE>
<PHRASE Label="la_config_QuickCategoryPermissionRebuild" Module="Core" Type="1">UXVpY2sgU2VjdGlvbiBQZXJtaXNzaW9uIFJlYnVpbGQ=</PHRASE>
<PHRASE Label="la_config_RecycleBinFolder" Module="Core" Type="1">IlJlY3ljbGUgQmluIiBTZWN0aW9uSWQ=</PHRASE>
<PHRASE Label="la_config_RegistrationUsernameRequired" Module="Core" Type="1">VXNlcm5hbWUgUmVxdWlyZWQgRHVyaW5nIFJlZ2lzdHJhdGlvbg==</PHRASE>
@@ -259,6 +256,7 @@
<PHRASE Label="la_error_OperationNotAllowed" Module="Core" Type="1">VGhpcyBvcGVyYXRpb24gaXMgbm90IGFsbG93ZWQh</PHRASE>
<PHRASE Label="la_error_ParsingError" Module="Core" Type="1">VmFsaWRhdGlvbiBlcnJvciwgcGxlYXNlIGRvdWJsZS1jaGVjayBJbi1Qb3J0YWwgdGFncw==</PHRASE>
<PHRASE Label="la_error_PasswordMatch" Module="Core" Type="1">UGFzc3dvcmRzIGRvIG5vdCBtYXRjaCE=</PHRASE>
+ <PHRASE Label="la_error_PromoGroupNotEmpty" Module="Core" Type="1">Q2FuJ3QgRGVsZXRlIE5vbi1FbXB0eSBQcm9tbyBCbG9jayBHcm91cA==</PHRASE>
<PHRASE Label="la_error_required" Module="Core" Type="1">UmVxdWlyZWQgZmllbGQoLXMpIG5vdCBmaWxsZWQ=</PHRASE>
<PHRASE Label="la_error_RequiredColumnsMissing" Module="Core" Type="1">cmVxdWlyZWQgY29sdW1ucyBtaXNzaW5n</PHRASE>
<PHRASE Label="la_error_RootCategoriesDelete" Module="Core" Type="1">Um9vdCBzZWN0aW9uIG9mIHRoZSBtb2R1bGUocykgY2FuIG5vdCBiZSBkZWxldGVkIQ==</PHRASE>
@@ -308,6 +306,7 @@
<PHRASE Label="la_fld_AllowChangingSender" Module="Core" Type="1">QWxsb3cgQ2hhbmdpbmcgU2VuZGVy</PHRASE>
<PHRASE Label="la_fld_AltValue" Module="Core" Type="1">QWx0IFZhbHVl</PHRASE>
<PHRASE Label="la_fld_Answer" Module="Core" Type="1">QW5zd2Vy</PHRASE>
+ <PHRASE Label="la_fld_AssignedToSections" Module="Core" Type="1">QXNzaWduZWQgdG8gU2VjdGlvbnM=</PHRASE>
<PHRASE Label="LA_FLD_ATTACHMENT" Module="Core" Type="1">QXR0YWNobWVudA==</PHRASE>
<PHRASE Label="la_fld_AutoCreateFileName" Module="Core" Type="1">QXV0byBDcmVhdGUgRmlsZSBOYW1l</PHRASE>
<PHRASE Label="la_fld_AutomaticFilename" Module="Core" Type="1">QXV0b21hdGljIEZpbGVuYW1l</PHRASE>
@@ -544,6 +543,7 @@
<PHRASE Label="la_fld_PrimaryTranslation" Module="Core" Type="1">UHJpbWFyeSBMYW5ndWFnZSBQaHJhc2U=</PHRASE>
<PHRASE Label="la_fld_Priority" Module="Core" Type="1" Column="T3JkZXI=">T3JkZXI=</PHRASE>
<PHRASE Label="la_fld_ProcessUnmatchedEmails" Module="Core" Type="1">Q29udmVydCB1bm1hdGNoZWQgZS1tYWlscyBpbnRvIG5ldyBzdWJtaXNzaW9ucw==</PHRASE>
+ <PHRASE Label="la_fld_PromoBlockGroup" Module="Core" Type="1">UHJvbW8gQmxvY2sgR3JvdXA=</PHRASE>
<PHRASE Label="la_fld_Protected" Module="Core" Type="1" Column="UHJvdGVjdGVk">UHJvdGVjdGVk</PHRASE>
<PHRASE Label="la_fld_Qty" Module="Core" Type="1" Column="UXR5">UXVhbnRpdHk=</PHRASE>
<PHRASE Label="la_fld_Rating" Module="Core" Type="1" Column="UmF0aW5n">UmF0aW5n</PHRASE>
@@ -572,6 +572,7 @@
<PHRASE Label="la_fld_Required" Module="Core" Type="1" Column="UmVxdWlyZWQ=">UmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_fld_RequireLogin" Module="Core" Type="1" Column="UmVxdWlyZSBMb2dpbg==">UmVxdWlyZSBMb2dpbg==</PHRASE>
<PHRASE Label="la_fld_ReviewText" Module="Core" Type="1" Column="Q29tbWVudA==">Q29tbWVudA==</PHRASE>
+ <PHRASE Label="la_fld_RotationDelay" Module="Core" Type="1" Column="UHJvbW8gUm90YXRpb24gRGVsYXkgKHNlY29uZHMp">UHJvbW8gUm90YXRpb24gRGVsYXkgKHNlY29uZHMp</PHRASE>
<PHRASE Label="la_fld_RuleType" Module="Core" Type="1" Column="UnVsZSBUeXBl">UnVsZSBUeXBl</PHRASE>
<PHRASE Label="la_fld_RunInterval" Module="Core" Type="1" Column="UnVuIEludGVydmFs">UnVuIEludGVydmFs</PHRASE>
<PHRASE Label="la_fld_RunMode" Module="Core" Type="1" Column="UnVuIE1vZGU=">UnVuIE1vZGU=</PHRASE>
@@ -625,6 +626,10 @@
<PHRASE Label="la_fld_ToEmail" Module="Core" Type="1" Column="VG8gRS1tYWls">VG8gRS1tYWls</PHRASE>
<PHRASE Label="la_fld_Top" Module="Core" Type="1">VG9w</PHRASE>
<PHRASE Label="la_fld_TrackingCode" Module="Core" Type="1">QW5hbHl0aWNzIFRyYWNraW5nIENvZGU=</PHRASE>
+ <PHRASE Label="la_fld_TransitionControls" Module="Core" Type="1" Column="UHJvbW8gVHJhbnNpdGlvbiBDb250cm9scw==">UHJvbW8gVHJhbnNpdGlvbiBDb250cm9scw==</PHRASE>
+ <PHRASE Label="la_fld_TransitionEffect" Module="Core" Type="1" Column="UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3Q=">UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3Q=</PHRASE>
+ <PHRASE Label="la_fld_TransitionEffectCustom" Module="Core" Type="1" Column="UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3QgKGN1c3RvbSk=">UHJvbW8gVHJhbnNpdGlvbiBFZmZlY3QgKGN1c3RvbSk=</PHRASE>
+ <PHRASE Label="la_fld_TransitionTime" Module="Core" Type="1" Column="VHJhbnNpdGlvbiBEZWxheSAoc2Vjb25kcyk=">VHJhbnNpdGlvbiBEZWxheSAoc2Vjb25kcyk=</PHRASE>
<PHRASE Label="la_fld_Translation" Module="Core" Type="1" Column="VmFsdWU=">UGhyYXNl</PHRASE>
<PHRASE Label="la_fld_Type" Module="Core" Type="1" Column="VHlwZQ==">VHlwZQ==</PHRASE>
<PHRASE Label="la_fld_UnitSystem" Module="Core" Type="1">TWVhc3VyZXMgU3lzdGVt</PHRASE>
@@ -730,6 +735,7 @@
<PHRASE Label="la_opt_Address" Module="Core" Type="1">QWRkcmVzcw==</PHRASE>
<PHRASE Label="la_opt_After" Module="Core" Type="1">QWZ0ZXI=</PHRASE>
<PHRASE Label="la_opt_Allow" Module="Core" Type="1">QWxsb3c=</PHRASE>
+ <PHRASE Label="la_opt_AnimationCustom" Module="Core" Type="1">Q3VzdG9t</PHRASE>
<PHRASE Label="la_opt_AnimationFade" Module="Core" Type="1">RmFkZQ==</PHRASE>
<PHRASE Label="la_opt_AnimationSlide" Module="Core" Type="1">U2xpZGU=</PHRASE>
<PHRASE Label="la_opt_AutoDetect" Module="Core" Type="1">QXV0by1EZXRlY3Q=</PHRASE>
@@ -1184,7 +1190,6 @@
<PHRASE Label="la_Text_Phone" Module="Core" Type="1">UGhvbmU=</PHRASE>
<PHRASE Label="la_Text_Pop" Module="Core" Type="1">UG9wdWxhcg==</PHRASE>
<PHRASE Label="la_text_popularity" Module="Core" Type="1">UG9wdWxhcml0eQ==</PHRASE>
- <PHRASE Label="la_Text_PromoSettings" Module="Core" Type="1">UHJvbW8gU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_text_ready_to_install" Module="Core" Type="1">UmVhZHkgdG8gSW5zdGFsbA==</PHRASE>
<PHRASE Label="la_text_RecordsAdded" Module="Core" Type="1">cmVjb3JkcyBhZGRlZA==</PHRASE>
<PHRASE Label="la_text_RecordsUpdated" Module="Core" Type="1">cmVjb3JkcyB1cGRhdGVk</PHRASE>
@@ -1212,6 +1217,7 @@
<PHRASE Label="la_title_AddingMailingList" Module="Core" Type="1">QWRkaW5nIE1haWxpbmcgTGlzdA==</PHRASE>
<PHRASE Label="la_title_AddingPermissionType" Module="Core" Type="1">QWRkaW5nIFBlcm1pc3Npb24gVHlwZQ==</PHRASE>
<PHRASE Label="la_title_AddingPromoBlock" Module="Core" Type="1">QWRkaW5nIFByb21vIEJsb2Nr</PHRASE>
+ <PHRASE Label="la_title_AddingPromoBlockGroup" Module="Core" Type="1">QWRkaW5nIFByb21vIEJsb2NrIEdyb3Vw</PHRASE>
<PHRASE Label="la_title_AddingScheduledTask" Module="Core" Type="1">QWRkaW5nIFNjaGVkdWxlZCBUYXNr</PHRASE>
<PHRASE Label="la_title_AddingSiteDomain" Module="Core" Type="1">QWRkaW5nIFNpdGUgRG9tYWlu</PHRASE>
<PHRASE Label="la_title_AddingSkin" Module="Core" Type="1">QWRkaW5nIFNraW4=</PHRASE>
@@ -1264,6 +1270,7 @@
<PHRASE Label="la_title_EditingMembership" Module="Core" Type="1">RWRpdGluZyBNZW1iZXJzaGlw</PHRASE>
<PHRASE Label="la_title_EditingPermissionType" Module="Core" Type="1">RWRpdGluZyBQZXJtaXNzaW9uIFR5cGU=</PHRASE>
<PHRASE Label="la_title_EditingPromoBlock" Module="Core" Type="1">RWRpdGluZyBQcm9tbyBCbG9jaw==</PHRASE>
+ <PHRASE Label="la_title_EditingPromoBlockGroup" Module="Core" Type="1">RWRpdGluZyBQcm9tbyBCbG9jayBHcm91cA==</PHRASE>
<PHRASE Label="la_title_EditingScheduledTask" Module="Core" Type="1">RWRpdGluZyBTY2hlZHVsZWQgVGFzaw==</PHRASE>
<PHRASE Label="la_title_EditingSiteDomain" Module="Core" Type="1">RWRpdGluZyBTaXRlIERvbWFpbg==</PHRASE>
<PHRASE Label="la_title_EditingSkin" Module="Core" Type="1">RWRpdGluZyBTa2lu</PHRASE>
@@ -1333,6 +1340,7 @@
<PHRASE Label="la_title_Permissions" Module="Core" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_title_Phrases" Module="Core" Type="1">TGFiZWxzICYgUGhyYXNlcw==</PHRASE>
<PHRASE Label="la_Title_PleaseWait" Module="Core" Type="1">UGxlYXNlIFdhaXQ=</PHRASE>
+ <PHRASE Label="la_title_PromoBlockGroups" Module="Core" Type="1">UHJvbW8gQmxvY2sgR3JvdXBz</PHRASE>
<PHRASE Label="la_title_PromoBlocks" Module="Core" Type="1">UHJvbW8gQmxvY2tz</PHRASE>
<PHRASE Label="la_title_Properties" Module="Core" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_title_RelatedSearches" Module="Core" Type="1">UmVsYXRlZCBTZWFyY2hlcw==</PHRASE>
@@ -1473,6 +1481,7 @@
<PHRASE Label="la_ToolTip_setprimarycategory" Module="Core" Type="1">U2V0IFByaW1hcnkgU2VjdGlvbg==</PHRASE>
<PHRASE Label="la_ToolTip_SetPrimaryLanguage" Module="Core" Type="1">U2V0IFByaW1hcnkgTGFuZ3VhZ2U=</PHRASE>
<PHRASE Label="la_ToolTip_SetSticky" Module="Core" Type="1">U2V0IFN0aWNreQ==</PHRASE>
+ <PHRASE Label="la_ToolTip_Settings" Module="Core" Type="1">U2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_ToolTip_ShowMenu" Module="Core" Type="1">U2hvdyBNZW51</PHRASE>
<PHRASE Label="la_ToolTip_SynchronizeLanguages" Module="Core" Type="1">U3luY2hyb25pemUgTGFuZ3VhZ2Vz</PHRASE>
<PHRASE Label="la_ToolTip_Tools" Module="Core" Type="1">VG9vbHM=</PHRASE>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14924)
+++ core/install/install_data.sql (working copy)
@@ -67,11 +67,12 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ResizableFrames', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_ResizableFrames', 'checkbox', '', '', 40.10, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AutoRefreshIntervals', '1,5,15,30,60,120,240', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_AutoRefreshIntervals', 'text', '', '', 40.11, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DebugOnlyFormConfigurator', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DebugOnlyFormConfigurator', 'checkbox', '', '', 40.12, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'RememberLastAdminTemplate', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_RememberLastAdminTemplate', 'checkbox', '', '', 40.13, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseHTTPAuth', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseHTTPAuth', 'checkbox', '', '', 40.14, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthUsername', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthUsername', 'text', '', '', 40.15, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthPassword', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthPassword', 'password', NULL, NULL, 40.16, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthBypassIPs', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthBypassIPs', 'text', '', '', 40.17, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DebugOnlyPromoBlockGroupConfigurator', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DebugOnlyPromoBlockGroupConfigurator', 'checkbox', '', '', 40.13, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'RememberLastAdminTemplate', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_RememberLastAdminTemplate', 'checkbox', '', '', 40.14, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseHTTPAuth', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_UseHTTPAuth', 'checkbox', '', '', 40.15, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthUsername', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthUsername', 'text', '', '', 40.16, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthPassword', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthPassword', 'password', NULL, NULL, 40.17, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HTTPAuthBypassIPs', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_HTTPAuthBypassIPs', 'text', '', '', 40.18, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_Server', NULL, 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_mailserver', 'text', NULL, NULL, 50.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_Port', NULL, 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_mailport', 'text', NULL, NULL, 50.02, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Smtp_Authenticate', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_prompt_mailauthenticate', 'checkbox', NULL, NULL, 50.03, 0, 1, NULL);
@@ -95,12 +96,6 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux||1=la_Windows', 70.03, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsCSVExport', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode||1=la_Regular', 70.04, 0, 1, NULL);
-# Section "in-portal:configure_promo_blocks":
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoRotationDelay', '7', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoRotationDelay', 'text', '', '', 10.01, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionTime', '0.6', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionTime', 'text', '', '', 10.02, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionControls', '1', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionControls', 'select', '', '1=la_Enabled||0=la_Disabled', 10.03, 0, 0, NULL);
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PromoTransitionEffect', 'fade', 'In-Portal', 'in-portal:configure_promo_blocks', 'la_Text_PromoSettings', 'la_config_PromoTransitionEffect', 'select', '', 'fade=la_opt_AnimationFade||slide=la_opt_AnimationSlide', 10.04, 0, 0, NULL);
-
# Section "in-portal:configure_users":
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_allow_new', 'radio', '', '1=la_opt_UserInstantRegistration||2=la_opt_UserNotAllowedRegistration||3=la_opt_UserUponApprovalRegistration||4=la_opt_UserEmailActivation', 10.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'AdvancedUserManagement', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_prompt_AdvancedUserManagement', 'checkbox', NULL, NULL, 10.011, 0, 1, NULL);
@@ -673,6 +668,11 @@
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:submissions.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.delete', 11, 1, 1, 0);
+
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mailing_lists.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mailing_lists.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:mailing_lists.edit', 11, 1, 1, 0);
@@ -994,5 +994,7 @@
#INSERT INTO PageContent VALUES (DEFAULT, 1, 1, '<span style="font-weight: bold;">In-portal</span> is a revolutionary Web Site management system that allows you to automate and facilitate management of large portal and community web sites. Regardless of whether you are running a directory site or a content news portal, a community site or an online mall, In-portal will enhance your web site management experience with innovative.</span><br><br>We are proud to present our newly developed <b>"default"</b> theme that introduces a fresh look as well totally new approach in the template system.</span><br>', NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0);
+INSERT INTO PromoBlockGroups VALUES (DEFAULT, 'Default Group', UNIX_TIMESTAMP(), '1', '7.00', '0.60', '1', 'fade', '');
+
INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL, NULL);
INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
\ No newline at end of file
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 14917)
+++ core/install/install_schema.sql (working copy)
@@ -478,6 +478,7 @@
LiveRevisionNumber int(11) NOT NULL DEFAULT '1',
DirectLinkEnabled tinyint(4) NOT NULL DEFAULT '1',
DirectLinkAuthKey varchar(20) NOT NULL,
+ PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (CategoryId),
UNIQUE KEY ResourceId (ResourceId),
KEY ParentId (ParentId),
@@ -506,7 +507,8 @@
KEY OverridePageCacheKey (OverridePageCacheKey),
KEY PageExpiration (PageExpiration),
KEY Protected (Protected),
- KEY LiveRevisionNumber (LiveRevisionNumber)
+ KEY LiveRevisionNumber (LiveRevisionNumber),
+ KEY PromoBlockGroupId (PromoBlockGroupId)
);
CREATE TABLE CategoryCustomData (
@@ -1304,6 +1306,21 @@
l3_Html text,
l4_Html text,
l5_Html text,
+ PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (BlockId),
- KEY OpenInNewWindow (OpenInNewWindow)
+ KEY OpenInNewWindow (OpenInNewWindow),
+ KEY PromoBlockGroupId (PromoBlockGroupId)
+);
+
+CREATE TABLE PromoBlockGroups (
+ PromoBlockGroupId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ CreatedOn int(10) unsigned DEFAULT NULL,
+ `Status` tinyint(1) NOT NULL DEFAULT '1',
+ RotationDelay decimal(9,2) DEFAULT NULL,
+ TransitionTime decimal(9,2) DEFAULT NULL,
+ TransitionControls tinyint(1) NOT NULL DEFAULT '1',
+ TransitionEffect varchar(255) NOT NULL DEFAULT '',
+ TransitionEffectCustom varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (PromoBlockGroupId)
);
\ No newline at end of file
Index: core/install/remove_schema.sql
===================================================================
--- core/install/remove_schema.sql (revision 14917)
+++ core/install/remove_schema.sql (working copy)
@@ -74,3 +74,4 @@
DROP TABLE SiteDomains;
DROP TABLE CurlLog;
DROP TABLE PromoBlocks;
+DROP TABLE PromoBlockGroups;
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14924)
+++ core/install/upgrades.sql (working copy)
@@ -2428,4 +2428,48 @@
UPDATE ConfigurationValues
SET HintLabel = CONCAT('hint:', Prompt)
-WHERE VariableName IN ('ForceModRewriteUrlEnding', 'PerformExactSearch');
\ No newline at end of file
+WHERE VariableName IN ('ForceModRewriteUrlEnding', 'PerformExactSearch');
+
+DELETE FROM Phrase
+WHERE PhraseKey IN (
+ 'LA_TEXT_PROMOSETTINGS', 'LA_CONFIG_PROMOROTATIONDELAY', 'LA_CONFIG_PROMOTRANSITIONTIME',
+ 'LA_CONFIG_PROMOTRANSITIONCONTROLS', 'LA_CONFIG_PROMOTRANSITIONEFFECT'
+);
+
+DELETE FROM ConfigurationValues WHERE VariableName IN ('PromoRotationDelay', 'PromoTransitionTime', 'PromoTransitionControls', 'PromoTransitionEffect');
+DELETE FROM Permissions WHERE Permission LIKE 'in-portal:promo_blocks.%';
+
+CREATE TABLE PromoBlockGroups (
+ PromoBlockGroupId int(11) NOT NULL AUTO_INCREMENT,
+ Title varchar(255) NOT NULL DEFAULT '',
+ CreatedOn int(10) unsigned DEFAULT NULL,
+ `Status` tinyint(1) NOT NULL DEFAULT '1',
+ RotationDelay decimal(9,2) DEFAULT NULL,
+ TransitionTime decimal(9,2) DEFAULT NULL,
+ TransitionControls tinyint(1) NOT NULL DEFAULT '1',
+ TransitionEffect varchar(255) NOT NULL DEFAULT '',
+ TransitionEffectCustom varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (PromoBlockGroupId)
+);
+
+ALTER TABLE Category
+ ADD PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
+ ADD INDEX (PromoBlockGroupId);
+
+ALTER TABLE PromoBlocks
+ ADD PromoBlockGroupId int(10) unsigned NOT NULL DEFAULT '0',
+ ADD INDEX (PromoBlockGroupId);
+
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'DebugOnlyPromoBlockGroupConfigurator', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsAdmin', 'la_config_DebugOnlyPromoBlockGroupConfigurator', 'checkbox', '', '', 40.13, 0, 0, NULL);
+
+UPDATE ConfigurationValues
+SET DisplayOrder = DisplayOrder + 0.01
+WHERE VariableName IN ('RememberLastAdminTemplate', 'UseHTTPAuth', 'HTTPAuthUsername', 'HTTPAuthPassword', 'HTTPAuthBypassIPs');
+
+INSERT INTO PromoBlockGroups VALUES (DEFAULT, 'Default Group', UNIX_TIMESTAMP(), '1', '7.00', '0.60', '1', 'fade', '');
+UPDATE PromoBlocks SET PromoBlockGroupId = 1;
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.delete', 11, 1, 1, 0);
Index: core/units/categories/categories_config.php
===================================================================
--- core/units/categories/categories_config.php (revision 14917)
+++ core/units/categories/categories_config.php (working copy)
@@ -407,7 +407,12 @@
'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 1
),
- 'DirectLinkAuthKey' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'default' => '')
+ 'DirectLinkAuthKey' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'default' => ''),
+ 'PromoBlockGroupId' => Array (
+ 'type' => 'int',
+ 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PromoBlockGroups ORDER BY Title', 'option_title_field' => 'Title', 'option_key_field' => 'PromoBlockGroupId',
+ 'not_null' => 1, 'default' => 0,
+ ),
),
'VirtualFields' => Array (
Index: core/units/promo_block_groups/promo_block_group_eh.php
===================================================================
--- core/units/promo_block_groups/promo_block_group_eh.php (revision 0)
+++ core/units/promo_block_groups/promo_block_group_eh.php (revision 0)
@@ -0,0 +1,131 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class PromoBlockGroupEventHandler extends kDBEventHandler {
+
+ /**
+ * Occurs before creating item
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+ $this->beforeItemChange($event);
+ }
+
+ /**
+ * Occurs before updating item
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+ $this->beforeItemChange($event);
+ }
+
+ /**
+ * Occurs before updating item
+ *
+ * @param kEvent $event
+ * @return void
+ * @access private
+ */
+ private function beforeItemChange(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $object->setRequired('TransitionEffectCustom', $object->GetDBField('TransitionEffect') == '-1');
+ }
+
+ /**
+ * Occurs before deleting item
+ *
+ * @param kEvent $event
+ * @return void
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ parent::OnBeforeItemDelete($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'SELECT BlockId
+ FROM ' . TABLE_PREFIX . 'PromoBlocks
+ WHERE PromoBlockGroupId = ' . $object->GetID();
+ $block_id = $this->Conn->GetOne($sql);
+
+ if ( $block_id ) {
+ $event->MasterEvent->SetRedirectParam('grid_error', 'la_error_PromoGroupNotEmpty');
+ $event->status = kEvent::erFAIL;
+ }
+ }
+
+ /**
+ * Deleting empty promo block group disconnects it from associated sections
+ *
+ * @param kEvent $event
+ * @return void
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'Category
+ SET PromoBlockGroupId = 0
+ WHERE PromoBlockGroupId = ' . $event->getEventParam('id');
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Set tree update flag
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnSave(&$event)
+ {
+ parent::OnSave($event);
+
+ if ( $event->status == kEvent::erSUCCESS ) {
+ $event->SetRedirectParam('refresh_tree', 1);
+ }
+ }
+
+ /**
+ * Set tree update flag
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnMassDelete(&$event)
+ {
+ parent::OnMassDelete($event);
+
+ if ( $event->status == kEvent::erSUCCESS ) {
+ $event->SetRedirectParam('refresh_tree', 1);
+ }
+ }
+}
Index: core/units/promo_block_groups/promo_block_group_tp.php
===================================================================
--- core/units/promo_block_groups/promo_block_group_tp.php (revision 0)
+++ core/units/promo_block_groups/promo_block_group_tp.php (revision 0)
@@ -0,0 +1,73 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class PromoBlockGroupTagProcessor extends kDBtagProcessor {
+
+ /**
+ * Print list of categories
+ *
+ * @param Array $params
+ * @return string
+ * @access protected
+ */
+ protected function PrintCategories(Array $params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $ret = '';
+ $field = $this->SelectParam($params, 'name,field');
+ $categories = explode(';', $object->GetDBField($field));
+
+ $block_params = $this->prepareTagParams($params);
+ $block_params['name'] = $params['render_as'];
+
+ foreach ($categories as $category_id) {
+ if ( $category_id ) {
+ $block_params['cat_id'] = $category_id;
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Returns link to edit promo block group, associated with this promo block list
+ *
+ * @param Array $params
+ * @return string
+ * @return protected
+ */
+ protected function EditLink(Array $params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $prefix = $object->getPrefixSpecial();
+
+ $url_params = Array (
+ 'm_opener' => 'd',
+ $prefix . '_mode' => 't',
+ $prefix . '_event' => 'OnEdit',
+ $prefix . '_id' => $object->GetID(),
+ 'pass' => 'all,' . $prefix,
+ 'no_pass_through' => 1,
+ );
+
+ return $this->Application->HREF($params['edit_template'], '', $url_params);
+ }
+}
Index: core/units/promo_block_groups/promo_block_groups_config.php
===================================================================
--- core/units/promo_block_groups/promo_block_groups_config.php (revision 0)
+++ core/units/promo_block_groups/promo_block_groups_config.php (revision 0)
@@ -0,0 +1,120 @@
+<?php
+
+$config = Array (
+ 'Prefix' => 'promo-block-group',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'PromoBlockGroupEventHandler', 'file' => 'promo_block_group_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'PromoBlockGroupTagProcessor', 'file' => 'promo_block_group_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'PerPage',
+ 4 => 'event',
+ 5 => 'mode',
+ ),
+
+ 'IDField' => 'PromoBlockGroupId',
+
+ 'TableName' => TABLE_PREFIX . 'PromoBlockGroups',
+
+ 'TitleField' => 'Title',
+
+ 'StatusField' => Array('Status'),
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('promo-block-group' => '!la_title_AddingPromoBlockGroup!'),
+ 'edit_status_labels' => Array ('promo-block-group' => '!la_title_EditingPromoBlockGroup!'),
+ ),
+
+ 'promo_block_group_list' => Array ('prefixes' => Array ('promo-block-group_List'), 'format' => "!la_title_PromoBlockGroups! (#promo-block-group_recordcount#)"),
+ 'promo_block_group_edit' => Array ('prefixes' => Array ('promo-block-group'), 'format' => "#promo-block-group_status# '#promo-block-group_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:promo_block_groups'),
+
+ 'Sections' => Array (
+ 'in-portal:promo_block_groups' => Array(
+ 'parent' => 'in-portal:site',
+ 'icon' => 'promo_block_groups',
+ 'label' => 'la_tab_PromoBlocks',
+ 'url' => Array('t' => 'promo_block_groups/promo_block_group_list', 'pass' => 'm'),
+ 'late_load' => Array ('t' => 'promo_block_groups/tree_section_xml', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'AssignedToSections' => '(SELECT GROUP_CONCAT(CategoryId SEPARATOR ";") FROM '.TABLE_PREFIX.'Category WHERE PromoBlockGroupId = %1$s.PromoBlockGroupId)',
+ ),
+ ),
+
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('Title' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'PromoBlockGroupId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'not_null' => 1, 'required' => 1, 'default' => '',
+ ),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ 'Status' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1,
+ 'not_null' => 1, 'required' => 1, 'default' => 1,
+ ),
+ 'RotationDelay' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'required' => 1, 'default' => NULL),
+ 'TransitionTime' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'required' => 1, 'default' => NULL),
+ 'TransitionControls' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 1,
+ ),
+ 'TransitionEffect' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array ('fade' => 'la_opt_AnimationFade', 'slide' => 'la_opt_AnimationSlide', '-1' => 'la_opt_AnimationCustom'), 'use_phrases' => 1,
+ 'not_null' => 1, 'required' => 1, 'default' => '',
+ ),
+ 'TransitionEffectCustom' => Array (
+ 'type' => 'string',
+ 'error_field' => 'TransitionEffect',
+ 'formatter' => 'kFormatter',
+ 'not_null' => 1, 'default' => '',
+ ),
+ ),
+
+ 'VirtualFields' => Array(
+ 'AssignedToSections' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array ('default' => 'icon16_item.png', 0 => 'icon16_disabled.png', 1 => 'icon16_item.png'),
+ 'Fields' => Array (
+ 'PromoBlockGroupId' => Array ('title' => 'column:la_fld_Id', 'filter_block' => 'grid_range_filter', 'width' => 80),
+ 'Title' => Array ('filter_block' => 'grid_like_filter', 'width' => 150),
+ 'RotationDelay' => Array ('filter_block' => 'grid_range_filter'),
+ 'TransitionTime' => Array ('filter_block' => 'grid_range_filter'),
+ 'TransitionControls' => Array ('filter_block' => 'grid_options_filter'),
+ 'TransitionEffect' => Array ('filter_block' => 'grid_options_filter'),
+ 'TransitionEffectCustom' => Array ('filter_block' => 'grid_like_filter'),
+ ),
+ ),
+ ),
+);
Index: core/units/promo_blocks/promo_block_eh.php
===================================================================
--- core/units/promo_blocks/promo_block_eh.php (revision 14917)
+++ core/units/promo_blocks/promo_block_eh.php (working copy)
@@ -52,6 +52,26 @@
}
/**
+ * Sets default value for promo block group
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnPreCreate(&$event)
+ {
+ parent::OnPreCreate($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $promo_block_group =& $this->Application->recallObject('promo-block-group');
+ /* @var $promo_block_group kDBItem */
+
+ $object->SetDBField('PromoBlockGroupId', $promo_block_group->GetID());
+ }
+
+ /**
* Processes OnMassMoveUp, OnMassMoveDown events
*
* @param kEvent $event
@@ -74,18 +94,30 @@
{
parent::SetCustomQuery($event);
- if ( $this->Application->isAdminUser ) {
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ if ( $this->Application->isAdmin ) {
+ $promo_block_group =& $this->Application->recallObject('promo-block-group');
+ /* @var $promo_block_group kDBItem */
+
+ $object->addFilter('promo_group_filter', '%1$s.PromoBlockGroupId = ' . $promo_block_group->GetID());
return;
}
- $object =& $event->getObject();
- /* @var $object kDBList */
+ $group_id = $event->getEventParam('group_id');
- if ( $event->Special == 'home' ) {
- $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
- $object->addFilter('scheduled_from_filter', '%1$s.ScheduleFromDate IS NULL OR %1$s.ScheduleFromDate <= ' . TIMENOW);
- $object->addFilter('scheduled_to_filter', '%1$s.ScheduleToDate IS NULL OR %1$s.ScheduleToDate >= ' . TIMENOW);
+ if ( !$group_id ) {
+ $page =& $this->Application->recallObject('st');
+ /* @var $page CategoriesItem */
+
+ $group_id = $page->GetDBField('PromoBlockGroupId');
}
+
+ $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+ $object->addFilter('scheduled_from_filter', '%1$s.ScheduleFromDate IS NULL OR %1$s.ScheduleFromDate <= ' . TIMENOW);
+ $object->addFilter('scheduled_to_filter', '%1$s.ScheduleToDate IS NULL OR %1$s.ScheduleToDate >= ' . TIMENOW);
+ $object->addFilter('promo_group_filter', $group_id ? '%1$s.PromoBlockGroupId = ' . $group_id : 'FALSE');
}
/**
@@ -293,7 +325,7 @@
'type' => 'string', 'max_len' => 255,
'formatter' => 'kUploadFormatter', 'upload_dir' => IMAGES_PATH,
'multiple' => 1, 'thumb_format' => 'resize:100x100',
- 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_Image_Files!',
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!',
'required' => 1, 'not_null' => 1, 'default' => '',
);
Index: core/units/promo_blocks/promo_block_tp.php
===================================================================
--- core/units/promo_blocks/promo_block_tp.php (revision 14917)
+++ core/units/promo_blocks/promo_block_tp.php (working copy)
@@ -55,4 +55,37 @@
return $object->GetDBField('OpenInNewWindow');
}
+
+ /**
+ * Get value from corresponding PromoGroupBlocks record
+ *
+ * @param Array $params
+ * @return bool
+ * @access protected
+ */
+ protected function GetGroupSetting(Array $params)
+ {
+ static $group_data = null;
+
+ if ( !isset($group_data) ) {
+ if ( isset($params['group_id']) && $params['group_id'] ) {
+ $group_id = $params['group_id'];
+ }
+ else {
+ $page =& $this->Application->recallObject('st');
+ /* @var $page CategoriesItem */
+
+ $group_id = $page->GetDBField('PromoBlockGroupId');
+ }
+
+ $sql = 'SELECT *
+ FROM ' . TABLE_PREFIX . 'PromoBlockGroups
+ WHERE PromoBlockGroupId = ' . (int)$group_id;
+ $group_data = $this->Conn->GetRow($sql);
+ }
+
+ $setting_name = $params['name'];
+
+ return isset($group_data[$setting_name]) ? $group_data[$setting_name] : '';
+ }
}
Index: core/units/promo_blocks/promo_blocks_config.php
===================================================================
--- core/units/promo_blocks/promo_blocks_config.php (revision 14917)
+++ core/units/promo_blocks/promo_blocks_config.php (working copy)
@@ -29,34 +29,12 @@
'edit_status_labels' => Array ('promo-block' => '!la_title_EditingPromoBlock!'),
),
- 'promo_block_list' => Array ('prefixes' => Array ('promo-block_List'), 'format' => "!la_tab_PromoBlocks! (#promo-block_recordcount#)"),
+ 'promo_block_list' => Array ('prefixes' => Array ('promo-block-group', 'promo-block_List'), 'format' => "!la_tab_PromoBlocks! - #promo-block-group_titlefield# (#promo-block_recordcount#)"),
'promo_block_edit' => Array ('prefixes' => Array ('promo-block'), 'format' => "#promo-block_status# '#promo-block_titlefield#'"),
),
- 'PermSection' => Array('main' => 'in-portal:promo_blocks'),
+ 'PermSection' => Array('main' => 'in-portal:promo_block_groups'),
- 'Sections' => Array (
- 'in-portal:promo_blocks' => Array(
- 'parent' => 'in-portal:site',
- 'icon' => 'custom',
- 'label' => 'la_tab_PromoBlocks',
- 'url' => Array('t' => 'promo_blocks/promo_block_list', 'pass' => 'm'),
- 'permissions' => Array('view', 'add', 'edit', 'delete'),
- 'priority' => 7,
- 'type' => stTREE,
- ),
-
- 'in-portal:configure_promo_blocks' => Array (
- 'parent' => 'in-portal:website_setting_folder',
- 'icon' => 'custom',
- 'label' => 'la_title_PromoBlocks',
- 'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
- 'permissions' => Array ('view', 'edit'),
- 'priority' => 3,
- 'type' => stTREE,
- ),
- ),
-
'CalculatedFields' => Array (
'' => Array (
'ConversionPercent' => 'IF(%1$s.NumberOfViews > 0, NumberOfClicks / NumberOfViews * 100, NULL)',
@@ -75,6 +53,11 @@
'Fields' => Array (
'BlockId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PromoBlockGroupId' => Array (
+ 'type' => 'int',
+ 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PromoBlockGroups ORDER BY Title', 'option_title_field' => 'Title', 'option_key_field' => 'PromoBlockGroupId',
+ 'not_null' => 1, 'required' => 1, 'default' => 0,
+ ),
'Title' => Array (
'type' => 'string', 'max_len' => 50,
'not_null' => 1, 'required' => 1, 'default' => '',
promo_block_groups_themes_v4.patch [^] (2,449 bytes) 2011-12-28 07:59
[Show Content]
Index: elements/promo.elm.tpl
===================================================================
--- elements/promo.elm.tpl (revision 14917)
+++ elements/promo.elm.tpl (working copy)
@@ -1,3 +1,5 @@
+<inp2:m_DefaultParam group_id=""/>
+
<inp2:m_DefineElement name="promo_block_element">
<li>
<a href="<inp2:PromoLink/>" class="<inp2:Field name='CSSClassName' db='db'/>" title="<inp2:Field name='Title' html_escape='1'/>"<inp2:m_if check="LinkInNewWindow"> target="_blank"</inp2:m_if>>
@@ -18,7 +20,7 @@
</script>
<ul class="slides">
- <inp2:promo-block.home_PrintList render_as="promo_block_element"/>
+ <inp2:promo-block_PrintList render_as="promo_block_element" group_id="$group_id"/>
</ul>
</div>
<div class="clear"></div>
@@ -39,10 +41,10 @@
$('#slider').flexslider(
{
- animation: '<inp2:m_GetConfig name="PromoTransitionEffect"/>',
- animationDuration: <inp2:m_GetConfig name="PromoTransitionTime"/> * 1000, // in milliseconds
- slideshowSpeed: <inp2:m_GetConfig name="PromoRotationDelay"/> * 1000, // in seconds
- controlNav: <inp2:m_GetConfig name="PromoTransitionControls"/> ? true: false,
+ animation: '<inp2:m_if check="promo-block_GetGroupSetting" name="TransitionEffect" group_id="$group_id" db="db" equals_to="-1"><inp2:promo-block_GetGroupSetting name="TransitionEffectCustom" group_id="$group_id"/><inp2:m_else/><inp2:promo-block_GetGroupSetting name="TransitionEffect" group_id="$group_id"/></inp2:m_if>',
+ animationDuration: <inp2:promo-block_GetGroupSetting name="TransitionTime" group_id="$group_id"/> * 1000, // in milliseconds
+ slideshowSpeed: <inp2:promo-block_GetGroupSetting name="RotationDelay" group_id="$group_id"/> * 1000, // in seconds
+ controlNav: <inp2:m_if check="promo-block_GetGroupSetting" name="TransitionControls" group_id="$group_id">true<inp2:m_else/>false</inp2:m_if>,
directionNav: false,
prevText: '',
nextText: '',
Index: index.tpl
===================================================================
--- index.tpl (revision 14917)
+++ index.tpl (working copy)
@@ -19,7 +19,7 @@
<!--## MAIN CONTENT ##-->
<inp2:m_DefineElement name="content">
- <inp2:m_Include template="elements/promo.elm" strip_nl="2"/>
+ <inp2:m_Include template="elements/promo.elm" group_id="1" strip_nl="2"/>
<inp2:m_Include template="elements/content_boxes/special_deals.elm" data_exists="1" strip_nl="2"/>
promo_block_group_php_syntax_fix.patch [^] (1,086 bytes) 2012-01-06 05:59
[Show Content]
Index: system_presets/simple/categories_c.php
===================================================================
--- system_presets/simple/categories_c.php (revision 14978)
+++ system_presets/simple/categories_c.php (working copy)
@@ -42,8 +42,8 @@
/*'Priority', 'MetaKeywords', 'CachedDescendantCatsQty', 'CachedNavbar',*/ 'CreatedById', /*'ResourceId',
'ParentPath', 'TreeLeft', 'TreeRight', 'NamedParentPath', 'MetaDescription', 'HotItem',*/ 'NewItem',
/*'PopItem', 'Modified', 'ModifiedById', 'CachedTemplate',*/ 'Template', /*'UseExternalUrl', 'ExternalUrl',*/
- 'UseMenuIconUrl', 'MenuIconUrl', 'Title', 'MenuTitle', /*'MetaTitle', 'IndexTools', 'IsMenu',*/'
- PromoBlockGroupId', 'Protected', 'Type', 'FormId', 'FormSubmittedTemplate', /*'FriendlyURL', 'ThemeId',
+ 'UseMenuIconUrl', 'MenuIconUrl', 'Title', 'MenuTitle', /*'MetaTitle', 'IndexTools', 'IsMenu',*/
+ 'PromoBlockGroupId', 'Protected', 'Type', 'FormId', 'FormSubmittedTemplate', /*'FriendlyURL', 'ThemeId',
'EnablePageCache', 'OverridePageCacheKey', 'PageCacheKey', 'PageExpiration'*/
);
promo_block_images_deleted_fix.patch [^] (709 bytes) 2012-01-10 08:40
[Show Content]
Index: units/promo_blocks/promo_block_eh.php
===================================================================
--- units/promo_blocks/promo_block_eh.php (revision 15024)
+++ units/promo_blocks/promo_block_eh.php (working copy)
@@ -329,7 +329,7 @@
// images multilang fields
$a_image = Array(
'type' => 'string', 'max_len' => 255,
- 'formatter' => 'kUploadFormatter', 'upload_dir' => IMAGES_PATH,
+ 'formatter' => 'kUploadFormatter', 'upload_dir' => IMAGES_PATH . 'promo_blocks/',
'multiple' => 1, 'thumb_format' => 'resize:100x100',
'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!',
'required' => 1, 'not_null' => 1, 'default' => '',
PromoBlocks-513.zip [^] (449,372 bytes) 2012-02-24 10:34 |