Index: trunk/kernel/admin_templates/img/tree/ftv2plastnode.gif
===================================================================
diff -u
Binary files differ
Index: trunk/core/admin_templates/categories/xml/tree_categories.tpl
===================================================================
diff -u
--- trunk/core/admin_templates/categories/xml/tree_categories.tpl (revision 0)
+++ trunk/core/admin_templates/categories/xml/tree_categories.tpl (revision 4464)
@@ -0,0 +1,7 @@
+
+
+ " icon="img/icons/icon24_catalog.gif" href="" load_url="">
+
+
+
+
Index: trunk/core/units/categories/categories_config.php
===================================================================
diff -u -r4457 -r4464
--- trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 4457)
+++ trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 4464)
@@ -33,7 +33,7 @@
'new_titlefield' => Array('c' => '!la_title_New_Category!'),
),
'category_list' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"),
-
+
'category_items' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Items!"),
),
@@ -48,17 +48,18 @@
'priority' => 1,
'type' => stTREE,
),
-
+
'in-portal:browse' => Array(
'parent' => 'in-portal:site',
'icon' => 'catalog',
'label' => 'la_tab_Browse',
'url' => Array('index_file' => 'browse.php', 'pass' => 'm'),
+ 'late_load' => Array('t' => 'xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
-
+
'in-portal:advanced_view' => Array(
'parent' => 'in-portal:site',
'icon' => 'advanced_view',
@@ -68,7 +69,7 @@
'priority' => 2,
'type' => stTREE,
),
-
+
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'reviews',
@@ -78,7 +79,7 @@
'priority' => 3,
'type' => stTREE,
),
-
+
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'cat_settings',
@@ -88,7 +89,7 @@
'priority' => 4,
'type' => stTREE,
),
-
+
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_search',
@@ -98,7 +99,7 @@
'priority' => 5,
'type' => stTREE,
),
-
+
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_email',
@@ -108,7 +109,7 @@
'priority' => 6,
'type' => stTREE,
),
-
+
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_custom',
@@ -118,20 +119,20 @@
'priority' => 7,
'type' => stTREE,
),
-
- ),
-
+
+ ),
+
'ListSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
-
+
'ItemSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'SubItems' => Array('c-cdata'),
-
+
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array("CurrentSort" => 'asc', 'Priority' => 'desc', 'Name' => 'asc'),
Index: trunk/kernel/units/categories/categories_config.php
===================================================================
diff -u -r4457 -r4464
--- trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 4457)
+++ trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 4464)
@@ -33,7 +33,7 @@
'new_titlefield' => Array('c' => '!la_title_New_Category!'),
),
'category_list' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"),
-
+
'category_items' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Items!"),
),
@@ -48,17 +48,18 @@
'priority' => 1,
'type' => stTREE,
),
-
+
'in-portal:browse' => Array(
'parent' => 'in-portal:site',
'icon' => 'catalog',
'label' => 'la_tab_Browse',
'url' => Array('index_file' => 'browse.php', 'pass' => 'm'),
+ 'late_load' => Array('t' => 'xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'permissions' => Array('view'),
'priority' => 1,
'type' => stTREE,
),
-
+
'in-portal:advanced_view' => Array(
'parent' => 'in-portal:site',
'icon' => 'advanced_view',
@@ -68,7 +69,7 @@
'priority' => 2,
'type' => stTREE,
),
-
+
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'reviews',
@@ -78,7 +79,7 @@
'priority' => 3,
'type' => stTREE,
),
-
+
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'cat_settings',
@@ -88,7 +89,7 @@
'priority' => 4,
'type' => stTREE,
),
-
+
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_search',
@@ -98,7 +99,7 @@
'priority' => 5,
'type' => stTREE,
),
-
+
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_email',
@@ -108,7 +109,7 @@
'priority' => 6,
'type' => stTREE,
),
-
+
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_custom',
@@ -118,20 +119,20 @@
'priority' => 7,
'type' => stTREE,
),
-
- ),
-
+
+ ),
+
'ListSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
-
+
'ItemSQLs' => Array( ''=> ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
'SubItems' => Array('c-cdata'),
-
+
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array("CurrentSort" => 'asc', 'Priority' => 'desc', 'Name' => 'asc'),
Index: trunk/kernel/admin_templates/img/tree/ftv2mnode.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tree/ftv2lastnode.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tree/ftv2pnode.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/just_close.tpl
===================================================================
diff -u
--- trunk/kernel/admin_templates/incs/just_close.tpl (revision 0)
+++ trunk/kernel/admin_templates/incs/just_close.tpl (revision 4464)
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/kernel/admin_templates/img/tree/ftv2blank.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/incs/tree.js
===================================================================
diff -u -r4357 -r4464
--- trunk/kernel/admin_templates/incs/tree.js (.../tree.js) (revision 4357)
+++ trunk/kernel/admin_templates/incs/tree.js (.../tree.js) (revision 4464)
@@ -35,7 +35,7 @@
for (var i=0; i < this.Level; i++)
{
img = document.createElement('img');
- img.src = TREE_ICONS_PATH+'ftv2blank.gif';
+ img.src = TREE_ICONS_PATH+'/ftv2blank.gif';
img.style.verticalAlign = 'middle';
td.appendChild(img);
}
@@ -61,7 +61,7 @@
img.src = this.Icon;
}
else {
- img.src = 'icons/'+this.Icon;
+ img.src = this.Icon;
}
img.style.verticalAlign = 'middle';
td.appendChild(img);
Index: trunk/kernel/admin_templates/tree.tpl
===================================================================
diff -u -r4463 -r4464
--- trunk/kernel/admin_templates/tree.tpl (.../tree.tpl) (revision 4463)
+++ trunk/kernel/admin_templates/tree.tpl (.../tree.tpl) (revision 4464)
@@ -1,6 +1,8 @@
+
+
+
+
@@ -38,11 +67,11 @@
-
+
-
+
@@ -55,34 +84,42 @@
-
-
+
+
-
-
-
-
-
- img/icons/icon24_.gif
-
+
+ " icon="img/icons/icon24_.gif">
+
+
+
+ " name="" icon="img/icons/icon24_.gif" load_url="">
-
-
+
+
-
-
+ -->
+
+
Index: trunk/kernel/admin_templates/xml/tree_categories.tpl
===================================================================
diff -u
--- trunk/kernel/admin_templates/xml/tree_categories.tpl (revision 0)
+++ trunk/kernel/admin_templates/xml/tree_categories.tpl (revision 4464)
@@ -0,0 +1,7 @@
+
+
+ " icon="img/icons/icon24_catalog.gif" href="" load_url="">
+
+
+
+
Index: trunk/kernel/admin_templates/img/tree/ftv2node.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/admin_templates/img/tree/ftv2vertline.gif
===================================================================
diff -u
Binary files differ
Index: trunk/kernel/units/admin/admin_tag_processor.php
===================================================================
diff -u -r4457 -r4464
--- trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4457)
+++ trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4464)
@@ -1,9 +1,9 @@
Application->ProcessParsedTag('m', 'Phrase', $params);
}
-
+
/**
* Returns section icon with #section# keyword replaced with current section
*
@@ -41,7 +41,7 @@
{
return replaceModuleSection($params['icon']);
}
-
+
/**
* Save module & section once passed in REQUEST for future use
*
@@ -53,7 +53,7 @@
$this->Application->LinkVar('module');
$this->Application->LinkVar('section');
}
-
+
/**
* Saves all required data for popups to return to it's parent window
*
@@ -65,7 +65,7 @@
$this->Application->LinkVar('dst_field'); // field to set value choosed in selector
$this->Application->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup)
}
-
+
/**
* Allows to detect if current template is one of listed ones
*
@@ -78,7 +78,7 @@
$t = $this->Application->GetVar('t');
return in_array($t, $templates) ? 1 : 0;
}
-
+
/**
* Save return script in cases, when old sections are opened from new sections
*
@@ -90,10 +90,10 @@
$url = str_replace($this->Application->BaseURL(), '', $this->Application->ProcessParsedTag('m', 'Link', $params) );
$url = explode('?', $url, 2);
$url = 'save_redirect.php?'.$url[1].'&do='.$url[0];
-
+
$this->Application->StoreVar('ReturnScript', $url);
}
-
+
/**
* Redirects to correct next import step template based on import script data
*
@@ -105,14 +105,14 @@
if ($import_id) {
// redirect forward to step3 (import parameters coosing)
$this->Application->StoreVar('ImportScriptID', $import_id);
-
+
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'ImportScripts
WHERE is_id = '.$import_id;
-
+
$db =& $this->Application->GetADODBConnection();
$is_params = $db->GetRow($sql);
-
+
if ($is_params['is_type'] == 'db') {
$this->Application->Redirect('', null, '', 'import/step3.php');
}
@@ -132,7 +132,7 @@
$this->Application->Redirect('', null, '', 'import/step2.php');
}
}
-
+
/**
* Returns version of module by name
*
@@ -144,7 +144,7 @@
$module_info = $this->Application->findModule('Name', $params['module']);
return $module_info['Version'];
}
-
+
/**
* Builds xml for tree in left frame in admin
*
@@ -159,44 +159,44 @@
$config =& $unit_config_reader->configData[$prefix];
$sections = getArrayValue($config, 'Sections');
if (!$sections) continue;
-
- echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections ';
-
+
+// echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections ';
+
foreach ($sections as $section_name => $section_params) {
// we could also skip not allowed sections here in future
if ($section_params['type'] != stTREE) continue;
$section_params['SectionPrefix'] = $prefix;
$section_params['url']['m_opener'] = 'r';
$section_params['url']['section'] = $section_name;
-
+
if (!isset($section_params['url']['module'])) {
$module = $this->Application->findModule('Path', $config['ModuleFolder'].'/');
$section_params['url']['module'] = $module['Name'];
}
-
+
if (!isset($section_params['url']['t'])) {
$section_params['url']['t'] = 'index';
}
-
+
$current_data = isset($this->Tree[$section_name]) ? $this->Tree[$section_name] : Array();
$this->Tree[$section_name] = array_merge_recursive2($current_data, $section_params);
-
+
$this->Tree[ $section_params['parent'] ]['children'][ "{$section_params['priority']}" ] = $section_name;
}
-
+
}
-
+
// return ''.print_r($this->Tree, true).' ';
- }
-
-
+ }
+
+
function DrawTree($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
-
+
$section_data =& $this->Tree[$section_name];
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
@@ -205,41 +205,53 @@
if (!isset($section_data['children'])) {
return $ret;
}
-
+
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$ret .= $this->DrawTree($params);
}
-
+
return $ret;
}
-
+
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$section_data =& $this->Tree[$section_name];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
-
if (!isset($section_data['children'])) {
return '';
}
-
+
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $this->Tree[$section_name];
+ $params['children_count'] = count($section_data['children']);
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
-
+
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
+
+ if (getArrayValue($section_data, 'late_load')) {
+ $late_load = getArrayValue($section_data, 'late_load');
+ $t = $late_load['t'];
+ unset($late_load['t']);
+ $section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
+ $params['children_count'] = 99;
+ }
+ else {
+ $section_data['late_load'] = '';
+ }
+
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
$params['section_name'] = $section_name;
}
-
- return $ret;
+
+ return preg_replace("/\r\n|\n/", '', $ret);
}
}
Index: trunk/core/units/admin/admin_tag_processor.php
===================================================================
diff -u -r4457 -r4464
--- trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4457)
+++ trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4464)
@@ -1,9 +1,9 @@
Application->ProcessParsedTag('m', 'Phrase', $params);
}
-
+
/**
* Returns section icon with #section# keyword replaced with current section
*
@@ -41,7 +41,7 @@
{
return replaceModuleSection($params['icon']);
}
-
+
/**
* Save module & section once passed in REQUEST for future use
*
@@ -53,7 +53,7 @@
$this->Application->LinkVar('module');
$this->Application->LinkVar('section');
}
-
+
/**
* Saves all required data for popups to return to it's parent window
*
@@ -65,7 +65,7 @@
$this->Application->LinkVar('dst_field'); // field to set value choosed in selector
$this->Application->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup)
}
-
+
/**
* Allows to detect if current template is one of listed ones
*
@@ -78,7 +78,7 @@
$t = $this->Application->GetVar('t');
return in_array($t, $templates) ? 1 : 0;
}
-
+
/**
* Save return script in cases, when old sections are opened from new sections
*
@@ -90,10 +90,10 @@
$url = str_replace($this->Application->BaseURL(), '', $this->Application->ProcessParsedTag('m', 'Link', $params) );
$url = explode('?', $url, 2);
$url = 'save_redirect.php?'.$url[1].'&do='.$url[0];
-
+
$this->Application->StoreVar('ReturnScript', $url);
}
-
+
/**
* Redirects to correct next import step template based on import script data
*
@@ -105,14 +105,14 @@
if ($import_id) {
// redirect forward to step3 (import parameters coosing)
$this->Application->StoreVar('ImportScriptID', $import_id);
-
+
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'ImportScripts
WHERE is_id = '.$import_id;
-
+
$db =& $this->Application->GetADODBConnection();
$is_params = $db->GetRow($sql);
-
+
if ($is_params['is_type'] == 'db') {
$this->Application->Redirect('', null, '', 'import/step3.php');
}
@@ -132,7 +132,7 @@
$this->Application->Redirect('', null, '', 'import/step2.php');
}
}
-
+
/**
* Returns version of module by name
*
@@ -144,7 +144,7 @@
$module_info = $this->Application->findModule('Name', $params['module']);
return $module_info['Version'];
}
-
+
/**
* Builds xml for tree in left frame in admin
*
@@ -159,44 +159,44 @@
$config =& $unit_config_reader->configData[$prefix];
$sections = getArrayValue($config, 'Sections');
if (!$sections) continue;
-
- echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections ';
-
+
+// echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections ';
+
foreach ($sections as $section_name => $section_params) {
// we could also skip not allowed sections here in future
if ($section_params['type'] != stTREE) continue;
$section_params['SectionPrefix'] = $prefix;
$section_params['url']['m_opener'] = 'r';
$section_params['url']['section'] = $section_name;
-
+
if (!isset($section_params['url']['module'])) {
$module = $this->Application->findModule('Path', $config['ModuleFolder'].'/');
$section_params['url']['module'] = $module['Name'];
}
-
+
if (!isset($section_params['url']['t'])) {
$section_params['url']['t'] = 'index';
}
-
+
$current_data = isset($this->Tree[$section_name]) ? $this->Tree[$section_name] : Array();
$this->Tree[$section_name] = array_merge_recursive2($current_data, $section_params);
-
+
$this->Tree[ $section_params['parent'] ]['children'][ "{$section_params['priority']}" ] = $section_name;
}
-
+
}
-
+
// return ''.print_r($this->Tree, true).' ';
- }
-
-
+ }
+
+
function DrawTree($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
-
+
$section_data =& $this->Tree[$section_name];
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
@@ -205,41 +205,53 @@
if (!isset($section_data['children'])) {
return $ret;
}
-
+
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$ret .= $this->DrawTree($params);
}
-
+
return $ret;
}
-
+
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$section_data =& $this->Tree[$section_name];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
-
if (!isset($section_data['children'])) {
return '';
}
-
+
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $this->Tree[$section_name];
+ $params['children_count'] = count($section_data['children']);
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
-
+
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
+
+ if (getArrayValue($section_data, 'late_load')) {
+ $late_load = getArrayValue($section_data, 'late_load');
+ $t = $late_load['t'];
+ unset($late_load['t']);
+ $section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
+ $params['children_count'] = 99;
+ }
+ else {
+ $section_data['late_load'] = '';
+ }
+
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
$params['section_name'] = $section_name;
}
-
- return $ret;
+
+ return preg_replace("/\r\n|\n/", '', $ret);
}
}
Index: trunk/kernel/admin_templates/img/tree/ftv2mlastnode.gif
===================================================================
diff -u
Binary files differ
|