Index: trunk/core/admin_templates/themes/themes_list.tpl
===================================================================
diff -u
--- trunk/core/admin_templates/themes/themes_list.tpl (revision 0)
+++ trunk/core/admin_templates/themes/themes_list.tpl (revision 8069)
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/core/units/themes/themes_config.php
===================================================================
diff -u -r8015 -r8069
--- trunk/core/units/themes/themes_config.php (.../themes_config.php) (revision 8015)
+++ trunk/core/units/themes/themes_config.php (.../themes_config.php) (revision 8069)
@@ -4,7 +4,7 @@
'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(),
@@ -14,29 +14,27 @@
3 => 'event',
4 => 'mode',
),
+
'IDField' => 'ThemeId',
+ 'StatusField' => Array('Enabled', 'PrimaryTheme'),
- 'StatusField' => Array('Enabled','Primary'),
-
'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'),
+// '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,
- ),
-
- ),*/
-
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1), 'type' => WHERE_FILTER),
@@ -51,17 +49,14 @@
'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' => ''),
@@ -72,17 +67,14 @@
'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'),
),
),
Index: trunk/core/units/themes/themes_eh.php
===================================================================
diff -u
--- trunk/core/units/themes/themes_eh.php (revision 0)
+++ trunk/core/units/themes/themes_eh.php (revision 8069)
@@ -0,0 +1,38 @@
+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
Index: trunk/core/admin_templates/img/icons/icon24_conf_themes.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/icons/icon46_conf_themes.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_new_theme.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_primary_theme_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/icons/icon46_list_conf_themes.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_primary_theme_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_primary_theme.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_new_theme_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_new_theme_f3.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_rescan_themes.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_rescan_themes_f2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/img/toolbar/tool_rescan_themes_f3.gif
===================================================================
diff -u
Binary files differ