Attached Files |
Direct_Editing_of_Catalog_Items_and_Prefixes_in_Content_Mode.png [^] (404,743 bytes) 2012-03-29 12:52
admin_edit_button_core.patch [^] (25,620 bytes) 2012-04-03 04:41
[Show Content]
Index: admin_templates/incs/cms.css
===================================================================
--- admin_templates/incs/cms.css (revision 15165)
+++ admin_templates/incs/cms.css (working copy)
@@ -16,21 +16,25 @@
padding: 5px;
}
-div.cms-section-properties-btn, div.cms-edit-btn, div.cms-edit-block-btn, div.cms-edit-design-btn {
+.cms-edit-btn {
padding: 2px 5px;
font-family: Arial, Verdana;
font-size: 13px;
font-weight: normal;
- width: auto;
- position: absolute;
color: black;
cursor: pointer;
+ border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
+}
+
+.cms-section-properties-btn, .cms-edit-btn, .cms-edit-block-btn, .cms-edit-design-btn {
+ width: auto;
+ position: absolute;
z-index: 99;
}
-div.cms-edit-btn, div.cms-edit-block-btn, div.cms-edit-design-btn {
+.cms-edit-btn, .cms-edit-block-btn, .cms-edit-design-btn {
margin-top: -10px;
}
@@ -41,25 +45,23 @@
display: none;
}
-div.cms-edit-design-btn-container div.cms-edit-block-btn, div.cms-edit-design-btn-container div.cms-edit-design-btn {
+div.cms-edit-design-btn-container .cms-edit-block-btn, div.cms-edit-design-btn-container .cms-edit-design-btn {
float: left;
display: block;
position: relative;
margin: 0px;
}
-div.cms-edit-design-btn-container div.cms-edit-design-btn {
+div.cms-edit-design-btn-container .cms-edit-design-btn {
margin-left: 4px;
}
/* === Styles for "Section Properties" button === */
-div.cms-section-properties-btn {
+.cms-section-properties-btn {
float: right;
position: relative;
- border: 2px solid #A1D0A1;
+ border-color: #A1D0A1;
background-color: #CCFF00;
- opacity: 0.5;
- filter: alpha(opacity=50);
}
div.cms-section-properties-btn-container {
@@ -68,32 +70,60 @@
}
/* === Styles for "Edit" button === */
+.cms-btn-new {
+ cursor: pointer;
+ background: url(@templates_base@/img/top_frame/icons/content_mode.png) #CCFF00 3px center no-repeat;
+ padding: 2px 2px 2px 17px;
+
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border: 2px solid #A1D0A1;
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+
+ color: black;
+ font-family: Arial, Verdana;
+ font-size: 13px;
+ font-weight: normal;
+}
+
+.cms-btn-new:hover {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+
div.cms-edit-btn-container {
border: 1px dashed #FF6E00;
}
div.cms-edit-btn {
- margin-left: -10px;
border: 2px solid #FF6E00;
- background-color: #FFCC00;
- opacity: 0.5;
- filter: alpha(opacity=50);
}
-div.cms-edit-block-btn {
+.cms-edit-btn {
margin-left: -10px;
- border: 2px solid #FF6E00;
+ border-color: #FF6E00;
background-color: #FFCC00;
+}
+
+.cms-edit-block-btn {
+ border-color: #FF6E00;
+ background-color: #FFCC00;
display: none;
}
-div.cms-edit-design-btn {
- margin-left: -10px;
- border: 2px solid #A1D0A1;
+.cms-edit-design-btn {
+ border-color: #A1D0A1;
background-color: #CCFF00;
display: none;
}
+.admin-edit-btn {
+ border-color: #A1D0A1;
+ background-color: #CCFF00;
+}
+
/* === Styles for "Save" and "Cancel" buttons (for layout) === */
div.cms-layout-btn-container {
position: absolute;
@@ -101,34 +131,24 @@
z-index: 99;
}
-div.cms-save-layout-btn, div.cms-cancel-layout-btn {
+.cms-save-layout-btn, .cms-cancel-layout-btn {
float: left;
- padding: 2px 5px;
- font-family: Arial, Verdana;
- font-size: 13px;
- font-weight: normal;
width: auto;
- color: black;
- cursor: pointer;
- /*opacity: 0.5;
- filter: alpha(opacity=50);*/
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
}
-div.cms-save-layout-btn {
+.cms-save-layout-btn {
color: white;
- border: 2px solid #1C960C;
+ border-color: #1C960C;
background-color: #24B30D;
}
-div.cms-cancel-layout-btn {
+.cms-cancel-layout-btn {
color: white;
- border: 2px solid #C81900;
+ border-color: #C81900;
background-color: #DE2A00;
}
-div.cms-cancel-layout-btn {
+.cms-cancel-layout-btn {
margin-left: 4px;
}
@@ -137,6 +157,11 @@
border: 1px dashed transparent;
}
+div.block-edit-block-btn-container .cms-btn-new, div.block-edit-design-btn-container .cms-btn-new {
+ opacity: 1;
+ filter: alpha(opacity = 100);
+}
+
div.block-edit-block-btn-container-over, div.block-edit-design-btn-container-over {
border-color: #FF6E00;
}
@@ -171,7 +196,7 @@
font-size: 9px;
}
-span[name='cms-translate-phrase'] .cms-edit-btn {
+span[name='cms-translate-phrase'] .cms-edit-btn, span[name='cms-translate-phrase'] .admin-edit-btn {
display: none;
opacity: 1;
filter: alpha(opacity=100);
Index: admin_templates/incs/cms_ie.css
===================================================================
--- admin_templates/incs/cms_ie.css (revision 0)
+++ admin_templates/incs/cms_ie.css (revision 0)
@@ -0,0 +1,3 @@
+.cms-btn-new {
+ padding-left: 20px;
+}
\ No newline at end of file
Property changes on: admin_templates\incs\cms_ie.css
___________________________________________________________________
Added: svn:eol-style
+ LF
Index: admin_templates/js/template_manager.js
===================================================================
--- admin_templates/js/template_manager.js (revision 15165)
+++ admin_templates/js/template_manager.js (working copy)
@@ -47,12 +47,13 @@
if ($template_manager.editingMode > 1) {
// all modes except for "Browse Mode"
- $hover_effect.push('div.cms-section-properties-btn:first');
+// $hover_effect.push('div.cms-section-properties-btn:first');
}
if ($template_manager.editingMode == 2) {
// Content Mode
- $hover_effect.push('div.cms-edit-btn');
+// $hover_effect.push('div.cms-edit-btn');
+// $hover_effect.push('div.admin-edit-btn');
// make all spans with phrases clickable
$template_manager.setupEditTranslationButtons(document);
@@ -104,17 +105,19 @@
}
// make requested elements fully visible on mouseover
- $($hover_effect.join(', '))
- .mouseover(
- function(e) {
- $(this).css('opacity', 1);
- }
- )
- .mouseout(
- function(e) {
- $(this).css('opacity', 0.5);
- }
- );
+ if ( $hover_effect.length ) {
+ $($hover_effect.join(', '))
+ .mouseover(
+ function(e) {
+ $(this).css('opacity', 1);
+ }
+ )
+ .mouseout(
+ function(e) {
+ $(this).css('opacity', 0.5);
+ }
+ );
+ }
// related to content revision control toolbar
$('#cms-toggle-revision-toolbar').click(
@@ -456,12 +459,12 @@
$button_group.show();
}
else {
- $('div.cms-edit-design-btn:first', $element).show();
+ $('.cms-edit-design-btn:first', $element).show();
}
}
else {
$($element).addClass('block-edit-block-btn-container-over');
- $('div.cms-edit-block-btn:first', $element).show();
+ $('.cms-edit-block-btn:first', $element).show();
}
$e.stopPropagation();
@@ -482,12 +485,12 @@
$button_group.hide();
}
else {
- $('div.cms-edit-design-btn:first', $element).hide();
+ $('.cms-edit-design-btn:first', $element).hide();
}
}
else {
$($element).removeClass('block-edit-block-btn-container-over');
- $('div.cms-edit-block-btn:first', $element).hide();
+ $('.cms-edit-block-btn:first', $element).hide();
}
$e.stopPropagation();
@@ -505,8 +508,8 @@
$block_containers = $block_containers.not($block_container);
// place "Edit Block" button near "Edit Design" button
- var $edit_design_btn = $('div.cms-edit-design-btn:first', this);
- var $edit_block_btn = $('div.cms-edit-block-btn:first', $block_container);
+ var $edit_design_btn = $('.cms-edit-design-btn:first', this);
+ var $edit_block_btn = $('.cms-edit-block-btn:first', $block_container);
$edit_design_btn
.wrap('<div class="cms-edit-design-btn-container"></div>')
Index: install/english.lang
===================================================================
--- install/english.lang (revision 15255)
+++ install/english.lang (working copy)
@@ -20,6 +20,7 @@
<PHRASE Label="la_Background" Module="Core" Type="1">QmFja2dyb3VuZA==</PHRASE>
<PHRASE Label="la_Borders" Module="Core" Type="1">Qm9yZGVycw==</PHRASE>
<PHRASE Label="la_btn_Add" Module="Core" Type="1">QWRk</PHRASE>
+ <PHRASE Label="la_btn_AdminEditItem" Module="Core" Type="1">RWRpdCBJdGVt</PHRASE>
<PHRASE Label="la_btn_BrowseMode" Module="Core" Type="1">QnJvd3NlIE1vZGU=</PHRASE>
<PHRASE Label="la_btn_Cancel" Module="Core" Type="1">Q2FuY2Vs</PHRASE>
<PHRASE Label="la_btn_Change" Module="Core" Type="1">Q2hhbmdl</PHRASE>
Index: kernel/db/db_tag_processor.php
===================================================================
--- kernel/db/db_tag_processor.php (revision 15226)
+++ kernel/db/db_tag_processor.php (working copy)
@@ -2677,6 +2677,85 @@
}
/**
+ * Creates a button for editing item in Admin Console
+ *
+ * @param Array $params
+ * @return string
+ * @access protected
+ */
+ protected function AdminEditButton($params)
+ {
+ if ( EDITING_MODE != EDITING_MODE_CONTENT ) {
+ return '';
+ }
+
+ $object = $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $item_prefix = isset($params['item_prefix']) ? $params['item_prefix'] : $this->Prefix;
+
+ if ( isset($params['template']) ) {
+ $template = isset($params['template']);
+ }
+ else {
+ $admin_template_prefix = $this->Application->getUnitOption($item_prefix, 'AdminTemplatePrefix');
+ $template = $this->Application->getUnitOption($item_prefix, 'AdminTemplatePath') . '/' . $admin_template_prefix . 'edit';
+
+ if ( !$admin_template_prefix ) {
+ throw new InvalidArgumentException('Automatic admin editing template detection failed because of missing "AdminTemplatePrefix" unit config option in "' . $this->Prefix . '" unit config');
+ }
+ }
+
+ $form_name = 'kf_' . str_replace('-', '_', $item_prefix) . '_' . $object->GetID();
+ $button_icon = isset($params['button_icon']) ? $params['button_icon'] : 'content_mode.png';
+ $button_class = isset($params['button_class']) ? $params['button_class'] : 'admin-edit-btn';
+ $button_title = isset($params['button_title']) ? $params['button_title'] : 'la_btn_AdminEditItem';
+
+ if ( substr($button_title, 0, 1) == '+' ) {
+ $button_title = substr($button_title, 1);
+ }
+ else {
+ $button_title = $this->Application->Phrase($button_title, false, true);
+ }
+
+ $icon_url = $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/' . $button_icon;
+ $button_code = '<button style="background-image: url(' . $icon_url . ');" onclick="$form_name=\'' . addslashes($form_name) . '\'; std_edit_item(\'' . addslashes($item_prefix) . '\', \'' . addslashes($template) . '\');" class="cms-btn-new ' . $button_class . '">' . $button_title . '</button>';
+
+ if ( !isset($params['pass']) ) {
+ $params['pass'] = 'm,' . $item_prefix;
+ }
+
+ $params['m_opener'] = 'd';
+ $params[$item_prefix . '_id'] = $object->GetID();
+
+ if ( !isset($params['temp_mode']) || (isset($params['temp_mode']) && $params['temp_mode']) ) {
+ $params[$item_prefix . '_mode'] = 't';
+ $params[$item_prefix . '_event'] = 'OnEdit';
+ }
+
+ $params['front'] = 1; // to make opener stack work properly
+ $params['__URLENCODE__'] = 1; // don't use "&"
+ $params['__NO_REWRITE__'] = 1; // since admin link
+// $params['escape'] = 1; // needed?
+
+ unset($params['button_icon'], $params['button_class'], $params['button_title'], $params['template'], $params['item_prefix'], $params['temp_mode']);
+
+ // link from Front-End to Admin, don't remove "index.php"
+ $edit_url = $this->Application->HREF($template, ADMIN_DIRECTORY, $params, 'index.php');
+ $edit_form = '<form method="POST" style="display: inline; margin: 0px" name="' . $form_name . '" id="' . $form_name . '" action="' . $edit_url . '"></form>';
+
+ if ( isset($params['forms_later']) && $params['forms_later'] ) {
+ $all_forms = $this->Application->GetVar('all_forms');
+ $this->Application->SetVar('all_forms', $all_forms . $edit_form);
+ }
+ else {
+ $button_code .= $edit_form;
+ }
+
+ return $button_code;
+ }
+
+ /**
* Calls OnNew event from template, when no other event submitted
*
* @param Array $params
Index: units/categories/categories_tag_processor.php
===================================================================
--- units/categories/categories_tag_processor.php (revision 15246)
+++ units/categories/categories_tag_processor.php (working copy)
@@ -1193,63 +1193,27 @@
$edit_code_before = $edit_code_after = '';
- if (EDITING_MODE == EDITING_MODE_CONTENT) {
- $bg_color = isset($params['bgcolor']) ? $params['bgcolor'] : '#ffffff';
- $url_params = Array (
- 'pass' => 'm,c,content',
- 'm_opener' => 'd',
- 'c_id' => $page->GetID(),
- 'content_id' => $content->GetID(),
- 'front' => 1,
- 'admin' => 1,
- '__URLENCODE__' => 1,
- '__NO_REWRITE__'=> 1,
- 'escape' => 1,
- 'index_file' => 'index.php',
-// 'bgcolor' => $bg_color,
-// '__FORCE_SID__' => 1
- );
+ if ( EDITING_MODE == EDITING_MODE_CONTENT ) {
+ $button_code = $this->Application->ProcessParsedTag($content->getPrefixSpecial(), 'AdminEditButton', $params);
- // link from Front-End to admin, don't remove "index.php"
- $edit_url = $this->Application->HREF('categories/edit_content', ADMIN_DIRECTORY, $url_params, 'index.php');
$edit_code_before = '
<div class="cms-edit-btn-container">
- <div class="cms-edit-btn" onclick="$form_name=\'kf_cont_'.$content->GetID().'\'; std_edit_item(\'content\', \'categories/edit_content\');">
- <div class="cms-btn-image">
- <img src="' . $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/content_mode.png" width="15" height="16" alt=""/>
- </div>
- <div class="cms-btn-text">' . $this->Application->Phrase('la_btn_EditContent', false, true) . ' '.(defined('DEBUG_MODE') && DEBUG_MODE ? " - #{$num}" : '').'</div>
- </div>
+ ' . $button_code . '
<div class="cms-btn-content">';
- $edit_form = '<form method="POST" style="display: inline; margin: 0px" name="kf_cont_'.$content->GetID().'" id="kf_cont_'.$content->GetID().'" action="'.$edit_url.'">';
- $edit_form .= '<input type="hidden" name="c_id" value="'.$page->GetID().'"/>';
- $edit_form .= '<input type="hidden" name="content_id" value="'.$content->GetID().'"/>';
- $edit_form .= '<input type="hidden" name="front" value="1"/>';
- $edit_form .= '<input type="hidden" name="bgcolor" value="'.$bg_color.'"/>';
- $edit_form .= '<input type="hidden" name="m_lang" value="'.$this->Application->GetVar('m_lang').'"/>';
- $edit_form .= '</form>';
-
$edit_code_after = '</div></div>';
-
- if (array_key_exists('forms_later', $params) && $params['forms_later']) {
- $all_forms = $this->Application->GetVar('all_forms');
- $this->Application->SetVar('all_forms', $all_forms . $edit_form);
- }
- else {
- $edit_code_after .= $edit_form;
- }
}
- if ($this->Application->GetVar('_editor_preview_') == 1) {
+ if ( $this->Application->GetVar('_editor_preview_') == 1 ) {
$data = $this->Application->RecallVar('_editor_preview_content_');
- } else {
+ }
+ else {
$data = $content->GetField('Content');
}
$data = $edit_code_before . $this->_transformContentBlockData($data, $params) . $edit_code_after;
- if ($data != '') {
+ if ( $data != '' ) {
$this->Application->Parser->DataExists = true;
}
@@ -1389,6 +1353,10 @@
$ret = '<link rel="stylesheet" href="' . $css_compressed . '" type="text/css" media="screen"/>' . "\n";
+ $ret .= ' <!--[if IE]>
+ <link rel="stylesheet" href="' . $js_url . '/../incs/cms_ie.css' . '" type="text/css" media="screen"/>
+ <![endif]-->';
+
if ( EDITING_MODE == EDITING_MODE_DESIGN ) {
$ret .= ' <style type="text/css" media="all">
div.movable-element .movable-header { cursor: move; }
@@ -1508,6 +1476,7 @@
}
$display_mode = array_key_exists('mode', $params) ? $params['mode'] : false;
+ unset($params['mode']);
$edit_code = '';
$page =& $this->_getPage($params);
@@ -1519,31 +1488,21 @@
// show "EditPage" button only for pages, that exists in structure
if ($display_mode != 'end') {
- $edit_btn = '';
+ $edit_btn = $edit_url = '';
- if (EDITING_MODE == EDITING_MODE_CONTENT) {
- $url_params = Array(
- 'pass' => 'm,c',
- 'm_opener' => 'd',
- 'c_id' => $page->GetID(),
- 'c_mode' => 't',
- 'c_event' => 'OnEdit',
- 'front' => 1,
- '__URLENCODE__' => 1,
- '__NO_REWRITE__'=> 1,
- 'index_file' => 'index.php',
- );
+ if ( EDITING_MODE == EDITING_MODE_CONTENT ) {
+ $item_prefix = isset($params['item_prefix']) ? $params['item_prefix'] : '';
+ unset($params['item_prefix']);
- $edit_url = $this->Application->HREF('categories/categories_edit', ADMIN_DIRECTORY, $url_params);
-
- $edit_btn .= '
- <div class="cms-section-properties-btn"' . ($display_mode === false ? ' style="margin: 0px;"' : '') . ' onmouseover="window.status=\'' . addslashes($edit_url) . '\'; return true" onclick="$form_name=\'kf_'.$page->GetID().'\'; std_edit_item(\'c\', \'categories/categories_edit\');">
- <div class="cms-btn-image">
- <img src="' . $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/section_properties.png" width="15" height="16" alt=""/>
- </div>
- <div class="cms-btn-text">' . $this->Application->Phrase('la_btn_SectionProperties', false, true) . '</div>
- </div>' . "\n";
- } elseif (EDITING_MODE == EDITING_MODE_DESIGN) {
+ if ( $item_prefix ) {
+ $params['button_class'] = 'cms-section-properties-btn';
+ $edit_btn = $this->Application->ProcessParsedTag($item_prefix, 'AdminEditButton', $params) . "\n";
+ }
+ else {
+ $edit_btn = $this->AdminEditButton($params) . "\n"; // "st" object must be loaded before this
+ }
+ }
+ elseif ( EDITING_MODE == EDITING_MODE_DESIGN ) {
$url_params = Array(
'pass' => 'm,theme,theme-file',
'm_opener' => 'd',
@@ -1559,31 +1518,22 @@
$edit_url = $this->Application->HREF('themes/file_edit', ADMIN_DIRECTORY, $url_params);
- $edit_btn .= '
- <div class="cms-layout-btn-container"' . ($display_mode === false ? ' style="margin: 0px;"' : '') . '>
- <div class="cms-save-layout-btn" onclick="aTemplateManager.saveLayout(); return false;">
- <div class="cms-btn-image">
- <img src="' . $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/save_button.gif" width="16" height="16" alt=""/>
- </div>
- <div class="cms-btn-text">' . $this->Application->Phrase('la_btn_SaveChanges', false, true) . '</div>
- </div>
- <div class="cms-cancel-layout-btn" onclick="aTemplateManager.cancelLayout(); return false;">
- <div class="cms-btn-image">
- <img src="' . $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/cancel_button.gif" width="16" height="16" alt=""/>
- </div>
- <div class="cms-btn-text">' . $this->Application->Phrase('la_btn_Cancel', false, true) . '</div>
- </div>
- </div>
+ $button1_icon = $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/save_button.gif';
+ $button1_title = $this->Application->Phrase('la_btn_SaveChanges', false, true);
+ $button1_code = '<button style="background-image: url(' . $button1_icon . '); onclick="aTemplateManager.saveLayout(); return false;" class="cms-btn-new cms-save-layout-btn">' . $button1_title . '</button>';
- <div class="cms-section-properties-btn"' . ($display_mode === false ? ' style="margin: 0px;"' : '') . ' onmouseover="window.status=\'' . addslashes($edit_url) . '\'; return true" onclick="$form_name=\'kf_'.$page->GetID().'\'; std_edit_item(\'theme\', \'themes/file_edit\');">
- <div class="cms-btn-image">
- <img src="' . $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/section_properties.png" width="15" height="16" alt=""/>
- </div>
- <div class="cms-btn-text">' . $this->Application->Phrase('la_btn_SectionTemplate', false, true) . '</div>
- </div>' . "\n";
+ $button2_icon = $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/cancel_button.gif';
+ $button2_title = $this->Application->Phrase('la_btn_Cancel', false, true);
+ $button2_code = '<button style="background-image: url(' . $button2_icon . '); onclick="aTemplateManager.cancelLayout(); return false;" class="cms-btn-new cms-cancel-layout-btn">' . $button2_title . '</button>';
+
+ $button3_icon = $this->Application->BaseURL() . 'core/admin_templates/img/top_frame/icons/section_properties.png';
+ $button3_title = $this->Application->Phrase('la_btn_SectionTemplate', false, true);
+ $button3_code = '<button style="background-image: url(' . $button3_icon . ');' . ($display_mode === false ? ' margin: 0px;' : '') . '" onclick="$form_name=\'kf_'.$page->GetID().'\'; std_edit_item(\'theme\', \'themes/file_edit\');" class="cms-btn-new cms-section-properties-btn">' . $button3_title . '</button>';
+
+ $edit_btn .= '<div class="cms-layout-btn-container"' . ($display_mode === false ? ' style="margin: 0px;"' : '') . '>' . $button1_code . $button2_code . '</div>' . $button3_code . "\n";
}
- if ($display_mode == 'start') {
+ if ( $display_mode == 'start' ) {
// button with border around the page
if ( EDITING_MODE == EDITING_MODE_CONTENT ) {
$tabs = "\n" . str_repeat("\t", 9);
@@ -1696,7 +1646,9 @@
</form>';
}
- $edit_code .= '<form method="POST" style="display: inline; margin: 0px" name="kf_'.$page->GetID().'" id="kf_'.$page->GetID().'" action="'.$edit_url.'"></form>';
+ if ( $edit_url ) {
+ $edit_code .= '<form method="POST" style="display: inline; margin: 0px" name="kf_' . $page->GetID() . '" id="kf_' . $page->GetID() . '" action="' . $edit_url . '"></form>';
+ }
// when "EditingScripts" tag is not used, make sure, that scripts are also included
$edit_code .= $this->EditingScripts($params);
@@ -1733,6 +1685,33 @@
}
/**
+ * Creates a button for editing item in Admin Console
+ *
+ * @param Array $params
+ * @return string
+ * @access protected
+ */
+ protected function AdminEditButton($params)
+ {
+ if ( EDITING_MODE != EDITING_MODE_CONTENT ) {
+ return '';
+ }
+
+ $object = $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $params['item_prefix'] = 'c';
+
+ if ( $this->Prefix == 'st' ) {
+ $params['button_icon'] = 'section_properties.png';
+ $params['button_class'] = 'cms-section-properties-btn';
+ $params['button_title'] = 'la_btn_SectionProperties';
+ }
+
+ return parent::AdminEditButton($params);
+ }
+
+ /**
* Builds site menu
*
* @param Array $params
Index: units/content/content_config.php
===================================================================
--- units/content/content_config.php (revision 15234)
+++ units/content/content_config.php (working copy)
@@ -19,7 +19,7 @@
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'ContentEventHandler', 'file' => 'content_eh.php', 'build_event' => 'OnBuild'),
- 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'ContentTagProcessor', 'file' => 'content_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
Index: units/content/content_tp.php
===================================================================
--- units/content/content_tp.php (revision 0)
+++ units/content/content_tp.php (revision 0)
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @version $Id$
+ * @package In-Portal
+ * @copyright Copyright (C) 1997 - 2012 Intechnic. All rights reserved.
+ * @license GNU/GPL
+ * In-Portal is Open Source software.
+ * This means that this software may have been modified pursuant
+ * the GNU General Public License, and as distributed it includes
+ * or is derivative of works licensed under the GNU General Public License
+ * or other free or open source software licenses.
+ * See http://www.in-portal.org/license for copyright notices and details.
+ */
+
+defined('FULL_PATH') or die('restricted access!');
+
+class ContentTagProcessor extends kDBTagProcessor {
+
+ /**
+ * Creates a button for editing item in Admin Console
+ *
+ * @param Array $params
+ * @return string
+ * @access protected
+ */
+ protected function AdminEditButton($params)
+ {
+ if ( EDITING_MODE != EDITING_MODE_CONTENT ) {
+ return '';
+ }
+
+ $object = $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $params['pass'] = 'm,c,content';
+ $params['c_id'] = $object->GetDBField('PageId');
+ $params['admin'] = 1;
+
+ $params['temp_mode'] = 0;
+ $params['template'] = 'categories/edit_content';
+ $params['button_icon'] = 'content_mode.png';
+ $params['button_class'] = 'cms-edit-btn';
+ $params['button_title'] = '+' . $this->Application->Phrase('la_btn_EditContent', false, true);
+
+ if ( defined('DEBUG_MODE') && DEBUG_MODE ) {
+ $params['button_title'] .= ' - #' . $params['num'];
+ }
+
+ unset($params['num']);
+
+ return parent::AdminEditButton($params);
+ }
+}
\ No newline at end of file
Property changes on: units\content\content_tp.php
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ LF
admin_edit_button_themes.patch [^] (3,573 bytes) 2012-04-03 04:43
[Show Content]
Index: in-link/elements/links.elm.tpl
===================================================================
--- in-link/elements/links.elm.tpl (revision 15246)
+++ in-link/elements/links.elm.tpl (working copy)
@@ -21,7 +21,7 @@
<inp2:m_if check="IsEditorsPick"><img src="<inp2:m_TemplatesBase module="In-Portal"/>img/icon_pick.gif" alt="<inp2:m_Phrase name="lu_Pick" no_editing="1"/>"/></inp2:m_if>
<inp2:m_if check="IsFavorite"><img src="<inp2:m_TemplatesBase module="In-Portal"/>img/icon_favorite.gif" alt="<inp2:m_Phrase name="lu_Favorite" no_editing="1"/>"/></inp2:m_if>
<inp2:VotesIndicator render_as="rating_element"/>
-
+ <inp2:AdminEditButton/>
<br />
<span class="item-statistics">
<inp2:m_phrase name="lu_Added"/>: <inp2:Field name="CreatedOn" format="_regional_DateFormat"/>,
Index: in-link/links/link_paid.tpl
===================================================================
--- in-link/links/link_paid.tpl (revision 15246)
+++ in-link/links/link_paid.tpl (working copy)
@@ -486,5 +486,5 @@
<!--## /MAIN CONTENT ##-->
<!--## DESIGN TEMPLATE ##-->
-<inp2:m_include template="platform/designs/default_design.des" pass_params="1" related_to="$related_to"/>
+<inp2:m_include template="platform/designs/default_design.des" pass_params="1" related_to="$related_to" item_prefix="l"/>
<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Index: in-link/links/link_standard.tpl
===================================================================
--- in-link/links/link_standard.tpl (revision 15246)
+++ in-link/links/link_standard.tpl (working copy)
@@ -486,5 +486,5 @@
<!--## /MAIN CONTENT ##-->
<!--## DESIGN TEMPLATE ##-->
-<inp2:m_include template="platform/designs/default_design.des" pass_params="1"/>
+<inp2:m_include template="platform/designs/default_design.des" pass_params="1" item_prefix="l"/>
<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Index: platform/designs/default_design.des.tpl
===================================================================
--- platform/designs/default_design.des.tpl (revision 15246)
+++ platform/designs/default_design.des.tpl (working copy)
@@ -5,6 +5,7 @@
<inp2:m_if check="st_Field" name="RequireSSL" db="db">
<inp2:m_CheckSSL mode="required"/>
</inp2:m_if>
+<inp2:m_DefaultParam item_prefix=""/>
<inp2:m_CheckSSL/>
<inp2:m_include template="platform/elements/side_boxes.elm" strip_nl="1"/>
<inp2:m_include template="platform/elements/content_boxes.elm" strip_nl="1"/>
@@ -44,7 +45,7 @@
<!--## /Include module specific HEADER template ##-->
</head>
<body>
- <inp2:st_EditPage mode="start"/>
+ <inp2:st_EditPage mode="start" item_prefix="$item_prefix"/>
<div align="left">
<div align="left" style="width:100%">
<table class="fullwidth">
Index: platform/elements/categories.elm.tpl
===================================================================
--- platform/elements/categories.elm.tpl (revision 15246)
+++ platform/elements/categories.elm.tpl (working copy)
@@ -23,6 +23,8 @@
<inp2:m_if check="Field" name="IsNew"><img src="<inp2:m_TemplatesBase module="In-Portal"/>img/icon_new.gif" alt="<inp2:m_Phrase name="lu_New" no_editing="1"/>"/></inp2:m_if>
<inp2:m_if check="IsEditorsPick"><img src="<inp2:m_TemplatesBase module="In-Portal"/>img/icon_pick.gif" alt="<inp2:m_Phrase name="lu_Pick" no_editing="1"/>"/></inp2:m_if>
+ <inp2:AdminEditButton/>
+
<br />
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="1" height="4" alt="" /><br />
admin_edit_button_design_mode_fix.patch [^] (1,020 bytes) 2012-04-04 03:21
[Show Content]
Index: nparser.php
===================================================================
--- nparser.php (revision 15226)
+++ nparser.php (working copy)
@@ -835,14 +835,11 @@
$btn_name = 'content';
}
+ $icon_url = $base_url . 'core/admin_templates/img/top_frame/icons/' . $btn_name . '_mode.png';
+
$block_editor = '
<div id="' . $container_id . '" params="' . $param_string . '" class="' . $btn_container_class . '" title="' . htmlspecialchars($block_title) . '">
- <div class="' . $btn_class . '">
- <div class="cms-btn-image">
- <img src="' . $base_url . 'core/admin_templates/img/top_frame/icons/' . $btn_name . '_mode.png" width="15" height="16" alt=""/>
- </div>
- <div class="cms-btn-text" id="' . $container_id . '_btn">' . $btn_text . '</div>
- </div>
+ <button style="background-image: url(' . $icon_url . ');" class="cms-btn-new ' . $btn_class . '" id="' . $container_id . '_btn">' . $btn_text . '</button>
<div class="cms-btn-content">
%s
</div>
|