Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_block.tpl
===================================================================
diff -u -r1402 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (.../stylesheets_edit_block.tpl) (revision 1402)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (.../stylesheets_edit_block.tpl) (revision 1422)
@@ -55,7 +55,16 @@
function() {
std_delete_items('selectors.block')
} ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('clone', '', function() {
+ set_hidden_field('remove_specials[selectors.block]',1);
+ submit_event('selectors.block','OnMassClone');
+ }
+ ) );
+
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('view', '', function() {
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_base.tpl
===================================================================
diff -u -r1410 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (.../stylesheets_edit_base.tpl) (revision 1410)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (.../stylesheets_edit_base.tpl) (revision 1422)
@@ -36,8 +36,7 @@
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
-
- //Relations related:
+
a_toolbar.AddButton( new ToolBarButton('new_base_style', '',
function() {
set_hidden_field('remove_specials[selectors.base]',1);
@@ -55,6 +54,14 @@
function() {
std_delete_items('selectors.base')
} ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('clone', '', function() {
+ set_hidden_field('remove_specials[selectors.base]',1);
+ submit_event('selectors.base','OnMassClone');
+ }
+ ) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
Index: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_tag_processor.php
===================================================================
diff -u -r1421 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_tag_processor.php (.../selectors_tag_processor.php) (revision 1421)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_tag_processor.php (.../selectors_tag_processor.php) (revision 1422)
@@ -12,12 +12,11 @@
if($style_data)
{
- //$style_attribs = unserialize($style_data);
+ $separator = getArrayValue($params,'inline') ? ' ' : '
';
foreach($style_data as $property_name => $property_value)
{
- $ret .= $property_name.': '.$property_value.';
';
+ $ret .= $property_name.': '.$property_value.';'.$separator;
}
-
}
return $ret;
}
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/block_style_edit.tpl
===================================================================
diff -u -r1421 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/block_style_edit.tpl (.../block_style_edit.tpl) (revision 1421)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/block_style_edit.tpl (.../block_style_edit.tpl) (revision 1422)
@@ -75,6 +75,7 @@
+
">
@@ -83,7 +84,18 @@
-
+
+
+ : |
+
+
+ |
+ : |
+ | ">
+
+
+
+
|
|
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/base_style_edit.tpl
===================================================================
diff -u -r1421 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/base_style_edit.tpl (.../base_style_edit.tpl) (revision 1421)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/base_style_edit.tpl (.../base_style_edit.tpl) (revision 1422)
@@ -72,6 +72,7 @@
+
">
@@ -80,7 +81,18 @@
-
+
+
+ : |
+
+
+ |
+ : |
+ | ">
+
+
+
+
|
|
Index: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_config.php
===================================================================
diff -u -r1421 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 1421)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 1422)
@@ -59,7 +59,11 @@
'ParentPrefix' => 'css',
'AutoDelete' => true,
'AutoClone' => true,
-
+
+ 'Constrain' => 'Type = '.STYLE_BASE,
+ 'SubItems' => Array('SAME: Type='.STYLE_BLOCK),
+ 'ForeignKey1' => 'ParentId',
+
'ListSQLs' => Array( ''=>' SELECT %1$s.*
FROM %s',
), // key - special, value - list select sql
@@ -78,6 +82,7 @@
'SelectorData' => Array('not_null' => '1','default' => ''),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array( STYLE_BASE => 'la_BaseSelectors', STYLE_BLOCK => 'la_BlockSelectors'), 'use_phrases' => 1, 'not_null' => '1','default' => '0'),
+ 'AdvancedCSS' => Array('type' => 'string','not_null' => '1','default' => ''),
'ParentId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(0=>''), 'not_null' => '1','default' => '0'),
),
@@ -98,6 +103,7 @@
'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td'),
'SelectorName' => Array( 'title'=>'la_col_SelectorName'),
'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'grid_description_td' ),
+ 'ParentId' => Array('title'=>'la_col_Basedon'),
),
),
),
Index: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_item.php
===================================================================
diff -u -r1421 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_item.php (.../selectors_item.php) (revision 1421)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_item.php (.../selectors_item.php) (revision 1422)
@@ -17,8 +17,10 @@
{
$ret .= "\t$property_name: $property_value;\n";
}
- $ret .= $this->GetDBField('AdvancedCSS');
$ret .= "}\n";
+
+ $ret .= $this->GetDBField('AdvancedCSS')."\n";
+
return $ret;
}
}
Index: branches/unlabeled/unlabeled-1.1.2/core/units/stylesheets/stylesheets_event_handler.php
===================================================================
diff -u -r1421 -r1422
--- branches/unlabeled/unlabeled-1.1.2/core/units/stylesheets/stylesheets_event_handler.php (.../stylesheets_event_handler.php) (revision 1421)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/stylesheets/stylesheets_event_handler.php (.../stylesheets_event_handler.php) (revision 1422)
@@ -12,37 +12,41 @@
{
$this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
$object =& $event->getObject();
+ $object->SwitchToLive();
- $ids = explode(',', $this->Application->RecallVar($event->getPrefixSpecial().'_selected_ids') );
+ $ids = explode(',', $event->MasterEvent->getEventParam('ids') );
- $ret = '/* This file is generated automatically. Don\'t edit it manually ! */'."\n\n";
if($ids)
{
- $selector_item =& $this->Application->recallObject('selectors.item', 'selectors');
+ $this->Application->setUnitOption('selectors','AutoLoad',false);
+ $selector_item =& $this->Application->recallObject('selectors.item', 'selectors', Array('live_table'=>true) );
$parent_field = $this->Application->getUnitOption($selector_item->Prefix,'ForeignKey');
- $sql = 'SELECT '.$selector_item->IDField.' FROM '.$selector_item->TableName.' WHERE '.$parent_field.' = '.$id;
- $selectors_ids = $this->Conn->GetCol($sql);
+ $sql_template = 'SELECT '.$selector_item->IDField.' FROM '.$selector_item->TableName.' WHERE '.$parent_field.' = %s';
foreach($ids as $id)
{
$object->Load($id);
+ $selectors_ids = $this->Conn->GetCol( sprintf($sql_template,$id) );
+ $ret = '/* This file is generated automatically. Don\'t edit it manually ! */'."\n\n";
foreach($selectors_ids as $selector_id)
{
$selector_item->Load($selector_id);
$ret .= $selector_item->CompileStyle()."\n";
}
+ $ret .= $object->GetDBField('AdvancedCSS');
+
$compile_ts = time();
- $css_path = DOC_ROOT.BASE_PATH.'/themes/';
+ $css_path = DOC_ROOT.BASE_PATH.'/kernel/stylesheets/';
- $css_file = $css_path.$compile_ts.'-'.strtolower($object->GetDBField('Name')).'.css';
+ $css_file = $css_path.strtolower($object->GetDBField('Name')).'-'.$compile_ts.'.css';
$fp = fopen($css_file,'w');
if($fp)
{
- $prev_css = $css_path.$object->GetDBField('LastCompiled').'-'.strtolower($object->GetDBField('Name')).'.css';
+ $prev_css = $css_path.strtolower($object->GetDBField('Name')).'-'.$object->GetDBField('LastCompiled').'.css';
if( file_exists($prev_css) ) unlink($prev_css);
fwrite($fp, $ret);