Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Fri, Jul 18, 5:17 PM

in-portal

Index: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_tag_processor.php (revision 1409)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_tag_processor.php (revision 1410)
@@ -1,40 +1,63 @@
<?php
class SelectorsTagProcessor extends kDBTagProcessor
{
function PrintStyle($params)
{
- $style_data = parent::Field($params);
+ $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params );
+ $style_data = $object->GetDBField( $params['field'] );
+ //$style_data = str_replace(array("&gt;", "&lt;","&quot;", "&"), array(">","<", "\"", "&"), $style_data);
+
$ret = '';
if($style_data)
{
- $style_attribs = unserialize($style_data);
- $ret = implode('<br>',$style_attribs);
+ //$style_attribs = unserialize($style_data);
+ foreach($style_data as $property_name => $property_value)
+ {
+ $ret .= $property_name.': '.$property_value.';<br>';
+ }
+
}
return $ret;
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function InputName($params)
{
$ret = parent::InputName($params);
$subfield = getArrayValue($params,'subfield');
- if($subfield)
+ if($subfield && $subfield != '$subfield')
{
$ret .= '['.$subfield.']';
}
return $ret;
}
+
+ function Field($params)
+ {
+ $subfield = getArrayValue($params,'subfield');
+ if($subfield && $subfield != '$subfield')
+ {
+ $params['no_special'] = 'no_special';
+ }
+ $ret = parent::Field($params);
+ if($subfield && $subfield != '$subfield')
+ {
+ return getArrayValue($ret,$subfield);
+ }
+ return $ret;
+ }
+
}
?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_event_handler.php (revision 1409)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_event_handler.php (revision 1410)
@@ -1,78 +1,152 @@
<?php
class SelectorsEventHandler extends InpDBEventHandler
{
/**
* Show base styles or block styles
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
$object =& $event->getObject();
switch ($event->Special)
{
case 'base':
$object->addFilter('type_filter', '%1$s.Type = 1');
break;
case 'block':
$object->addFilter('type_filter', '%1$s.Type = 2');
break;
}
}
/**
* Get's special of main item for linking with subitem
*
* @param kEvent $event
* @return string
*/
function getMainSpecial(&$event)
{
return '';
}
/**
* Initializes newly created items
*
* @param kEvent $event
*/
function OnNew(&$event)
{
parent::OnNew($event);
$object =& $event->getObject();
switch ($event->Special) {
case 'base':
$object->SetDBField('Type', 1);
break;
case 'block':
$object->SetDBField('Type', 2);
break;
}
}
/**
* Save css-style name & description before opening css editor
*
* @param kEvent $event
*/
function OnOpenStyleEditor(&$event)
{
+ $this->SaveChanges($event);
+ $event->redirect = false;
+ }
+
+ /**
+ * Saves Changes to Item
+ *
+ * @param kEvent $event
+ */
+ function SaveChanges(&$event)
+ {
$this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
$object =& $event->getObject();
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info)
{
list($id,$field_values) = each($items_info);
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$object->Update();
}
}
+
+ /**
+ * Save style changes from style editor
+ *
+ * @param kEvent $event
+ */
+ function OnSaveStyle(&$event)
+ {
+ $this->SaveChanges($event);
+ $object =& $event->getObject();
+
+ $selector_data = $object->GetDBField('SelectorData');
+ $object->SetDBField('SelectorData', serialize($selector_data) );
+ $object->Update();
+
+ $this->finalizePopup($event,'selectors.base','in-commerce/stylesheets/base_style_edit');
+ }
+
+ /**
+ * Extract styles
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+ $selector_data = $object->GetDBField('SelectorData');
+ if($selector_data)
+ {
+ $selector_data = unserialize($selector_data);
+ $object->SetDBField('SelectorData', $selector_data);
+ }
+ }
+
+ /**
+ * Serialize item before saving to db
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ $selector_data = $object->GetDBField('SelectorData');
+ if(!$selector_data) $selector_data = Array();
+ if( !IsSerialized($selector_data) ) $selector_data = serialize($selector_data);
+
+ $object->SetDBField('SelectorData', $selector_data);
+ }
+
+ /**
+ * Unserialize data back when update was made
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ $selector_data = $object->GetDBField('SelectorData');
+ if(!$selector_data) $selector_data = Array();
+ if( IsSerialized($selector_data) ) $selector_data = unserialize($selector_data);
+
+ $object->SetDBField('SelectorData', $selector_data);
+ }
}
?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.3
\ No newline at end of property
+1.1.2.4
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_config.php (revision 1409)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_config.php (revision 1410)
@@ -1,70 +1,70 @@
<?php
$config = Array(
'Prefix' => 'selectors',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'SelectorsEventHandler','file'=>'selectors_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'SelectorsTagProcessor','file'=>'selectors_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'SelectorId',
'TitleField' => 'Name',
'TableName' => TABLE_PREFIX.'StylesheetSelectors',
'ForeignKey' => 'StylesheetId',
'ParentTableKey' => 'StylesheetId',
'ParentPrefix' => 'css',
'AutoDelete' => true,
'AutoClone' => true,
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array(
'SelectorId' => Array(),
'StylesheetId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Name' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'SelectorName' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'SelectorData' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'SelectorData' => Array('not_null' => '1','default' => ''),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array( 1 => 'la_BaseSelectors', 2 => 'la_BlockSelectors'), 'use_phrases' => 1, 'not_null' => '1','default' => '0'),
'ParentId' => Array('type' => 'int','not_null' => '1','default' => '0'),
),
'VirtualFields' => Array(),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_selector.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' ),
),
),
'BlockStyles' => Array(
'Icons' => Array('default'=>'icon16_selector.gif'),
'Fields' => Array(
'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' ),
),
),
),
);
?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/selectors/selectors_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.3
\ No newline at end of property
+1.1.2.4
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/units/stylesheets/stylesheets_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/stylesheets/stylesheets_config.php (revision 1409)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/stylesheets/stylesheets_config.php (revision 1410)
@@ -1,95 +1,96 @@
<?php
$config = Array(
'Prefix' => 'css',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'InpDBEventHandler','file'=>'','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'StylesheetId',
'StatusField' => Array('Enabled'),
'TitleField' => 'Name',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('css'=>'!la_title_Adding_Stylesheet!'),
'edit_status_labels' => Array('css'=>'!la_title_Editing_Stylesheet!'),
'new_titlefield' => Array('css'=>'!la_title_New_Stylesheet!'),
),
'styles_list' => Array('prefixes' => Array('css_List'), 'format' => "!la_title_Stylesheets! (#css_recordcount#)"),
'stylesheets_edit' => Array('prefixes' => Array('css'), 'format' => "#css_status# '#css_titlefield#' - !la_title_General!"),
'base_styles' => Array('prefixes' => Array('css','selectors.base_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BaseStyles! (#selectors.base_recordcount#)"),
'block_styles' => Array('prefixes' => Array('css','selectors.block_List'), 'format' => "#css_status# '#css_titlefield#' - !la_title_BlockStyles! (#selectors.block_recordcount#)"),
- 'base_style_edit' => Array( 'prefixes' => Array('css','selectors.base'),
+ 'base_style_edit' => Array( 'prefixes' => Array('css','selectors'),
'new_status_labels' => Array('selectors.base'=>'!la_title_Adding_BaseStyle!'),
'edit_status_labels' => Array('selectors.base'=>'!la_title_Editing_BaseStyle!'),
'new_titlefield' => Array('selectors.base'=>'!la_title_New_BaseStyle!'),
- 'format' => "#css_status# '#css_titlefield#' - #selectors.base_status# '#selectors.base_titlefield#'"),
+ 'format' => "#css_status# '#css_titlefield#' - #selectors_status# '#selectors_titlefield#'"),
'style_edit' => Array('prefixes' => Array('selectors'), 'format' => "!la_title_EditingStyle! '#selectors_titlefield#'"),
),
'TableName' => TABLE_PREFIX.'Stylesheets',
'SubItems' => Array('selectors'),
'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 * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array(
'StylesheetId' => Array(),
'Name' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'AdvancedCSS' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'LastCompiled' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => '0'),
'Enabled' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => '1','default' => 0),
),
'VirtualFields' => Array(),
'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
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/stylesheets/stylesheets_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.3
\ No newline at end of property
+1.1.2.4
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl (revision 1410)
@@ -0,0 +1,166 @@
+<inp2:m_set nobody="yes"/>
+<inp2:m_include t="incs/header"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="style_edit" module="in-commerce" icon="icon46_style"/>
+<script src="incs/colorselector.js" type="text/javascript" language="javascript"></script>
+<style type="text/css">
+
+
+
+ .ColorBox
+ {
+ font-size: 1px;
+ border: #808080 1px solid;
+ width: 10px;
+ position: static;
+ height: 10px;
+ }
+
+
+
+</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"/>', function() {
+ submit_event('selectors','OnSaveStyle');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel"/>', function() {
+ window.close();
+ }
+ ) );
+
+ a_toolbar.Render();
+
+
+ function openColorSelector($e, $field)
+ {
+ var $div = document.getElementById('colorSelector_div');
+
+ var posx = 0;
+ var posy = 0;
+ if (!$e) var $e = window.event;
+ if ($e.pageX || $e.pageY)
+ {
+ posx = $e.pageX;
+ posy = $e.pageY;
+ }
+ else if ($e.clientX || $e.clientY)
+ {
+ posx = $e.clientX + document.body.scrollLeft;
+ posy = $e.clientY + document.body.scrollTop;
+ }
+
+ $div.style.left = posx;
+ $div.style.top = posy;
+ $div.style.display = 'block';
+
+ }
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_block name="inp_edit_color"/>
+ <script language="javascript">
+ $cs = new kColorSelector('<inp2:$prefix_InputName field="$field" subfield="$subfield"/>');
+ </script>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_ParseBlock name="inp_edit_field_caption" prefix="$prefix" field="$field" title_phrase="$title_phrase" title="$title" is_last="$is_last"/>
+ <td>
+ <input type="text"
+ name="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>"
+ id="<inp2:$prefix_InputName field="$field" subfield="$subfield"/>"
+ value="<inp2:$prefix_Field field="$field" subfield="$subfield"/>"
+ tabindex="<inp2:m_get param="tab_index"/>"
+ size="<inp2:m_param name="size"/>"
+ maxlength="<inp2:m_param name="maxlength"/>"
+ class="<inp2:m_param name="class"/>"
+ onkeypress="$cs.updateColor(event,'color_<inp2:$prefix_InputName field="$field" subfield="$subfield"/>')"
+ onblur="<inp2:m_Param name="onblur"/>">
+ <div id="color_<inp2:$prefix_InputName field="$field" subfield="$subfield"/>" style="display: inline; border: 1px solid #000000;" onclick="openColorSelector(event,'<inp2:$prefix_InputName field="$field" subfield="$subfield"/>');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+ </td>
+ <td class="error"><inp2:$prefix_Error field="$field"/>&nbsp;</td>
+ </tr>
+<inp2:m_blockend/>
+
+
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_FontAttributes!"/>
+ <inp2:m_ParseBlock name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="color" title="!la_fld_FontColor!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-size" title="!la_fld_FontSize!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-style" title="!la_fld_FontStyle!"/>
+
+</table>
+
+
+<script language="javascript" type="text/javascript">
+
+ var $input_name = '<inp2:selectors_InputName field="SelectorData" subfield="color"/>';
+
+ var oTable = document.getElementById('colorSelector');
+ var iCounter = 0;
+ var aColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';
+ aColors = aColors.split(',');
+
+ function updateColor($event,$color_preview)
+ {
+ alert('e: '+$event+'; cp: '+$color_preview);
+ document.getElementById('color_'+$color_preview).style.backgroundColor = document.getElementById($color_preview).value;
+ }
+
+ function colorMouseOver($e)
+ {
+ if(!$e) $e = window.event;
+ //print_pre(this);
+ this.parentNode.style.backgroundColor = '#C8D3E2';
+ this.parentNode.style.borderColor = '#7196CC';
+
+ }
+
+ function colorMouseOut($e)
+ {
+ if(!$e) $e = window.event;
+ this.parentNode.style.backgroundColor = '#F6F6F6';
+ this.parentNode.style.borderColor = '#F6F6F6';
+ }
+
+ function colorClick($e)
+ {
+ if(!$e) $e = window.event;
+ var $color = aColors[ this.getAttribute('ColorIndex') ];
+
+ document.getElementById('color_'+$input_name).style.backgroundColor = $color;
+ document.getElementById($input_name).value = '#' + $color;
+ document.getElementById('colorSelector_div').style.display = 'none';
+
+ colorMouseOut($e);
+ }
+
+ while(iCounter < aColors.length)
+ {
+ var oRow=oTable.insertRow(-1);
+ for(var i=0; i<8 && iCounter < aColors.length; i++,iCounter++)
+ {
+ var $cell = document.createElement('TD');
+ $cell.innerHTML = '<div class="ColorBox" style="background-color: #'+aColors[iCounter]+'"></div>';
+ $cell.onmouseover = colorMouseOver;
+ $cell.onmouseout = colorMouseOut;
+ $cell.onclick = colorClick;
+ $cell.setAttribute('ColorIndex', iCounter);
+ var oDiv=oRow.insertCell(-1).appendChild($cell);
+ };
+ }
+</script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/style_editor.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_base.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (revision 1409)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (revision 1410)
@@ -1,94 +1,96 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
<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-commerce/stylesheets/stylesheets_tabs"/>
<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="base_styles" module="in-commerce" 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"/>', function() {
submit_event('css','<inp2:css_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel"/>', function() {
submit_event('css','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev"/>', function() {
go_to_id('css', '<inp2:css_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next"/>', function() {
go_to_id('css', '<inp2:css_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
//Relations related:
a_toolbar.AddButton( new ToolBarButton('new_base_style', '<inp2:m_phrase label="la_ToolTip_NewBaseStyle"/>',
function() {
+ set_hidden_field('remove_specials[selectors.base]',1);
std_new_item('selectors.base', 'in-commerce/stylesheets/base_style_edit')
} ) );
function edit()
{
+ set_hidden_field('remove_specials[selectors.base]',1);
std_edit_temp_item('selectors.base', 'in-commerce/stylesheets/base_style_edit');
}
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete"/>',
function() {
std_delete_items('selectors.base')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View"/>', 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.base" IdField="SelectorId" grid="Default" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
<script type="text/javascript">
Grids['selectors.base'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/stylesheets_edit_base.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/base_style_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/base_style_edit.tpl (revision 1409)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/stylesheets/base_style_edit.tpl (revision 1410)
@@ -1,62 +1,62 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
<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-commerce" 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"/>', function() {
- submit_event('selectors.base','<inp2:selectors.base_SaveEvent/>');
+ submit_event('selectors','<inp2:selectors_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel"/>', function() {
- submit_event('selectors.base','OnCancel');
+ submit_event('selectors','OnCancel');
}
) );
a_toolbar.Render();
function editStyle()
{
- set_hidden_field('remove_specials[selectors.base]', 1);
- openSelector('selectors.base','<inp2:m_t t="in-commerce/stylesheets/style_editor" pass="all"/>',null,850,460,'OnOpenStyleEditor');
+ openSelector('selectors','<inp2:m_t t="in-commerce/stylesheets/style_editor" pass="all"/>',null,850,460,'OnOpenStyleEditor');
}
</script>
</td>
</tr>
</tbody>
</table>
<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.base" field="StylesheetId"/>
- <inp2:m_ParseBlock name="inp_edit_hidden" prefix="selectors.base" field="Type"/>
- <inp2:m_ParseBlock name="inp_id_label" prefix="selectors.base" field="SelectorId" title="!la_fld_SelectorId!"/>
+ <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_edit_box" prefix="selectors.base" field="Name" title="!la_fld_Name!" size="40"/>
- <inp2:m_ParseBlock name="inp_edit_textarea" prefix="selectors.base" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
+ <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="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"/>
<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>
- <inp2:selectors.base_PrintStyle field="SelectorData"/>
+ <inp2:selectors_PrintStyle field="SelectorData"/>
</td>
<td class="error">&nbsp;</td>
</tr>
</table>
-<input type="hidden" name="main_prefix" id="main_prefix" value="selectors.base">
+<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.1.2/core/admin_templates/stylesheets/base_style_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.2
\ No newline at end of property
+1.1.2.3
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js (revision 1410)
@@ -0,0 +1,85 @@
+ // color Selector
+
+ var aColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';
+
+ function kColorSelector($field)
+ {
+ this.Field = $field;
+
+ var $selector = document.getElementById('colorSelector_div');
+ this.updateColor = updateColor;
+ this.colorMouseOver = colorMouseOver;
+ this.colorMouseOut = colorMouseOut;
+ this.colorClick = colorClick;
+
+ if( !isset($selector) )
+ {
+ var $s_table = document.createElement('TABLE');
+ $s_table.id = 'colorSelector';
+ $selector.appendChild($s_table);
+
+ var $selector = document.createElement('DIV');
+ $selector.id = 'colorSelector_div';
+ $selector.className = 'table_color1';
+ $selector.style.width = '178px';
+ $selector.style.borderWidth = '1px';
+ $selector.style.borderColor = '#000000';
+ $selector.style.display = 'none';
+ $selector.style.position = 'absolute';
+ $selector.style.borderStyle = 'solid';
+ document.appendChild($selector);
+
+ var oTable = document.getElementById('colorSelector');
+ var iCounter = 0;
+ aColors = aColors.split(',');
+
+ while(iCounter < aColors.length)
+ {
+ var oRow = oTable.insertRow(-1);
+ for(var i = 0; i < 8 && iCounter < aColors.length; i++, iCounter++)
+ {
+ var $cell = document.createElement('TD');
+ $cell.innerHTML = '<div class="ColorBox" style="background-color: #'+aColors[iCounter]+'"></div>';
+ $cell.onmouseover = this.colorMouseOver;
+ $cell.onmouseout = this.colorMouseOut;
+ $cell.onclick = this.colorClick;
+ $cell.setAttribute('ColorIndex', iCounter);
+ var oDiv=oRow.insertCell(-1).appendChild($cell);
+ };
+ }
+ }
+ }
+
+ function updateColor($event,$color_preview)
+ {
+ alert('e: '+$event+'; cp: '+$color_preview);
+ document.getElementById('color_'+$color_preview).style.backgroundColor = document.getElementById($color_preview).value;
+ }
+
+ function colorMouseOver($e)
+ {
+ if(!$e) $e = window.event;
+ //print_pre(this);
+ this.parentNode.style.backgroundColor = '#C8D3E2';
+ this.parentNode.style.borderColor = '#7196CC';
+
+ }
+
+ function colorMouseOut($e)
+ {
+ if(!$e) $e = window.event;
+ this.parentNode.style.backgroundColor = '#F6F6F6';
+ this.parentNode.style.borderColor = '#F6F6F6';
+ }
+
+ function colorClick($e)
+ {
+ if(!$e) $e = window.event;
+ var $color = aColors[ this.getAttribute('ColorIndex') ];
+
+ document.getElementById('color_'+$input_name).style.backgroundColor = $color;
+ document.getElementById($input_name).value = '#' + $color;
+ document.getElementById('colorSelector_div').style.display = 'none';
+
+ colorMouseOut($e);
+ }
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/colorselector.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline