Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1101947
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Aug 17, 9:16 AM
Size
18 KB
Mime Type
text/x-diff
Expires
Tue, Aug 19, 9:16 AM (13 h, 2 m)
Engine
blob
Format
Raw Data
Handle
713780
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/core/units/themes/themes_config.php
===================================================================
--- trunk/core/units/themes/themes_config.php (revision 8068)
+++ trunk/core/units/themes/themes_config.php (revision 8069)
@@ -1,92 +1,84 @@
<?php
$config = Array(
'Prefix' => 'theme',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
- 'EventHandlerClass' => Array('class'=>'kDBEventHandler','file'=>'','build_event'=>'OnBuild'),
+ 'EventHandlerClass' => Array('class'=>'ThemesEventHandler','file'=>'themes_eh.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ThemesTagProcessor','file'=>'themes_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
+
'IDField' => 'ThemeId',
-
- 'StatusField' => Array('Enabled','Primary'),
+ 'StatusField' => Array('Enabled', 'PrimaryTheme'),
'TitleField' => 'Name',
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array('theme' => '!la_title_Adding_Theme!'),
+ 'edit_status_labels' => Array('theme' => '!la_title_Editing_Theme!'),
+ 'new_titlefield' => Array('theme' => ''),
+ ),
+
+ 'themes_list' => Array('prefixes' => Array('theme_List'), 'format' => "!la_title_Configuration! - !la_title_Themes! (#theme_recordcount#)"),
+ 'themes_edit_general' => Array('prefixes' => Array('theme'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_General!"),
+ 'theme_files_list' => Array('prefixes' => Array('theme', 'theme-files_List'), 'format' => "#theme_status# '#theme_titlefield#' - !la_title_ThemeFiles! (#theme-files_recordcount#)"),
+ ),
+
'TableName' => TABLE_PREFIX.'Theme',
- 'SubItems' => Array('themefiles'),
-
-/*
- 'Sections' => Array(
- 'in-portal:configure_themes' => Array(
- 'parent' => 'in-portal:system',
- 'icon' => 'in-portal:conf_themes',
- 'label' => 'la_tab_Themes',
- 'url' => Array('index_file' => 'config/config_theme.php', 'pass' => 'm'),
- 'permissions' => Array('view', 'add', 'edit', 'delete'),
- 'priority' => 3,
- 'type' => stTREE,
- ),
-
- ),*/
+// 'SubItems' => Array('themefiles'),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
)
),
'AutoDelete' => true,
'AutoClone' => true,
- 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
- ), // key - special, value - list select sql
- 'ItemSQLs' => Array( ''=>' SELECT %1$s.*, style.LastCompiled, style.Name AS StyleName
- FROM %s
- LEFT JOIN '.TABLE_PREFIX.'Stylesheets style ON style.StylesheetId = %1$s.StylesheetId',
- ),
- 'ListSortings' => Array(
- '' => Array(
- 'Sorting' => Array('Name' => 'asc'),
- )
- ),
+ 'ListSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %s'),
+ 'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %s'),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'Sorting' => Array('Name' => 'asc'),
+ )
+ ),
'Fields' => Array(
'ThemeId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1=>'la_Enabled', 0=>'la_Disabled'), 'use_phrases'=>1, 'not_null' => 1, 'default' => 1),
'Description' => Array('type' => 'string','default' => null),
'PrimaryTheme' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'CacheTimeout' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'StylesheetId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
),
- 'VirtualFields' => Array(
- 'LastCompiled' => Array('type'=>'int', 'formatter'=>'kDateFormatter' ),
- ),
-
'Grids' => Array(
'Default' => Array(
- 'Icons' => Array('default'=>'icon16_custom.gif',0=>'icon16_style_disabled.gif',1=>'icon16_style.gif'),
+ 'Icons' => Array('default'=>'icon16_custom.gif', '1_1' => 'icon16_theme_primary.gif', '1_0' => 'icon16_theme.gif', '0_0' => 'icon16_theme_disabled.gif'),
'Fields' => Array(
- 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td'),
- 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td' ),
- 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ 'ThemeId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
+ 'Name' => Array( 'title'=>'la_col_Name',),
+ 'Description' => Array( 'title'=>'la_col_Description', ),
+ 'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
),
),
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/themes/themes_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.11
\ No newline at end of property
Index: trunk/core/units/themes/themes_eh.php
===================================================================
--- trunk/core/units/themes/themes_eh.php (nonexistent)
+++ trunk/core/units/themes/themes_eh.php (revision 8069)
@@ -0,0 +1,38 @@
+<?php
+
+ class ThemesEventHandler extends kDBEventHandler {
+
+ /**
+ * Allows to set selected theme as primary
+ *
+ * @param kEvent $event
+ */
+ function OnSetPrimary(&$event)
+ {
+ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+ return;
+ }
+
+ $ids = $this->StoreSelectedIDs($event);
+ if ($ids) {
+ $id = array_shift($ids);
+
+ $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
+ $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
+
+ $sql = 'UPDATE '.$table_name.'
+ SET PrimaryTheme = 0';
+ $this->Conn->Query($sql);
+
+
+ $sql = 'UPDATE '.$table_name.'
+ SET PrimaryTheme = 1, Enabled = 1
+ WHERE '.$id_field.' = '.$id;
+ $this->Conn->Query($sql);
+ }
+
+ $this->clearSelectedIDs($event);
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: trunk/core/units/themes/themes_eh.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/themes/themes_list.tpl
===================================================================
--- trunk/core/admin_templates/themes/themes_list.tpl (nonexistent)
+++ trunk/core/admin_templates/themes/themes_list.tpl (revision 8069)
@@ -0,0 +1,71 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_themes.view" system="1"/>
+<inp2:m_include t="incs/header"/>
+
+<!-- variant 1: begin -->
+<inp2:m_ParseBlock name="section_header" prefix="theme" module="core" icon="icon46_conf_themes" title="la_title_Themes"/>
+<inp2:m_ParseBlock name="blue_bar" prefix="theme" title_preset="themes_list" module="core" icon="icon46_conf_themes"/>
+<!-- variant 1: end -->
+
+<!-- variant 2: begin -->
+<inp2:m_RenderElement name="combined_header" section="in-portal:configure_themes" prefix="theme" title_preset="themes_list" pagination="1"/>
+<!-- variant 2: end -->
+
+<!-- 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('theme', 'themes/themes_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_theme', '<inp2:m_phrase label="la_ToolTip_NewTheme" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
+ function() {
+ std_precreate_item('theme', 'themes/themes_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('theme')
+ } ) );
+
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('primary_theme', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>', function() {
+ submit_event('theme','OnSetPrimary');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('rescan_themes', '<inp2:m_phrase label="la_ToolTip_RescanThemes" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_RescanThemes" escape="1"/>', function() {
+ submit_event('adm', 'OnRebuildThemes');
+ }
+ ) );
+
+ 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="theme" grid="Default"/>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="theme" IdField="ThemeId" grid="Default" menu_filters="yes"/>
+<script type="text/javascript">
+ Grids['theme'].SetDependantToolbarButtons( new Array('edit','delete','primary_theme') );
+</script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/core/admin_templates/themes/themes_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_primary_theme_f2.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_primary_theme_f2.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_new_theme_f3.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_new_theme_f3.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_new_theme.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_new_theme.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_rescan_themes_f3.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_rescan_themes_f3.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_primary_theme_f3.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_primary_theme_f3.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_new_theme_f2.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_new_theme_f2.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_rescan_themes.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_rescan_themes.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_primary_theme.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_primary_theme.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/toolbar/tool_rescan_themes_f2.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/toolbar/tool_rescan_themes_f2.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/icons/icon46_conf_themes.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/icons/icon46_conf_themes.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/icons/icon46_list_conf_themes.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/icons/icon46_list_conf_themes.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/admin_templates/img/icons/icon24_conf_themes.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/core/admin_templates/img/icons/icon24_conf_themes.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Event Timeline
Log In to Comment