- style="display: none;">
-
-
-
-
-
-
-
-
-
- |
+ |
-
+
@@ -563,6 +554,23 @@
return jq(''.replace('#FIELD_NAME#', $field));
}
+ CategorySelector.getCategoryPath = function ($cat_id, $field) {
+ Request.makeRequest('&cat_id=' + $cat_id, false, '', function(request) {
+ var $field_id = CategorySelector.getField($field);
+ $('#' + $field_id + '_path').html(request.responseText);
+ if ($cat_id) {
+ $('#' + $field_id).val($cat_id);
+ $('#' + $field_id + '_path').show();
+ $('#' + $field_id + '_disable_link').show();
+ }
+ });
+ }
+
+ CategorySelector.processCallback = function ($data) {
+ $data = eval('(' + $data + ')');;
+ this.getCategoryPath($data['ids'],$data['dst_field']);
+ }
+
CategorySelector.disableCategory = function ($field) {
var $field_id = this.getField($field);
@@ -572,8 +580,8 @@
$(document).ready(
function() {
+ CategorySelector.getCategoryPath('','');
var $field_id = CategorySelector.getField('');
-
$('#' + $field_id + '_disable_link').click(
function ($e) {
CategorySelector.disableCategory('');
Index: units/admin/admin_tag_processor.php
===================================================================
--- units/admin/admin_tag_processor.php (revision 14868)
+++ units/admin/admin_tag_processor.php (working copy)
@@ -486,6 +486,11 @@
unset($params['tab_prefixes']);
}
+ if (isset($params['is_ajax_result'])) { // {yes, no}
+ $pass_through['ta'] = $params['is_ajax_result'];
+ unset($params['is_ajax_result']);
+ }
+
if ($pass_through) {
// add pass_through to selector url if any
$params['pass_through'] = implode(',', array_keys($pass_through));
Index: units/categories/categories_event_handler.php
===================================================================
--- units/categories/categories_event_handler.php (revision 14868)
+++ units/categories/categories_event_handler.php (working copy)
@@ -244,13 +244,23 @@
*/
function OnProcessSelected(&$event)
{
+ $selected_ids = $this->Application->GetVar('selected_ids');
+ $dst_field = $this->Application->RecallVar('dst_field');
+
+ if ($this->Application->GetVar('ajax') == 'yes') {
+ $event->status = kEvent::erSTOP;
+ echo json_encode(Array (
+ 'ids' => $selected_ids['c'],
+ 'dst_field' => $dst_field,
+ ));
+ return;
+ }
+
$object =& $event->getObject();
/* @var $object kDBItem */
- $selected_ids = $this->Application->GetVar('selected_ids');
-
$this->RemoveRequiredFields($object);
- $object->SetDBField($this->Application->RecallVar('dst_field'), $selected_ids['c']);
+ $object->SetDBField($dst_field, $selected_ids['c']);
$object->Update();
$event->SetRedirectParam('opener', 'u');
|