Index: trunk/kernel/units/themes/themes_tag_processor.php =================================================================== diff -u -N --- trunk/kernel/units/themes/themes_tag_processor.php (revision 4526) +++ trunk/kernel/units/themes/themes_tag_processor.php (revision 0) @@ -1,56 +0,0 @@ -Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - if (!$object->GetDBField('StyleName')) { - // no stylesheet is associated with current theme - return ''; - } - - $css_url = $this->Application->BaseURL('/kernel/stylesheets'); - $css_path = rtrim( str_replace( $this->Application->BaseURL(), FULL_PATH.'/', $css_url), '/' ); - - $last_compiled = $object->GetDBField('LastCompiled'); - - $style_name = strtolower( $object->GetDBField('StyleName') ); - - if( file_exists($css_path.'/'.$style_name.'-'.$last_compiled.'.css') ) - { - $ret = rtrim($css_url, '/').'/'.$style_name.'-'.$last_compiled.'.css'; - - } - else - { - // search for previously compiled stylesheet - $last_compiled = 0; - if( $dh = opendir($css_path) ) - { - while( ($file = readdir($dh)) !== false ) - { - if( preg_match('/(.*)-([\d]+).css/', $file, $rets) ) - { - if( $rets[1] == $style_name && $rets[2] > $last_compiled ) $last_compiled = $rets[2]; - } - } - closedir($dh); - } - if ($last_compiled) { - // found - $ret = $css_url.'/'.$style_name.'-'.$last_compiled.'.css'; - } - else { - // not found - return ''; - } - } - - if (isset($params['file_only'])) return $ret; - - return ''; - } - } - -?> \ No newline at end of file Index: trunk/kernel/units/themes/themes_config.php =================================================================== diff -u -N --- trunk/kernel/units/themes/themes_config.php (revision 6625) +++ trunk/kernel/units/themes/themes_config.php (revision 0) @@ -1,92 +0,0 @@ - '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'), - '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'), - - 'TitleField' => 'Name', - - 'TableName' => TABLE_PREFIX.'Theme', - 'SubItems' => Array('themefiles'), - - - 'Sections' => Array( - 'in-portal:configure_themes' => Array( - 'parent' => 'in-portal:system', - 'icon' => '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), - ), - - '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'), - ) - ), - 'Fields' => Array( - 'ThemeId' => Array(), - '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' => ''), - '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'), - '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' ), - ), - - ), - ), - ); - -?> \ No newline at end of file