Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Mon, Aug 25, 11:09 AM

in-portal

Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/categories/permissions_tab.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/categories/permissions_tab.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/categories/permissions_tab.tpl (revision 7664)
@@ -0,0 +1,74 @@
+<inp2:m_if check="m_ParamEquals" name="tab_init" value="1">
+ <div id="<inp2:m_param name="item_prefix"/>_div" prefix="<inp2:m_param name="item_prefix"/>" group_id="-1" class="catalog-tab"></div>
+ <script type="text/javascript">$PermManager.registerTab('<inp2:m_param name="item_prefix"/>');</script>
+<inp2:m_else/>
+ <inp2:lang.current_Field name="Charset" result_to_var="charset"/>
+ <inp2:m_Header data="Content-type: text/plain; charset=$charset"/>
+ if ($request_visible) {
+ document.getElementById('<inp2:m_get name="item_prefix"/>_div').setAttribute('group_id', <inp2:m_get name="group_id"/>);
+ }
+ <inp2:m_if check="c_SaveWarning">
+ document.getElementById('save_warning').style.display = 'block';
+ $edit_mode = true;
+ </inp2:m_if>
+ #separator#
+ <inp2:m_DefineElement name="permission_element">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td>
+ <inp2:m_phrase name="$Description"/> [<inp2:m_param name="PermissionName"/>]
+ </td>
+
+ <td>
+ <!-- Inherited checkbox -->
+ <input
+ type="hidden"
+ id="<inp2:PermInputName sub_key="inherited"/>"
+ name="<inp2:PermInputName sub_key="inherited"/>"
+ value="<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">1<inp2:m_else/>0</inp2:m_if>" />
+
+ <input
+ type="checkbox"
+ id="_cb_<inp2:PermInputName sub_key="inherited"/>"
+ <inp2:m_if check="m_ParamEquals" name="Inherited" value="1">checked</inp2:m_if>
+ onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="inherited"/>'));"
+ onclick="inherited_click('<inp2:m_param name="PermissionName"/>', <inp2:m_param name="InheritedValue"/>, this.checked, '_cb_<inp2:PermInputName sub_key="value"/>')" />
+ </td>
+
+ <td>
+ <inp2:CategoryPath cat_id="$InheritedFrom"/>
+ </td>
+
+ <td>
+ <!-- Access checkbox -->
+ <input
+ type="hidden"
+ id="<inp2:PermInputName sub_key="value"/>"
+ name="<inp2:PermInputName sub_key="value"/>"
+ value="<inp2:m_if check="m_ParamEquals" name="Value" value="1">1<inp2:m_else/>0</inp2:m_if>" />
+
+ <input
+ type="checkbox"
+ id="_cb_<inp2:PermInputName sub_key="value"/>"
+ <inp2:m_if check="m_ParamEquals" name="Inherited" value="1">disabled="disabled"</inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="Value" value="1">checked</inp2:m_if>
+ onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="value"/>'));"
+ onclick="update_light('<inp2:m_param name="PermissionName"/>', this.checked)" />
+ </td>
+
+ <td>
+ <img id="light_<inp2:m_param name="PermissionName"/>" src="img/perm_<inp2:m_if check="m_ParamEquals" name="Value" value="1">green<inp2:m_else/>red</inp2:m_if>.gif"/>
+ </td>
+ </tr>
+ </inp2:m_DefineElement>
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder_full">
+ <inp2:m_set odd_even="table_color1"/>
+ <thead class="subsectiontitle">
+ <td><inp2:m_phrase name="la_col_Description"/></td>
+ <td><inp2:m_phrase name="la_col_Inherited"/></td>
+ <td><inp2:m_phrase name="la_col_InheritedFrom"/></td>
+ <td><inp2:m_phrase name="la_col_Access"/></td>
+ <td><inp2:m_phrase name="la_col_Effective"/></td>
+ </thead>
+ <inp2:c-perm_PrintPermissions render_as="permission_element"/>
+ </table>
+</inp2:m_if>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/categories/permissions_tab.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_edit_block.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_edit_block.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_edit_block.tpl (revision 7664)
@@ -0,0 +1,111 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+<inp2:m_include t="in-portal/stylesheets/stylesheets_tabs"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="block_styles" module="in-portal" icon="icon46_style"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('css','<inp2:css_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('css','OnCancelEdit');
+ }
+ ) );
+
+ 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('css', '<inp2:css_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('css', '<inp2:css_NextId/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ //Relations related:
+ a_toolbar.AddButton( new ToolBarButton('new_selector', '<inp2:m_phrase label="la_ToolTip_NewBlockStyle" escape="1"/>',
+ function() {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ std_new_item('selectors.block', 'in-portal/stylesheets/block_style_edit')
+ } ) );
+
+ function edit()
+ {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ std_edit_temp_item('selectors.block', 'in-portal/stylesheets/block_style_edit');
+ }
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('selectors.block')
+ } ) );
+
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ submit_event('selectors.block','OnMassClone');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ submit_event('selectors.block','OnMassResetToBase');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep4') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if prefix="css" function="IsSingle"/>
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ //a_toolbar.HideButton('sep2');
+ <inp2:m_else/>
+ <inp2:m_if prefix="css" function="IsLast"/>
+ a_toolbar.DisableButton('next');
+ <inp2:m_endif/>
+ <inp2:m_if prefix="css" function="IsFirst"/>
+ a_toolbar.DisableButton('prev');
+ <inp2:m_endif/>
+ <inp2:m_endif/>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_block name="grid_description_td" />
+ <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/></td>
+<inp2:m_blockend />
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="selectors.block" IdField="SelectorId" grid="BlockStyles" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
+<script type="text/javascript">
+ Grids['selectors.block'].SetDependantToolbarButtons( new Array('edit','delete','clone','reset_to_base') );
+</script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_edit_block.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/base_style_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/base_style_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/base_style_edit.tpl (revision 7664)
@@ -0,0 +1,103 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="base_style_edit" module="in-portal" icon="icon46_style"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('selectors','<inp2:selectors_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('selectors','OnCancel');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function ValidateRequired()
+ {
+ var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
+ '<inp2:selectors_InputName field="SelectorName"/>');
+ var $ret = true;
+ var $i = 0;
+ var $value = '';
+ while($i < $fields.length)
+ {
+ $value = document.getElementById( $fields[$i] ).value;
+ $value = $value.replace(' ','');
+ if($value.length == 0)
+ {
+ $ret = false;
+ break;
+ }
+ $i++;
+ }
+ return $ret;
+ }
+
+ function editStyle()
+ {
+ if( ValidateRequired() )
+ {
+ openSelector('selectors', '<inp2:m_t t="in-portal/stylesheets/style_editor" pass="all"/>', '', '850x460', 'OnOpenStyleEditor');
+ }
+ else
+ {
+ alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
+ }
+ }
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:selectors_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+ <inp2:m_ParseBlock name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
+ <input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="1">
+
+ <inp2:m_ParseBlock name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
+
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" valign="top">
+ <inp2:m_phrase name="la_fld_SelectorData"/>:<br>
+ <a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
+ </td>
+ <td>
+ <table width="100%">
+ <tr>
+ <td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
+ <td>
+ <inp2:selectors_PrintStyle field="SelectorData"/>
+ </td>
+ <td><inp2:m_phrase name="la_StylePreview"/>:</td>
+ <td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
+ <inp2:m_phrase name="la_SampleText"/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td class="error">&nbsp;</td>
+ </tr>
+
+</table>
+<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/base_style_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/block_style_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/block_style_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/block_style_edit.tpl (revision 7664)
@@ -0,0 +1,113 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="block_style_edit" module="in-portal" icon="icon46_style"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('selectors','<inp2:selectors_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('selectors','OnCancel');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
+ submit_event('selectors','OnResetToBase');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function ValidateRequired()
+ {
+ var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
+ '<inp2:selectors_InputName field="SelectorName"/>');
+ var $ret = true;
+ var $i = 0;
+ var $value = '';
+ while($i < $fields.length)
+ {
+ $value = document.getElementById( $fields[$i] ).value;
+ $value = $value.replace(' ','');
+ if($value.length == 0)
+ {
+ $ret = false;
+ break;
+ }
+ $i++;
+ }
+ return $ret;
+ }
+
+ function editStyle()
+ {
+ if( ValidateRequired() )
+ {
+ openSelector('selectors', '<inp2:m_t t="in-portal/stylesheets/style_editor" pass="all"/>', '', '850x460', 'OnOpenStyleEditor');
+ }
+ else
+ {
+ alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
+ }
+ }
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:selectors_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+ <inp2:m_ParseBlock name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
+ <input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="2">
+
+ <inp2:m_ParseBlock name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
+
+ <inp2:m_ParseBlock name="inp_edit_options" prefix="selectors" field="ParentId" title="!la_fld_SelectorBase!"/>
+
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
+
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" valign="top">
+ <inp2:m_phrase name="la_fld_SelectorData"/>:<br>
+ <a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
+ </td>
+ <td>
+ <table width="100%">
+ <tr>
+ <td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
+ <td>
+ <inp2:selectors_PrintStyle field="SelectorData"/>
+ </td>
+ <td><inp2:m_phrase name="la_StylePreview"/>:</td>
+ <td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
+ <inp2:m_phrase name="la_SampleText"/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td class="error">&nbsp;</td>
+ </tr>
+
+</table>
+<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/block_style_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/modules/modules_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/modules/modules_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/modules/modules_config.php (revision 7664)
@@ -0,0 +1,121 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'mod',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ModulesEventHandler','file'=>'modules_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ModulesTagProcessor','file'=>'modules_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'Name',
+ 'TitleField' => 'Name', // field, used in bluebar when editing existing item
+ 'StatusField' => Array('Loaded'),
+
+ 'TitlePresets' => Array(
+ 'modules_list' => Array( 'prefixes' => Array('mod_List'), 'format' => "!la_title_Configuration! - !la_title_Module_Status! (#mod_recordcount#)"),
+
+ 'tree_modules' => Array('format' => '!la_section_overview!'),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:mod_status'),
+
+ 'Sections' => Array(
+ // "Configuration" -> "Modules and Settings"
+ 'in-portal:modules' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'modules',
+ 'label' => 'la_tab_ModulesManagement',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:mod_status' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_title_Module_Status',
+ 'url' => Array('t' => 'modules/modules_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit', 'advanced:approve', 'advanced:decline'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:addmodule' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_title_Add_Module',
+ 'url' => Array('index_file' => 'modules/addmodule.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:tag_library' => Array(
+ 'parent' => 'in-portal:modules',
+ 'icon' => 'modules',
+ 'label' => 'la_tab_TagLibrary',
+ 'url' => Array('index_file' => 'tag_listing.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Modules',
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('enabled', 'disabled'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'enabled' => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Loaded != 1'),
+ 'disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Loaded != 0'),
+ )
+ ),
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('LoadOrder' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array(
+ 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Loaded' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => '1','default' => '1'),
+ 'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'BuildDate' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => ''),
+ ),
+
+ 'VirtualFields' => Array(),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default' => 'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'Name' => Array('title' => 'la_col_Name', 'data_block' => 'grid_checkbox_td_no_icon'),
+ 'Loaded' => Array('title' => 'la_col_Status'),
+ 'Version' => Array('title' => 'la_col_Version'),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/modules/modules_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/search_helper.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/search_helper.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/search_helper.php (revision 7664)
@@ -0,0 +1,518 @@
+<?php
+
+ class kSearchHelper extends kHelper {
+
+
+ /**
+ * Splits search phrase into keyword using quotes,plus and minus sings and spaces as split criteria
+ *
+ * @param string $keyword
+ * @return string
+ */
+ function splitKeyword($keyword)
+ {
+ $quotes_re = '/([+\-]?)"(.*?)"/';
+ $no_quotes_re = '/([+\-]?)([^ ]+)/';
+
+ $quoted_kw = preg_match_all($quotes_re, $keyword, $res);
+ foreach ($res[2] as $index => $kw) $final[$kw] = $res[1][$index];
+ $keyword = preg_replace($quotes_re, '', $keyword);
+ $not_quoted_kw = preg_match_all($no_quotes_re, $keyword, $res);
+ foreach ($res[2] as $index => $kw) $final[$kw] = $res[1][$index];
+
+ return $final;
+ }
+
+ function getPositiveKeywords($keyword)
+ {
+ $keywords = $this->splitKeyword($keyword);
+
+ $ret = Array();
+ foreach ($keywords as $keyword => $sign) {
+ if ($sign == '+' || $sign == '') {
+ $ret[] = $keyword;
+ }
+ }
+ return $ret;
+ }
+
+ function buildWhereClause($keyword, $fields)
+ {
+ $keywords = $this->splitKeyword($keyword);
+
+ $normal_conditions = Array();
+ $plus_conditions = Array();
+ $minus_conditions = Array();
+
+ foreach ($keywords as $keyword => $sign) {
+ switch ($sign) {
+ case '+':
+ $plus_conditions[] = implode(' LIKE "%'.$keyword.'%" OR ', $fields).' LIKE "%'.$keyword.'%"';
+ break;
+
+ case '-':
+ foreach ($fields as $field) {
+ $condition[] = $field.' NOT LIKE "%'.$keyword.'%" OR '.$field.' IS NULL';
+ }
+ $minus_conditions[] = '('.implode(') AND (', $condition).')';
+ break;
+
+ case '':
+ $keyword = str_replace('"', '\"', $keyword);
+ $normal_conditions[] = implode(' LIKE "%'.$keyword.'%" OR ', $fields).' LIKE "%'.$keyword.'%"';
+ break;
+ }
+ }
+
+ // building where clause
+ if ($normal_conditions) {
+ $where_clause = '('.implode(') OR (', $normal_conditions).')';
+ }
+ else {
+ $where_clause = '1';
+ }
+
+ if ($plus_conditions) {
+ $where_clause = '('.$where_clause.') AND ('.implode(') AND (', $plus_conditions).')';
+ }
+
+ if ($minus_conditions) {
+ $where_clause = '('.$where_clause.') AND ('.implode(') AND (', $minus_conditions).')';
+ }
+
+ return $where_clause;
+ }
+
+ /**
+ * Returns additional information about search field
+ *
+ * @param kDBList $object
+ * @param string $field_name
+ * @return Array
+ */
+ function getFieldInformation(&$object, $field_name)
+ {
+ $sql_filter_type = isset($object->VirtualFields[$field_name]) ? 'having' : 'where';
+ $field_type = isset($object->Fields[$field_name]['type']) ? $object->Fields[$field_name]['type'] : 'string';
+
+ if (preg_match('/(.*)\.(.*)/', $field_name, $regs)) {
+ $table_name = '`'.$regs[1].'`.'; // field from external table
+ $field_name = $regs[2];
+ }
+ elseif ($sql_filter_type == 'where') {
+ $table_name = '`'.$object->TableName.'`.'; // field from local table
+ }
+
+ $table_name = ($sql_filter_type == 'where') ? $table_name : '';
+
+ // replace wid inside table name to WID_MARK constant value
+ $is_temp_table = preg_match('/(.*)'.TABLE_PREFIX.'ses_'.$this->Application->GetSID().'(_[\d]+){0,1}_edit_(.*)/', $table_name, $regs);
+ if ($is_temp_table) {
+ $table_name = $regs[1].TABLE_PREFIX.'ses_'.EDIT_MARK.'_edit_'.$regs[3]; // edit_mark will be replaced with sid[_main_wid] in AddFilters
+ }
+
+ return Array ('field_name' => $field_name, 'field_type' => $field_type, 'table_name' => $table_name, 'sql_filter_type' => $sql_filter_type);
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function performSearch(&$event)
+ {
+ $object =& $event->getObject();
+
+ // process search keyword
+ $search_keyword = $this->Application->GetVar( $event->getPrefixSpecial(true).'_search_keyword');
+ $this->Application->StoreVar( $event->getPrefixSpecial().'_search_keyword', $search_keyword);
+ $search_keyword = str_replace('*', '%', $search_keyword);
+
+ $custom_filter = $this->processCustomFilters($event);
+
+ if(!$search_keyword && $custom_filter === false) {
+ $this->resetSearch($event);
+ return true;
+ }
+
+ if ($search_keyword) {
+ $this->processAutomaticFilters($event, $search_keyword, $custom_filter);
+ }
+ }
+
+
+ function processAutomaticFilters(&$event, $search_keyword, $custom_filter)
+ {
+ $grid_name = $this->Application->GetVar('grid_name');
+ $grids = $this->Application->getUnitOption($event->Prefix, 'Grids');
+ $search_fields = array_keys($grids[$grid_name]['Fields']);
+
+ $search_filter = Array();
+ $object =& $event->getObject();
+
+ foreach ($search_fields as $search_field) {
+ $custom_search = isset($custom_filter[$search_field]);
+
+ $filter_data = $this->getSearchClause($object, $search_field, $search_keyword, $custom_search);
+
+ if ($filter_data) {
+ $search_filter[$search_field] = $filter_data;
+ }
+ else {
+ unset($search_filter[$search_field]);
+ }
+ }
+ $this->Application->StoreVar($event->getPrefixSpecial().'_search_filter', serialize($search_filter) );
+ }
+
+ /**
+ * Returns search clause for any particular field
+ *
+ * @param kDBList $object
+ * @param string $search_field
+ * @param string $search_keyword what we are searching (false, when building custom filter clause)
+ * @param string $custom_search already found using custom filter
+ * @return Array
+ */
+ function getSearchClause(&$object, $field_name, $search_keyword, $custom_search)
+ {
+ $search_keywords = $this->splitKeyword($search_keyword);
+
+ extract( $this->getFieldInformation($object, $field_name) ); // see getFieldInformation for more details
+
+ $filter_value = '';
+
+ // get field clause by formatter name and/or parameters
+ $formatter = getArrayValue($object->Fields[$field_name], 'formatter');
+ switch ($formatter) {
+ case 'kOptionsFormatter':
+ $search_keys = Array();
+
+ if ($custom_search === false) {
+ // if keywords passed through simple search filter (on each grid)
+ $use_phrases = getArrayValue($object->Fields[$field_name], 'use_phrases');
+ $field_options = $object->GetFieldOptions($field_name);
+ foreach ($field_options['options'] as $key => $val) {
+ foreach ($search_keywords as $keyword => $sign) {
+ $pattern = '#'.$keyword.'#i';
+ if (!preg_match($pattern, $use_phrases ? $this->Application->Phrase($val) : $val)) {
+ if ($sign == '+') {
+ $filter_value = $table_name.'`'.$field_name.'` = NULL';
+ break;
+ }
+ else {
+ continue;
+ }
+ }
+
+ if ($sign == '+' || $sign == '') {
+ $search_keys[$key] = $this->Conn->qstr($key);
+ }
+ elseif($sign == '-') {
+ // if same value if found as exclusive too, then remove from search result
+ unset($search_keys[$key]);
+ }
+ }
+ }
+ }
+
+ if ($search_keys) {
+ $filter_value = $table_name.'`'.$field_name.'` IN ('.implode(',', $search_keys).')';
+ }
+
+ $field_processed = true;
+ break;
+
+ case 'kDateFormatter':
+ // if date is searched using direct filter, then do nothing here, otherwise search using LIKE clause
+ $field_processed = ($custom_search !== false) ? true : false;
+ break;
+
+ default:
+ $field_processed = false;
+ break;
+ }
+
+ // if not already processed by formatter, then get clause by field type
+ if (!$field_processed && $search_keywords) {
+ switch($field_type)
+ {
+ case 'int':
+ case 'integer':
+ case 'numeric':
+ $search_keys = Array();
+ foreach ($search_keywords as $keyword => $sign) {
+ if (!is_numeric($keyword) || ($sign == '-')) continue;
+ $search_keys[] = $this->Conn->qstr($keyword);
+ }
+
+ if ($search_keys) {
+ $filter_value = $table_name.'`'.$field_name.'` IN ('.implode(',', $search_keys).')';
+ }
+ break;
+
+ case 'double':
+ case 'float':
+ case 'real':
+ $search_keys = Array();
+ foreach ($search_keywords as $keyword => $sign) {
+ $keyword = str_replace(',', '.', $keyword);
+ if (!is_numeric($keyword) || ($sign == '-')) continue;
+ $search_keys[] = 'ABS('.$table_name.'`'.$field_name.'` - '.$this->Conn->qstr($keyword).') <= 0.0001';
+ }
+
+ if ($search_keys) {
+ $filter_value = '('.implode(') OR (', $search_keys).')';
+ }
+ break;
+
+ case 'string':
+ $filter_value = $this->buildWhereClause($search_keyword, Array($table_name.'`'.$field_name.'`'));
+ break;
+ }
+ }
+
+ if ($filter_value) {
+ return Array('type' => $sql_filter_type, 'value' => $filter_value);
+ }
+
+ return false;
+ }
+
+ /**
+ * Processes custom filters from submit
+ *
+ * @param KEvent $event
+ * @return bool
+ */
+ function processCustomFilters(&$event)
+ {
+ $grid_name = $this->Application->GetVar('grid_name');
+
+ // update "custom filter" with values from submit: begin
+ $view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
+ $custom_filters = $this->Application->RecallPersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name);
+ if ($custom_filters) {
+ $custom_filters = unserialize($custom_filters);
+ $custom_filter = isset($custom_filters[$grid_name]) ? $custom_filters[$grid_name] : Array ();
+ }
+ else {
+ $custom_filter = Array ();
+ }
+
+ // submit format custom_filters[prefix_special][field]
+ $submit_filters = $this->Application->GetVar('custom_filters');
+ if ($submit_filters) {
+ $submit_filters = getArrayValue($submit_filters, $event->getPrefixSpecial(), $grid_name);
+ if ($submit_filters) {
+ foreach ($submit_filters as $field_name => $field_options) {
+ list ($filter_type, $field_value) = each($field_options);
+ $is_empty = strlen(is_array($field_value) ? implode('', $field_value) : $field_value) == 0;
+ if ($is_empty) {
+ if (isset($custom_filter[$field_name])) {
+ // use isset, because non-existing key will cause "php notice"!
+ unset($custom_filter[$field_name][$filter_type]); // remove filter
+
+ if (!$custom_filter[$field_name]) {
+ // if no filters left for field, then delete record at all
+ unset($custom_filter[$field_name]);
+ }
+ }
+ }
+ else {
+ $custom_filter[$field_name][$filter_type]['submit_value'] = $field_value;
+ }
+ }
+ }
+ }
+
+ if ($custom_filter) {
+ $custom_filters[$grid_name] = $custom_filter;
+ }
+ else {
+ unset($custom_filters[$grid_name]);
+ }
+ // update "custom filter" with values from submit: end
+
+ if (!$custom_filter) {
+ // in case when no filters specified, there are nothing to process
+ $this->Application->StorePersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name, serialize($custom_filters) );
+ return false;
+ }
+
+ $object =& $event->getObject(); // don't recall it each time in getCustomFilterSearchClause
+ $grid_info = $this->Application->getUnitOption($event->Prefix.'.'.$grid_name, 'Grids');
+ foreach ($custom_filter as $field_name => $field_options) {
+ list ($filter_type, $field_options) = each($field_options);
+ $field_options['grid_options'] = $grid_info['Fields'][$field_name];
+ $field_options = $this->getCustomFilterSearchClause($object, $field_name, $filter_type, $field_options);
+ if ($field_options['value']) {
+ unset($field_options['grid_options']);
+ $custom_filter[$field_name][$filter_type] = $field_options;
+ }
+ }
+
+ $custom_filters[$grid_name] = $custom_filter;
+ $this->Application->StorePersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name, serialize($custom_filters) );
+ return $custom_filter;
+ }
+
+ /**
+ * Return numeric range filter value + checking that it's number
+ *
+ * @param Array $value array containing range filter value
+ * @return unknown
+ */
+ function getRangeValue($value)
+ {
+ return strlen($value) && is_numeric($value) ? $this->Conn->qstr($value) : false;
+ }
+
+ function getCustomFilterSearchClause(&$object, $field_name, $filter_type, $field_options)
+ {
+ if ($filter_type == 'date_range') {
+ // use timestamp field, not formatted one
+ $field_name = $field_options['grid_options']['sort_field'];
+ }
+
+ extract( $this->getFieldInformation($object, $field_name) ); // see getFieldInformation for more details
+
+ $filter_value = '';
+
+ switch ($filter_type) {
+ case 'range':
+ $from = $this->getRangeValue($field_options['submit_value']['from']);
+ $to = $this->getRangeValue($field_options['submit_value']['to']);
+
+ if ($from !== false && $to !== false) {
+ // add range filter
+ $filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to;
+ }
+ elseif ($from !== false) {
+ // add equals filter on $from
+ $filter_value = $table_name.'`'.$field_name.'` = '.$from;
+ }
+ elseif ($to !== false) {
+ // add equals filter on $to
+ $filter_value = $table_name.'`'.$field_name.'` = '.$to;
+ }
+ break;
+
+ case 'float_range':
+ // MySQL can't compare values in "float" type columns using "=" operator
+ $from = $this->getRangeValue($field_options['submit_value']['from']);
+ $to = $this->getRangeValue($field_options['submit_value']['to']);
+
+ if ($from !== false && $to !== false) {
+ // add range filter
+ $filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to;
+ }
+ elseif ($from !== false) {
+ // add equals filter on $from
+ $filter_value = 'ABS('.$table_name.'`'.$field_name.'` - '.$from.') <= 0.0001';
+ }
+ elseif ($to !== false) {
+ // add equals filter on $to
+ $filter_value = 'ABS('.$table_name.'`'.$field_name.'` - '.$to.') <= 0.0001';
+ }
+ break;
+
+ case 'date_range':
+ $from = $this->processRangeField($object, $field_name, $field_options['submit_value'], 'from');
+ $to = $this->processRangeField($object, $field_name, $field_options['submit_value'], 'to');
+
+ $day_seconds = 23 * 60 * 60 + 59 * 60 + 59;
+ if ($from !== false && $to === false) {
+ $from = strtotime(date('Y-m-d', $from).' 00:00:00', $from); // reset to morning
+ $to = $from + $day_seconds;
+ }
+ elseif ($from === false && $to !== false) {
+ $to = strtotime(date('Y-m-d', $to).' 23:59:59', $to); // reset to evening
+ $from = $to - $day_seconds;
+ }
+
+ if ($from !== false && $to !== false) {
+ $filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to;
+ }
+ break;
+
+ case 'equals':
+ case 'options':
+ $field_value = strlen($field_options['submit_value']) ? $this->Conn->qstr($field_options['submit_value']) : false;
+ if ($field_value) {
+ $filter_value = $table_name.'`'.$field_name.'` = '.$field_value;
+ }
+ break;
+
+ case 'like':
+ $filter_value = $this->buildWhereClause($field_options['submit_value'], Array($table_name.'`'.$field_name.'`'));
+ break;
+
+ default:
+ break;
+ }
+
+ $field_options['sql_filter_type'] = $sql_filter_type;
+ $field_options['value'] = $filter_value;
+
+ return $field_options;
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kdbItem $object
+ * @param string $search_field
+ * @param string $value
+ * @param string $type
+ */
+ function processRangeField(&$object, $search_field, $value, $type)
+ {
+ if (!strlen($value[$type])) {
+ return false;
+ }
+
+ $lang_current =& $this->Application->recallObject('lang.current');
+ $options = $object->GetFieldOptions($search_field);
+ $dt_separator = isset($options['date_time_separator']) ? $options['date_time_separator'] : ' ';
+
+ $tmp_value = explode($dt_separator, $value[$type], 2);
+ if (count($tmp_value) == 1) {
+ // time is missing, then guess it and add to date
+ $time = ($type == 'from') ? adodb_mktime(0, 0, 0) : adodb_mktime(23, 59, 59);
+ $time = adodb_date($lang_current->GetDBField('InputTimeFormat'), $time);
+ $value[$type] .= $dt_separator.$time;
+ }
+
+ $formatter =& $this->Application->recallObject($object->Fields[$search_field]['formatter']);
+
+ $value_ts = $formatter->Parse($value[$type], $search_field, $object);
+ $pseudo = getArrayValue($object->FieldErrors, $search_field, 'pseudo');
+ if ($pseudo) {
+ unset($object->FieldErrors[$search_field]); // remove error!
+ // invalid format -> ignore this date in search
+ return false;
+ }
+ return $value_ts;
+ }
+
+ /**
+ * Resets current search
+ *
+ * @param kEvent $event
+ */
+ function resetSearch(&$event)
+ {
+ $this->Application->RemoveVar($event->getPrefixSpecial().'_search_filter');
+ $this->Application->RemoveVar($event->getPrefixSpecial().'_search_keyword');
+
+ $view_name = $this->Application->RecallVar($event->getPrefixSpecial().'_current_view');
+ $this->Application->RemovePersistentVar($event->getPrefixSpecial().'_custom_filter.'.$view_name);
+ }
+
+
+
+
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/search_helper.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/modules.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/modules.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/modules.php (revision 7664)
@@ -0,0 +1,370 @@
+<?php
+
+ class kModulesHelper extends kHelper {
+
+ function checkLogin()
+ {
+ return $this->_GetModules();
+ }
+
+ function getWhereClause()
+ {
+ $where_clause = Array('Loaded = 1');
+
+ if (!$this->Application->IsAdmin()) return implode(' AND ', $where_clause);
+
+ $modules = $this->_GetModules();
+ if ($modules) {
+ foreach ($modules as $module_index => $module) {
+ $modules[$module_index] = $this->Conn->qstr($module);
+ }
+ $where_clause[] = 'Name IN ('.implode(',', $modules).')';
+ }
+
+ return implode(' AND ', $where_clause);
+ }
+
+ function _EnableCookieSID()
+ {
+ $session =& $this->Application->recallObject('Session');
+ return $session->CookiesEnabled;
+ }
+
+ function _IsSpider($UserAgent)
+ {
+ global $robots;
+ $lines = file(FULL_PATH.'/robots_list.txt');
+
+ if (!is_array($robots)) {
+ $robots = Array();
+ for($i = 0; $i < count($lines); $i++) {
+ $l = $lines[$i];
+ $p = explode("\t", $l, 3);
+ $robots[] = $p[2];
+ }
+ }
+ return in_array($UserAgent, $robots);
+ }
+
+ function _MatchIp($ip1, $ip2)
+ {
+ $matched = TRUE;
+
+ $ip = explode('.', $ip1);
+ $MatchIp = explode('.', $ip2);
+ for ($i = 0; $i < count($ip); $i++) {
+ if($i == count($MatchIp)) break;
+ if (trim($ip[$i]) != trim($MatchIp[$i]) || trim($ip[$i]) == '*') {
+ $matched = FALSE;
+ break;
+ }
+ }
+ return $matched;
+ }
+
+ function _IpAccess($IpAddress, $AllowList, $DenyList)
+ {
+ $allowed = explode(',', $AllowList);
+ $denied = explode(',', $DenyList);
+
+ $MatchAllowed = FALSE;
+ for ($x = 0; $x < count($allowed); $x++) {
+ $ip = explode('.', $allowed[$x]);
+
+ $MatchAllowed = $this->_MatchIp($IpAddress, $allowed[$x]);
+ if ($MatchAllowed)
+ break;
+ }
+ $MatchDenied = FALSE;
+ for ($x = 0; $x < count($denied); $x++) {
+ $ip = explode('.', $denied[$x]);
+
+ $MatchDenied = $this->_MatchIp($IpAddress, $denied[$x]);
+ if ($MatchDenied)
+ break;
+ }
+
+ $Result = (($MatchAllowed && !$MatchDenied) || (!$MatchAllowed && !$MatchDenied) ||
+ ($MatchAllowed && $MatchDenied));
+ return $Result;
+ }
+
+ /**
+ * Reads config.php file and parses it
+ *
+ */
+ function _readConfig()
+ {
+ $vars = parse_portal_ini(FULL_PATH.'/config.php');
+
+ foreach ($vars as $config_key => $config_value) {
+ $GLOBALS['g_'.$config_key] = $config_value;
+ }
+ }
+
+ /**
+ * Leaves only domain part from hostname (e.g. extract "intechnic.lv" from "test.intechnic.lv")
+ * Used for admin login license check
+ *
+ * @param string $d
+ * @return string
+ */
+ function _StripDomainHost($d)
+ {
+ $IsIp = false;
+ $dotcount = substr_count($d, '.');
+ if ($dotcount == 3) {
+ $IsIp = true;
+ for ($x = 0; $x < strlen($d); $x++) {
+ if (!is_numeric(substr($d, $x, 1)) && substr($d, $x, 1) != '.')
+ {
+ $IsIp = false;
+ break;
+ }
+ }
+ }
+
+ if ($dotcount > 1 && !$IsIp) {
+ $p = explode('.', $d);
+ $ret = $p[count($p) - 2].'.'.$p[count($p) - 1];
+ }
+ else {
+ $ret = $d;
+ }
+ return $ret;
+ }
+
+ /**
+ * When logging into admin then check only last 2 parts of host name VS domain in license
+ *
+ * @param string $user_domain
+ * @param string $license_domain
+ * @return int
+ */
+ function _CheckDomain($user_domain, $license_domain)
+ {
+ if ($this->Application->IsAdmin()) {
+ $user_domain = $this->_StripDomainHost($user_domain);
+ return preg_match('/(.*)'.preg_quote($user_domain, '/').'$/', $license_domain);
+ }
+ else {
+ return preg_match('/(.*)'.preg_quote($license_domain, '/').'$/', $user_domain);
+ }
+ }
+
+ /**
+ * Returns modules list, that are in license
+ *
+ * @return Array
+ */
+ function _GetModules()
+ {
+ global $i_Keys;
+ static $modules = null;
+
+ if (isset($modules)) return $modules;
+
+ $this->_readConfig();
+ $license = base64_decode($GLOBALS['g_License']);
+ $this->_ParseLicense($license);
+
+ $modules = Array();
+ $domain = $this->_GetDomain();
+ if (!$this->_IsLocalSite($domain)) {
+ for ($x = 0; $x < count($i_Keys); $x++) {
+ $key = $i_Keys[$x];
+ if ($this->_CheckDomain($domain, $key['domain'])) {
+ // used hostname is subdomain or matches domain from license
+ $modules = explode(',', $key['mod']);
+ }
+ }
+ }
+ else {
+ $modules = array_keys($this->Application->ModuleInfo);
+ }
+ array_push($modules, 'Core', 'Proj-base', 'Proj-CMS', 'Custom');
+ return $modules;
+ }
+
+ /**
+ * Allows to determine if module is licensed
+ *
+ * @param string $name
+ * @return bool
+ */
+ function _ModuleLicensed($name)
+ {
+ $modules = $this->_GetModules();
+ return in_array($name, $modules);
+ }
+
+ /**
+ * Returns domain from licences (and direct in case of install script)
+ *
+ * @return string
+ */
+ function _GetDomain()
+ {
+ return $this->Application->ConfigValue('DomainDetect') ? $_SERVER['HTTP_HOST'] : $GLOBALS['g_Domain'];
+ }
+
+ function _keyED($txt, $encrypt_key)
+ {
+ $encrypt_key = md5($encrypt_key);
+ $ctr = 0;
+ $tmp = '';
+ for ($i = 0; $i < strlen($txt); $i++) {
+ if ($ctr == strlen($encrypt_key)) $ctr = 0;
+ $tmp .= substr($txt, $i, 1) ^ substr($encrypt_key, $ctr, 1);
+ $ctr++;
+ }
+ return $tmp;
+ }
+
+
+ function _decrypt($txt, $key)
+ {
+ $txt = $this->_keyED($txt,$key);
+ $tmp = '';
+ for ($i = 0; $i < strlen($txt); $i++) {
+ $md5 = substr($txt, $i, 1);
+ $i++;
+ $tmp .= (substr($txt, $i, 1) ^ $md5);
+ }
+ return $tmp;
+ }
+
+ function LoadFromRemote()
+ {
+ return '';
+ }
+
+ function DLid()
+ {
+ die($GLOBALS['lid']."\n");
+ }
+
+ function _LoadLicense($LoadRemote = false)
+ {
+ $f = FULL_PATH.'/intechnic.php';
+ if ($this->_falseIsLocalSite($f)) $ret = true;
+ if (file_exists($f)) {
+ $contents = file($f);
+ $data = base64_decode($contents[1]);
+ }
+ else {
+ if ($LoadRemote) return $LoadFromRemote;
+ }
+ return $data;
+ }
+
+ function _VerifyKey($domain, $k)
+ {
+ $key = md5($domain);
+ $lkey = substr($key, 0, strlen($key) / 2);
+ $rkey = substr($key, strlen($key) / 2);
+ $r = $rkey.$lkey;
+ if ($k == $r) return true;
+ return false;
+ }
+
+ function _ParseLicense($txt)
+ {
+ global $i_User, $i_Pswd, $i_Keys;
+ if (!$this->_falseIsLocalSite($txt)) $nah = false;
+ $data = $this->_decrypt($txt, 'beagle');
+ $i_Keys = Array();
+ $lines = explode("\n", $data);
+ for ($x = 0; $x < count($lines); $x++) {
+ $l = $lines[$x];
+ $p = explode('=', $l, 2);
+ switch($p[0]) {
+ case 'Username':
+ $i_User = $p[1];
+ break;
+
+ case 'UserPass':
+ $i_Pswd = $p[1];
+ break;
+
+ default:
+ if (substr($p[0], 0, 3) == 'key') {
+ $parts = explode('|', $p[1]);
+ if ($this->_VerifyKey($parts[0], $parts[1])) {
+ unset($K);
+ $k['domain'] = $parts[0];
+ $k['key'] = $parts[1];
+ $k['desc'] = $parts[2];
+ $k['mod'] = $parts[3];
+ $i_Keys[] = $k;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ function _GetObscureValue($i)
+ {
+ if ($i == 'x') return 0254; $z = '';
+ if ($i == 'z') return 0x7F.'.';
+ if ($i == 'c') return '--code--';
+ if ($i >= 5 && $i < 7) return $this->_GetObscureValue($z)*$this->_GetObscureValue('e');
+ if ($i > 30) return Array(0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74);
+ if ($i > 20) return 99;
+ if ($i > 10) return '.'.($this->_GetObscureValue(6.5)+1);
+ if ($i == 'a') return 0xa;
+ }
+
+ function _Chr($val)
+ {
+ $x = $this->_GetObscureValue(25);
+ $f = chr($x).chr($x+5).chr($x+15);
+ return $f($val);
+ }
+
+ function _IsLocalSite($domain)
+ {
+ $ee = $this->_GetObscureValue(35); $yy = '';
+ foreach ($ee as $e) $yy .= $this->_Chr($e);
+ $localb = FALSE;
+ if(substr($domain,0,3)==$this->_GetObscureValue('x'))
+ {
+ $b = substr($domain,0,6);
+ $p = explode(".",$domain);
+ $subnet = $p[1];
+ if($p[1]>15 && $p[1]<32)
+ $localb=TRUE;
+ }
+ $zz = $this->_GetObscureValue('z').$this->_GetObscureValue(5).'.'.(int)$this->_GetObscureValue(7).$this->_GetObscureValue(12);
+ $ff = $this->_GetObscureValue('z')+65;
+ $hh = $ff-0x18;
+ if($domain==$yy || $domain==$zz || substr($domain,0,7)==$ff.$this->_Chr(46).$hh ||
+ substr($domain,0,3)==$this->_GetObscureValue('a').$this->_Chr(46) || $localb || strpos($domain,".")==0)
+ {
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ function _falseIsLocalSite($domain)
+ {
+ $localb = FALSE;
+ if(substr($domain,0,3)=="172")
+ {
+ $b = substr($domain,0,6);
+ $p = explode(".",$domain);
+ $subnet = $p[1];
+ if($p[1]>15 && $p[1]<32)
+ $localb=TRUE;
+ }
+ if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" ||
+ substr($domain,0,3)=="10." || $localb || strpos($domain,".")==0)
+ {
+ return TRUE;
+ }
+ return FALSE;
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/modules.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/categories/permissions_tab.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/admin_templates/categories/permissions_tab.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/admin_templates/categories/permissions_tab.tpl (revision 7664)
@@ -0,0 +1,74 @@
+<inp2:m_if check="m_ParamEquals" name="tab_init" value="1">
+ <div id="<inp2:m_param name="item_prefix"/>_div" prefix="<inp2:m_param name="item_prefix"/>" group_id="-1" class="catalog-tab"></div>
+ <script type="text/javascript">$PermManager.registerTab('<inp2:m_param name="item_prefix"/>');</script>
+<inp2:m_else/>
+ <inp2:lang.current_Field name="Charset" result_to_var="charset"/>
+ <inp2:m_Header data="Content-type: text/plain; charset=$charset"/>
+ if ($request_visible) {
+ document.getElementById('<inp2:m_get name="item_prefix"/>_div').setAttribute('group_id', <inp2:m_get name="group_id"/>);
+ }
+ <inp2:m_if check="c_SaveWarning">
+ document.getElementById('save_warning').style.display = 'block';
+ $edit_mode = true;
+ </inp2:m_if>
+ #separator#
+ <inp2:m_DefineElement name="permission_element">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <td>
+ <inp2:m_phrase name="$Description"/> [<inp2:m_param name="PermissionName"/>]
+ </td>
+
+ <td>
+ <!-- Inherited checkbox -->
+ <input
+ type="hidden"
+ id="<inp2:PermInputName sub_key="inherited"/>"
+ name="<inp2:PermInputName sub_key="inherited"/>"
+ value="<inp2:m_if check="m_ParamEquals" name="Inherited" value="1">1<inp2:m_else/>0</inp2:m_if>" />
+
+ <input
+ type="checkbox"
+ id="_cb_<inp2:PermInputName sub_key="inherited"/>"
+ <inp2:m_if check="m_ParamEquals" name="Inherited" value="1">checked</inp2:m_if>
+ onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="inherited"/>'));"
+ onclick="inherited_click('<inp2:m_param name="PermissionName"/>', <inp2:m_param name="InheritedValue"/>, this.checked, '_cb_<inp2:PermInputName sub_key="value"/>')" />
+ </td>
+
+ <td>
+ <inp2:CategoryPath cat_id="$InheritedFrom"/>
+ </td>
+
+ <td>
+ <!-- Access checkbox -->
+ <input
+ type="hidden"
+ id="<inp2:PermInputName sub_key="value"/>"
+ name="<inp2:PermInputName sub_key="value"/>"
+ value="<inp2:m_if check="m_ParamEquals" name="Value" value="1">1<inp2:m_else/>0</inp2:m_if>" />
+
+ <input
+ type="checkbox"
+ id="_cb_<inp2:PermInputName sub_key="value"/>"
+ <inp2:m_if check="m_ParamEquals" name="Inherited" value="1">disabled="disabled"</inp2:m_if>
+ <inp2:m_if check="m_ParamEquals" name="Value" value="1">checked</inp2:m_if>
+ onchange="update_checkbox(this, document.getElementById('<inp2:PermInputName sub_key="value"/>'));"
+ onclick="update_light('<inp2:m_param name="PermissionName"/>', this.checked)" />
+ </td>
+
+ <td>
+ <img id="light_<inp2:m_param name="PermissionName"/>" src="img/perm_<inp2:m_if check="m_ParamEquals" name="Value" value="1">green<inp2:m_else/>red</inp2:m_if>.gif"/>
+ </td>
+ </tr>
+ </inp2:m_DefineElement>
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder_full">
+ <inp2:m_set odd_even="table_color1"/>
+ <thead class="subsectiontitle">
+ <td><inp2:m_phrase name="la_col_Description"/></td>
+ <td><inp2:m_phrase name="la_col_Inherited"/></td>
+ <td><inp2:m_phrase name="la_col_InheritedFrom"/></td>
+ <td><inp2:m_phrase name="la_col_Access"/></td>
+ <td><inp2:m_phrase name="la_col_Effective"/></td>
+ </thead>
+ <inp2:c-perm_PrintPermissions render_as="permission_element"/>
+ </table>
+</inp2:m_if>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/categories/permissions_tab.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_edit_block.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (revision 7664)
@@ -0,0 +1,111 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+<inp2:m_include t="in-portal/stylesheets/stylesheets_tabs"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="block_styles" module="in-portal" icon="icon46_style"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('css','<inp2:css_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('css','OnCancelEdit');
+ }
+ ) );
+
+ 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('css', '<inp2:css_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('css', '<inp2:css_NextId/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ //Relations related:
+ a_toolbar.AddButton( new ToolBarButton('new_selector', '<inp2:m_phrase label="la_ToolTip_NewBlockStyle" escape="1"/>',
+ function() {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ std_new_item('selectors.block', 'in-portal/stylesheets/block_style_edit')
+ } ) );
+
+ function edit()
+ {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ std_edit_temp_item('selectors.block', 'in-portal/stylesheets/block_style_edit');
+ }
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ std_delete_items('selectors.block')
+ } ) );
+
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ submit_event('selectors.block','OnMassClone');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ submit_event('selectors.block','OnMassResetToBase');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep4') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if prefix="css" function="IsSingle"/>
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ //a_toolbar.HideButton('sep2');
+ <inp2:m_else/>
+ <inp2:m_if prefix="css" function="IsLast"/>
+ a_toolbar.DisableButton('next');
+ <inp2:m_endif/>
+ <inp2:m_if prefix="css" function="IsFirst"/>
+ a_toolbar.DisableButton('prev');
+ <inp2:m_endif/>
+ <inp2:m_endif/>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_block name="grid_description_td" />
+ <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/></td>
+<inp2:m_blockend />
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="selectors.block" IdField="SelectorId" grid="BlockStyles" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
+<script type="text/javascript">
+ Grids['selectors.block'].SetDependantToolbarButtons( new Array('edit','delete','clone','reset_to_base') );
+</script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_edit_block.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/base_style_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/base_style_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/base_style_edit.tpl (revision 7664)
@@ -0,0 +1,103 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="base_style_edit" module="in-portal" icon="icon46_style"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('selectors','<inp2:selectors_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('selectors','OnCancel');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function ValidateRequired()
+ {
+ var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
+ '<inp2:selectors_InputName field="SelectorName"/>');
+ var $ret = true;
+ var $i = 0;
+ var $value = '';
+ while($i < $fields.length)
+ {
+ $value = document.getElementById( $fields[$i] ).value;
+ $value = $value.replace(' ','');
+ if($value.length == 0)
+ {
+ $ret = false;
+ break;
+ }
+ $i++;
+ }
+ return $ret;
+ }
+
+ function editStyle()
+ {
+ if( ValidateRequired() )
+ {
+ openSelector('selectors', '<inp2:m_t t="in-portal/stylesheets/style_editor" pass="all"/>', '', '850x460', 'OnOpenStyleEditor');
+ }
+ else
+ {
+ alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
+ }
+ }
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:selectors_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+ <inp2:m_ParseBlock name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
+ <input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="1">
+
+ <inp2:m_ParseBlock name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
+
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" valign="top">
+ <inp2:m_phrase name="la_fld_SelectorData"/>:<br>
+ <a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
+ </td>
+ <td>
+ <table width="100%">
+ <tr>
+ <td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
+ <td>
+ <inp2:selectors_PrintStyle field="SelectorData"/>
+ </td>
+ <td><inp2:m_phrase name="la_StylePreview"/>:</td>
+ <td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
+ <inp2:m_phrase name="la_SampleText"/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td class="error">&nbsp;</td>
+ </tr>
+
+</table>
+<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/base_style_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/block_style_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/block_style_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/block_style_edit.tpl (revision 7664)
@@ -0,0 +1,113 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="block_style_edit" module="in-portal" icon="icon46_style"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('selectors','<inp2:selectors_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('selectors','OnCancel');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
+ submit_event('selectors','OnResetToBase');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function ValidateRequired()
+ {
+ var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
+ '<inp2:selectors_InputName field="SelectorName"/>');
+ var $ret = true;
+ var $i = 0;
+ var $value = '';
+ while($i < $fields.length)
+ {
+ $value = document.getElementById( $fields[$i] ).value;
+ $value = $value.replace(' ','');
+ if($value.length == 0)
+ {
+ $ret = false;
+ break;
+ }
+ $i++;
+ }
+ return $ret;
+ }
+
+ function editStyle()
+ {
+ if( ValidateRequired() )
+ {
+ openSelector('selectors', '<inp2:m_t t="in-portal/stylesheets/style_editor" pass="all"/>', '', '850x460', 'OnOpenStyleEditor');
+ }
+ else
+ {
+ alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
+ }
+ }
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:selectors_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+ <inp2:m_ParseBlock name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
+ <input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="2">
+
+ <inp2:m_ParseBlock name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
+
+ <inp2:m_ParseBlock name="inp_edit_options" prefix="selectors" field="ParentId" title="!la_fld_SelectorBase!"/>
+
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
+
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" valign="top">
+ <inp2:m_phrase name="la_fld_SelectorData"/>:<br>
+ <a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
+ </td>
+ <td>
+ <table width="100%">
+ <tr>
+ <td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
+ <td>
+ <inp2:selectors_PrintStyle field="SelectorData"/>
+ </td>
+ <td><inp2:m_phrase name="la_StylePreview"/>:</td>
+ <td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
+ <inp2:m_phrase name="la_SampleText"/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td class="error">&nbsp;</td>
+ </tr>
+
+</table>
+<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/block_style_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline