Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Jul 20, 1:43 AM

in-portal

Index: trunk/kernel/units/categories/categories_config.php
===================================================================
--- trunk/kernel/units/categories/categories_config.php (revision 4463)
+++ trunk/kernel/units/categories/categories_config.php (revision 4464)
@@ -1,203 +1,204 @@
<?php
$config = Array(
'Prefix' => 'c',
'ItemClass' => Array('class'=>'CategoriesItem','file'=>'categories_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'CategoriesEventHandler','file'=>'categories_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'CategoriesTagProcessor','file'=>'categories_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'AggregateTags' => Array(
Array(
'AggregateTo' => 'm',
'AggregatedTagName' => 'CategoryLink',
'LocalTagName' => 'CategoryLink',
),
),
'IDField' => 'CategoryId',
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'ItemType' => 1, // used for custom fields only
'TableName' => TABLE_PREFIX.'Category',
'ViewMenuPhrase' => 'la_text_Categories',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('c' => '!la_title_Adding_Category!'),
'edit_status_labels' => Array('c' => '!la_title_Editing_Category!'),
'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!"),
),
'Sections' => Array(
// "Structure & Data" section
'in-portal:site' => Array(
'parent' => 'in-portal:root',
'icon' => 'struct',
'label' => 'la_tab_Site_Structure',
'url' => Array('index_file' => 'subitems.php', 'pass' => 'm'),
'permissions' => Array('view'),
'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',
'label' => 'la_tab_AdvancedView',
'url' => Array('index_file' => 'advanced_view.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
-
+
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'reviews',
'label' => 'la_tab_Reviews',
'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
-
+
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'cat_settings',
'label' => 'la_tab_Settings',
'url' => Array('index_file' => 'config/edit_config.php', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
-
+
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array('t' => 'config/config_search', 'index_file' => 'index4.php', 'module_key' => 'category', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
-
+
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Category', 'lpn' => 1, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
-
+
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'index_file' => 'index4.php', 'cf_type' => 1, 'pass' => 'm,cf'),
'permissions' => Array('view', 'edit', 'delete'),
'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'),
'Sorting' => Array('Name' => 'asc'),
)
),
'CalculatedFields' => Array(
'' => Array(
'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')",
)
),
'Fields' => Array
(
'CategoryId' => Array('type' => 'int','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ParentId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
'Filename' => Array('type' => 'string','not_null' => '1','default' => ''),
'AutomaticFilename' => Array('type' => 'int','not_null' => '1','default' => '1'),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'not_null' => '1'),
'EditorsPick' => Array('type' => 'int','default' => ''),
'Status' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Pop' => Array('type' => 'int','default' => ''),
'Priority' => Array('type' => 'int','default' => ''),
'MetaKeywords' => Array('type' => 'string','default' => ''),
'CachedDescendantCatsQty' => Array('type' => 'int','default' => ''),
'CachedNavbar' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ResourceId' => Array('type' => 'int','default' => ''),
'ParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'NamedParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'MetaDescription' => Array('type' => 'string','default' => ''),
'HotItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'NewItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'PopItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'Modified' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ModifiedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'CategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'ItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedCategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
),
'VirtualFields' => Array(
'CurrentSort' => Array('type' => 'string', 'default' => ''),
'IsNew' => Array('type' => 'int', 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_cat.gif'),
'Fields' => Array(
'Name' => Array( 'width'=>150, 'title'=>'la_col_Title', 'data_block'=>'category_td' ),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_Category',
'DefaultSorting1Field' => 'Category_Sortfield',
'DefaultSorting2Field' => 'Category_Sortfield2',
'DefaultSorting1Dir' => 'Category_Sortorder',
'DefaultSorting2Dir' => 'Category_Sortorder2',
),
);
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/categories/categories_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.18
\ No newline at end of property
+1.19
\ No newline at end of property
Index: trunk/kernel/units/admin/admin_tag_processor.php
===================================================================
--- trunk/kernel/units/admin/admin_tag_processor.php (revision 4463)
+++ trunk/kernel/units/admin/admin_tag_processor.php (revision 4464)
@@ -1,246 +1,258 @@
<?php
-
+
class AdminTagProcessor extends kDBTagProcessor {
-
+
var $Tree = Array();
-
+
/**
* Allows to execute js script after the page is fully loaded
*
* @param Array $params
* @return string
*/
function AfterScript($params)
{
$after_script = $this->Application->GetVar('after_script');
if ($after_script) {
return '<script type="text/javascript">'.$after_script.'</script>';
}
return '';
}
-
+
/**
* Returns section title with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionTitle($params)
{
$params['name'] = replaceModuleSection($params['phrase']);
return $this->Application->ProcessParsedTag('m', 'Phrase', $params);
}
-
+
/**
* Returns section icon with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionIcon($params)
{
return replaceModuleSection($params['icon']);
}
-
+
/**
* Save module & section once passed in REQUEST for future use
*
* @param Array $params
*/
function StoreSystemVars($params)
{
// save theese variables to session, because they are useful for most configuration templates
$this->Application->LinkVar('module');
$this->Application->LinkVar('section');
}
-
+
/**
* Saves all required data for popups to return to it's parent window
*
* @param Array $params
*/
function StoreMainPrefix($params)
{
$this->Application->LinkVar('main_prefix'); // window prefix, that opener selector
$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
*
* @param Array $params
* @return int
*/
function TemplateMatches($params)
{
$templates = explode(',' ,$params['templates']);
$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
*
* @param Array $params
*/
function SaveReturnScript($params)
{
// admin/save_redirect.php?do=
$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
*
* @param Array $params
*/
function ImportRedirect($params)
{
$import_id = $this->Application->GetVar('import_id');
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');
}
elseif ($is_params['is_type'] == 'csv') {
$module = strtolower($is_params['is_Module']);
$template = $module.'/import';
$sql = 'SELECT Var
FROM '.TABLE_PREFIX.'Modules
WHERE LOWER(Name) = '.$db->qstr($module);
$item_prefix = $db->GetOne($sql);
$pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import');
$this->Application->Redirect($template, $pass_params);
}
}
else {
// redirect back to step2 (import type choosing)
$this->Application->Redirect('', null, '', 'import/step2.php');
}
}
-
+
/**
* Returns version of module by name
*
* @param Array $params
* @return string
*/
function ModuleVersion($params)
{
$module_info = $this->Application->findModule('Name', $params['module']);
return $module_info['Version'];
}
-
+
/**
* Builds xml for tree in left frame in admin
*
* @param Array $params
*/
function BuildTree($params)
{
$this->Tree = Array();
$unit_config_reader =& $this->Application->recallObject('kUnitConfigReader');
$prefixes = array_keys($unit_config_reader->configData);
foreach ($prefixes as $prefix) {
$config =& $unit_config_reader->configData[$prefix];
$sections = getArrayValue($config, 'Sections');
if (!$sections) continue;
-
- echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections<br />';
-
+
+// echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections<br />';
+
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 '<pre>'.print_r($this->Tree, true).'</pre>';
- }
-
-
+ }
+
+
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']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
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);
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/admin/admin_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/just_close.tpl
===================================================================
--- trunk/kernel/admin_templates/incs/just_close.tpl (nonexistent)
+++ trunk/kernel/admin_templates/incs/just_close.tpl (revision 4464)
@@ -0,0 +1,14 @@
+<html>
+<head>
+<title>
+
+</title>
+</head>
+<body>
+<script type="text/javascript">
+ //alert('<inp2:m_t t="dummy" opener="u" escape="escape"/>');
+ window.close();
+ window.opener.focus();
+</script>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/incs/just_close.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/tree.js
===================================================================
--- trunk/kernel/admin_templates/incs/tree.js (revision 4463)
+++ trunk/kernel/admin_templates/incs/tree.js (revision 4464)
@@ -1,349 +1,349 @@
function TreeItem(title, url, icon)
{
this.Title = title;
this.Url = url;
this.Rendered = false;
this.Displayed = false;
this.Level = 0;
this.Icon = icon;
}
TreeItem.prototype.Render = function(before)
{
if (!this.Rendered) {
if (!isset(before)) {before = null}
tr = document.createElement('tr');
this.ParentElement.insertBefore(tr, before);
if (!this.Displayed) { tr.style.display = 'none' }
td = document.createElement('td');
td.TreeElement = this;
tr.appendChild(td);
this.appendLevel(td);
if (this.ParentFolder != null) this.appendNodeImage(td);
this.appendIcon(td);
this.appendLink(td);
this.Tr = tr;
this.Rendered = true;
}
}
TreeItem.prototype.appendLevel = function(td)
{
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);
}
}
TreeItem.prototype.getNodeImage = function(is_last)
{
return is_last ? TREE_ICONS_PATH+'/ftv2lastnode.gif' : TREE_ICONS_PATH+'/ftv2node.gif';
}
TreeItem.prototype.appendNodeImage = function(td)
{
img = document.createElement('img');
img.src = this.getNodeImage();
img.style.verticalAlign = 'middle';
td.appendChild(img);
}
TreeItem.prototype.appendIcon = function (td)
{
img = document.createElement('img');
if (this.Icon.indexOf('http://') != -1) {
img.src = this.Icon;
}
else {
- img.src = 'icons/'+this.Icon;
+ img.src = this.Icon;
}
img.style.verticalAlign = 'middle';
td.appendChild(img);
}
TreeItem.prototype.appendLink = function (td)
{
link = document.createElement('a');
link.nodeValue = this.Title;
link.href = this.Url;
link.target = 'main';
link.appendChild( document.createTextNode(this.Title) )
td.appendChild( link );
// td.appendChild( document.createTextNode(this.Title) );
}
TreeItem.prototype.display = function()
{
this.Tr.style.display = 'block';
this.Displayed = true;
}
TreeItem.prototype.hide = function()
{
this.Tr.style.display = 'none';
this.Displayed = false;
}
TreeItem.prototype.expand = function() { this.display() }
TreeItem.prototype.collapse = function() { this.hide() }
TreeItem.prototype.updateLastNodes = function(is_last, lines_pattern)
{
if (!isset(is_last)) is_last = true;
if (!isset(this.Tr)) return;
if (!isset(lines_pattern)) { var lines_pattern = new Array() }
imgs = this.Tr.getElementsByTagName('img');
found = false;
for (var i=0; i<imgs.length; i++)
{
the_img = imgs.item(i);
if (in_array(i, lines_pattern) && the_img.src.indexOf('ftv2blank.gif') != -1) {
the_img.src = TREE_ICONS_PATH+'/ftv2vertline.gif';
}
if (this.isNodeImage(the_img))
{
found = true;
break;
}
}
if (found) {
the_img.src = this.getNodeImage(is_last);
}
this.isLast = is_last;
return lines_pattern;
}
TreeItem.prototype.isNodeImage = function(img)
{
return (
img.src.indexOf('ftv2node.gif') != -1 ||
img.src.indexOf('ftv2lastnode.gif') != -1
)
}
TreeItem.prototype.locateLastItem = function()
{
return this;
}
/* FOLDER */
function TreeFolder(parent_id, title, url, icon, late_load_url)
{
var render = false;
if (isset(parent_id)) {
this.ParentElement = document.getElementById(parent_id);
render = true;
}
this.Title = title;
this.Url = url;
this.Rendered = false;
this.Displayed = false;
this.Expanded = false;
this.Level = 0;
this.Tr = null;
this.Icon = icon;
this.LateLoadURL = isset(late_load_url) ? late_load_url : false;
this.Loaded = false;
this.Children = new Array();
this.ChildIndex = 0;
if (render) {
this.Expanded = true;
this.Displayed = true;
this.Render();
this.expand();
}
}
TreeFolder.prototype = new TreeItem;
TreeFolder.prototype.locateLastItem = function()
{
if (this.Children.length == 0) return this;
for (var i=0; i<this.Children.length; i++)
{
last_item = this.Children[i].locateLastItem()
}
return last_item;
}
TreeFolder.prototype.locateTopItem = function()
{
if (this.ParentFolder == null) return this;
return this.ParentFolder.locateTopItem();
}
TreeFolder.prototype.AddItem = function(an_item, render, display) {
an_item.ParentElement = this.ParentElement;
an_item.Level = this.ParentFolder != null ? this.Level + 1 : 0;
an_item.ParentFolder = this;
last_item = this.locateLastItem();
this.Children.push(an_item);
an_item.Render(last_item.Tr.nextSibling);
this.locateTopItem().updateLastNodes();
if (this.Expanded)
{
an_item.display();
}
return an_item;
}
TreeFolder.prototype.AddFromXML = function(xml, render)
{
if (!isset(render)) render = true;
doc = getDocumentFromXML(xml);
this.LastFolder = this;
this.ProcessXMLNode(doc, render);
}
TreeFolder.prototype.ProcessXMLNode = function(node, render)
{
if (!isset(render)) render = true;
if (!isset(this.LastFolder)) this.LastFolder = this;
for (var i=0; i<node.childNodes.length; i++)
{
child = node.childNodes.item(i);
if (child.tagName == 'folder') {
this.LastFolder = this.LastFolder.AddItem(new TreeFolder(null, child.getAttribute('name'), child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('load_url')), render);
if (child.hasChildNodes) {
this.ProcessXMLNode(child);
}
this.LastFolder = this;
}
else if (child.tagName == 'item') {
this.LastFolder.AddItem(new TreeItem(child.firstChild.nodeValue, child.getAttribute('href'), child.getAttribute('icon')), render)
}
else if (child.tagName == 'tree') {
this.ProcessXMLNode(child);
}
}
}
TreeFolder.prototype.getNodeImage = function(is_last)
{
if (is_last) {
return this.Expanded ? TREE_ICONS_PATH+'/ftv2mlastnode.gif' : TREE_ICONS_PATH+'/ftv2plastnode.gif';
}
else {
return this.Expanded ? TREE_ICONS_PATH+'/ftv2mnode.gif' : TREE_ICONS_PATH+'/ftv2pnode.gif';
}
}
TreeFolder.prototype.appendNodeImage = function(td, is_last)
{
img = document.createElement('img');
img.src = this.getNodeImage(is_last);
img.style.cursor = 'hand';
img.style.cursor = 'pointer';
img.style.verticalAlign = 'middle';
img.onclick = function() { this.parentNode.TreeElement.folderClick(this) }
this.Img = img;
td.appendChild(img);
}
TreeFolder.prototype.updateLastNodes = function(is_last, lines_pattern)
{
if (!isset(is_last)) is_last = true;
if (!isset(lines_pattern)) { var lines_pattern = new Array() }
if (!is_last && !in_array(this.Level, lines_pattern)) { lines_pattern.push(this.Level) }
lines_pattern = TreeItem.prototype.updateLastNodes.apply(this, new Array(is_last, lines_pattern))
for (var i=0; i<this.Children.length; i++)
{
lines_pattern = this.Children[i].updateLastNodes((i+1) == this.Children.length, lines_pattern)
}
lines_pattern[array_search(this.Level, lines_pattern)] = -1;
return lines_pattern;
}
TreeFolder.prototype.isNodeImage = function(img)
{
return (
img.src.indexOf('ftv2mlastnode.gif') != -1 ||
img.src.indexOf('ftv2plastnode.gif') != -1 ||
img.src.indexOf('ftv2mnode.gif') != -1 ||
img.src.indexOf('ftv2pnode.gif') != -1
)
}
TreeFolder.prototype.folderClick = function(img)
{
if (this.LateLoadURL && !this.Loaded) {
request = getXMLHTTPObject('text/xml');
if (request && request.readyState != 0) {
request.abort();
}
request.open('POST', this.LateLoadURL, true);
request.setRequestHeader("referer", this.LateLoadURL);
obj = this;
function processLateLoad() {
if (request.readyState == 4) {
if (request.status == 200) {
obj.ProcessXMLNode(request.responseXML);
obj.Loaded = true;
obj.Render();
obj.expand();
}
}
}
request.onreadystatechange = processLateLoad;
request.send('is_xml=1');
}
if (this.Expanded) {
this.collapse();
}
else {
this.expand();
}
}
TreeFolder.prototype.expand = function(mode)
{
if (!isset(mode)) mode = 0;
this.display();
if (mode == 0 || this.Expanded ) {
for (var i=0; i<this.Children.length; i++)
{
this.Children[i].expand(mode+1);
}
}
if (mode == 0) {
this.Expanded = true;
if (isset(this.Img)) {
this.Img.src = this.getNodeImage(this.isLast);
}
}
}
TreeFolder.prototype.collapse = function(mode)
{
if (!isset(mode)) mode = 0;
for (var i=0; i<this.Children.length; i++)
{
this.Children[i].collapse(mode+1);
this.Children[i].hide();
}
if (mode == 0) {
this.Expanded = false;
if (isset(this.Img)) {
this.Img.src = this.getNodeImage(this.isLast);
}
}
}
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/incs/tree.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/kernel/admin_templates/tree.tpl
===================================================================
--- trunk/kernel/admin_templates/tree.tpl (revision 4463)
+++ trunk/kernel/admin_templates/tree.tpl (revision 4464)
@@ -1,96 +1,133 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
+
+
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#DCEBF6">
<script type="text/javascript">
function credits(url)
{
var width = 200;
var height = 200;
var screen_x = (screen.availWidth-width)/2;
var screen_y = (screen.availHeight-height)/2;
window.open(url, 'credits', 'width=280,height=520,left='+screen_x+',top='+screen_y);
}
</script>
+<script src="incs/tree.js"></script>
+
<style type="text/css">
.tree_head.td, .tree_head, .tree_head:hover {
font-weight: bold;
font-size: 10px;
color: #FFFFFF;
font-family: Verdana, Arial;
text-decoration: none;
}
+
+ .tree {
+ padding: 0px;
+ border: none;
+ border-collapse: collapse;
+ }
+
+ .tree tr td {
+ padding: 0px;
+ margin: 0px;
+ font-family: arial,verdana;
+ font-size: 10pt;
+ }
+
+ .tree tr td a {
+ font-family: arial,verdana;
+ font-size: 10pt;
+ color: black;
+ text-decoration: none;
+ }
+
+ .tree tr td a:hover {
+ color: blue;
+ }
+
</style>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr style="background: #5291DE url(img/menu_bar.gif) repeat-x left bottom;" class="tree_head">
<td align="left" width="80%" height="21">
&nbsp;<a class="tree_head" href="javascript:credits('<inp2:m_Link index_file="help/credits.php" destform="popup"/>');">In-Portal v <inp2:adm_ModuleVersion module="In-Portal"/></a>
</td>
<td align="right" width="20%">
<select name="language" style="width: 62px; border: 0px; background-color: #FFFFFF; font-size: 9px; color: black;" onchange="submit_event('lang', 'OnChangeLanguage');">
<inp2:m_DefineElement name="lang_elem">
<option value="<inp2:Field name="LanguageId"/>" <inp2:m_if check="SelectedLanguage">selected="selected"</inp2:m_if> ><inp2:Field name="PackName"/></option>
</inp2:m_DefineElement>
<inp2:lang_ListLanguages render_as="lang_elem" row_start_render_as="html:" row_end_render_as="html:"/>
</select>
</td>
</tr>
-
+
<tr>
<td colspan="2">
<inp2:adm_BuildTree/>
-
+
<!-- printing section as table: begin -->
<inp2:m_DefineElement name="tree_element">
<tr>
<td><inp2:m_param name="parent"/></td>
<td> -> </td>
<td>
<a href="<inp2:m_param name="section_url"/>" title="<inp2:m_phrase name="$label"/>" target="main">
<img src="<inp2:$SectionPrefix_ModulePath/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" border="0" alt="<inp2:m_phrase name="$label"/>" align="absmiddle"/>
<inp2:m_phrase name="$label"/></a> (<inp2:m_param name="section_name"/>)
</td>
</tr>
</inp2:m_DefineElement>
-
- <table>
+
+ <!--<table>
<thead>
<td colspan="2"><b>Parent</b></td>
<td><b>Child</b></td>
</thead>
<inp2:adm_DrawTree render_as="tree_element" section_name="in-portal:root"/>
- </table>
+ </table>-->
<!-- printing section as table: end- ->
-
+
<!-- printing section as xml: begin -->
<inp2:m_DefineElement name="xml_node">
- <node>
- <parent_section><inp2:m_param name="parent"/></parent_section>
- <section_url><inp2:m_param name="section_url"/></section_url>
- <section_name><inp2:m_param name="section_name"/></section_name>
- <section_title><inp2:m_phrase name="$label"/></section_title>
- <section_icon><inp2:$SectionPrefix_ModulePath/>img/icons/icon24_<inp2:m_param name="icon"/>.gif</section_icon>
- <sub_nodes>
+ <inp2:m_if check="m_ParamEquals" param="children_count" value="0">
+ <item href="<inp2:m_param name="section_url"/>" icon="<inp2:$SectionPrefix_ModulePath/>img/icons/icon24_<inp2:m_param name="icon"/>.gif">
+ <inp2:m_phrase name="$label" escape="1"/>
+ </item>
+ <inp2:m_else/>
+ <folder href="<inp2:m_param name="section_url"/>" name="<inp2:m_phrase name="$label" escape="1"/>" icon="<inp2:$SectionPrefix_ModulePath/>img/icons/icon24_<inp2:m_param name="icon"/>.gif" load_url="<inp2:m_param name="late_load"/>">
<inp2:adm_PrintSections render_as="xml_node" section_name="$section_name"/>
- </sub_nodes>
- </node>
+ </folder>
+ </inp2:m_if>
</inp2:m_DefineElement>
-
- <!--<nodes>
+
+ <!--<tree>
<inp2:adm_PrintSections render_as="xml_node" section_name="in-portal:root"/>
- </nodes>-->
+ </tree>-->
<!-- printing section as xml: end -->
+ <table class="tree">
+ <tbody id="tree">
+ </tbody>
+ </table>
+ <script type="text/javascript">
+ var TREE_ICONS_PATH = 'img/tree'
+ var the_tree = new TreeFolder('tree', 'Root', 'http://www.folder.com', 'http://kostja.prod.intechnic.lv/in-portal/admin/icons/icon24_site.gif');
+ the_tree.AddFromXML('<tree><inp2:adm_PrintSections render_as="xml_node" section_name="in-portal:root"/></tree>');
+ </script>
</td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
<script type="text/javascript">
var $kf = document.getElementById($form_name);
$kf.target = 'main_frame';
$kf.action = '<inp2:m_t pass="" index_file="index.php" escape="1"/>';
</script>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/tree.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/kernel/admin_templates/xml/tree_categories.tpl
===================================================================
--- trunk/kernel/admin_templates/xml/tree_categories.tpl (nonexistent)
+++ trunk/kernel/admin_templates/xml/tree_categories.tpl (revision 4464)
@@ -0,0 +1,7 @@
+<inp2:m_XMLTemplate/>
+<inp2:m_DefineElement name="category">
+ <folder name="<inp2:Field name="Name"/>" icon="<inp2:c_ModulePath/>img/icons/icon24_catalog.gif" href="<inp2:CategoryLink index_file="browse.php" template="catalog" pass="m"/>" load_url="<inp2:CategoryLink pass="m"/>"></folder>
+</inp2:m_DefineElement>
+<tree>
+<inp2:c_ListCategories render_as="category" row_start_render_as="html:" row_end_render_as="html:"/>
+</tree>
Property changes on: trunk/kernel/admin_templates/xml/tree_categories.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2lastnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2lastnode.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2plastnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2plastnode.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2mnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2mnode.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2node.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2node.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2pnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2pnode.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2mlastnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2mlastnode.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2blank.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2blank.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/kernel/admin_templates/img/tree/ftv2vertline.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/kernel/admin_templates/img/tree/ftv2vertline.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/core/units/categories/categories_config.php
===================================================================
--- trunk/core/units/categories/categories_config.php (revision 4463)
+++ trunk/core/units/categories/categories_config.php (revision 4464)
@@ -1,203 +1,204 @@
<?php
$config = Array(
'Prefix' => 'c',
'ItemClass' => Array('class'=>'CategoriesItem','file'=>'categories_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'CategoriesEventHandler','file'=>'categories_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'CategoriesTagProcessor','file'=>'categories_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'AggregateTags' => Array(
Array(
'AggregateTo' => 'm',
'AggregatedTagName' => 'CategoryLink',
'LocalTagName' => 'CategoryLink',
),
),
'IDField' => 'CategoryId',
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'ItemType' => 1, // used for custom fields only
'TableName' => TABLE_PREFIX.'Category',
'ViewMenuPhrase' => 'la_text_Categories',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('c' => '!la_title_Adding_Category!'),
'edit_status_labels' => Array('c' => '!la_title_Editing_Category!'),
'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!"),
),
'Sections' => Array(
// "Structure & Data" section
'in-portal:site' => Array(
'parent' => 'in-portal:root',
'icon' => 'struct',
'label' => 'la_tab_Site_Structure',
'url' => Array('index_file' => 'subitems.php', 'pass' => 'm'),
'permissions' => Array('view'),
'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',
'label' => 'la_tab_AdvancedView',
'url' => Array('index_file' => 'advanced_view.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 2,
'type' => stTREE,
),
-
+
'in-portal:reviews' => Array(
'parent' => 'in-portal:site',
'icon' => 'reviews',
'label' => 'la_tab_Reviews',
'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 3,
'type' => stTREE,
),
-
+
'in-portal:configure_categories' => Array(
'parent' => 'in-portal:site',
'icon' => 'cat_settings',
'label' => 'la_tab_Settings',
'url' => Array('index_file' => 'config/edit_config.php', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
-
+
'in-portal:configuration_search' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array('t' => 'config/config_search', 'index_file' => 'index4.php', 'module_key' => 'category', 'pass' => 'm'),
'permissions' => Array('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
-
+
'in-portal:configuration_email' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Category', 'lpn' => 1, 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
-
+
'in-portal:configuration_custom' => Array(
'parent' => 'in-portal:site',
'icon' => 'settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array('t' => 'custom_fields/custom_fields_list', 'index_file' => 'index4.php', 'cf_type' => 1, 'pass' => 'm,cf'),
'permissions' => Array('view', 'edit', 'delete'),
'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'),
'Sorting' => Array('Name' => 'asc'),
)
),
'CalculatedFields' => Array(
'' => Array(
'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')",
)
),
'Fields' => Array
(
'CategoryId' => Array('type' => 'int','not_null' => '1','default' => ''),
'Type' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ParentId' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
'Filename' => Array('type' => 'string','not_null' => '1','default' => ''),
'AutomaticFilename' => Array('type' => 'int','not_null' => '1','default' => '1'),
'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'not_null' => '1'),
'EditorsPick' => Array('type' => 'int','default' => ''),
'Status' => Array('type' => 'int','not_null' => '1','default' => '0'),
'Pop' => Array('type' => 'int','default' => ''),
'Priority' => Array('type' => 'int','default' => ''),
'MetaKeywords' => Array('type' => 'string','default' => ''),
'CachedDescendantCatsQty' => Array('type' => 'int','default' => ''),
'CachedNavbar' => Array('type' => 'string','not_null' => '1','default' => ''),
'CreatedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ResourceId' => Array('type' => 'int','default' => ''),
'ParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'NamedParentPath' => Array('type' => 'string','not_null' => '1','default' => ''),
'MetaDescription' => Array('type' => 'string','default' => ''),
'HotItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'NewItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'PopItem' => Array('type' => 'int','not_null' => '1','default' => '2'),
'Modified' => Array('type' => 'int','not_null' => '1','default' => '0'),
'ModifiedById' => Array('type' => 'int','not_null' => '1','default' => '0'),
'CategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'ItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedCategoryTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
'CachedItemTemplate' => Array('type' => 'string','not_null' => '1','default' => ''),
),
'VirtualFields' => Array(
'CurrentSort' => Array('type' => 'string', 'default' => ''),
'IsNew' => Array('type' => 'int', 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_cat.gif'),
'Fields' => Array(
'Name' => Array( 'width'=>150, 'title'=>'la_col_Title', 'data_block'=>'category_td' ),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Perpage_Category',
'DefaultSorting1Field' => 'Category_Sortfield',
'DefaultSorting2Field' => 'Category_Sortfield2',
'DefaultSorting1Dir' => 'Category_Sortorder',
'DefaultSorting2Dir' => 'Category_Sortorder2',
),
);
?>
\ No newline at end of file
Property changes on: trunk/core/units/categories/categories_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.18
\ No newline at end of property
+1.19
\ No newline at end of property
Index: trunk/core/units/admin/admin_tag_processor.php
===================================================================
--- trunk/core/units/admin/admin_tag_processor.php (revision 4463)
+++ trunk/core/units/admin/admin_tag_processor.php (revision 4464)
@@ -1,246 +1,258 @@
<?php
-
+
class AdminTagProcessor extends kDBTagProcessor {
-
+
var $Tree = Array();
-
+
/**
* Allows to execute js script after the page is fully loaded
*
* @param Array $params
* @return string
*/
function AfterScript($params)
{
$after_script = $this->Application->GetVar('after_script');
if ($after_script) {
return '<script type="text/javascript">'.$after_script.'</script>';
}
return '';
}
-
+
/**
* Returns section title with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionTitle($params)
{
$params['name'] = replaceModuleSection($params['phrase']);
return $this->Application->ProcessParsedTag('m', 'Phrase', $params);
}
-
+
/**
* Returns section icon with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionIcon($params)
{
return replaceModuleSection($params['icon']);
}
-
+
/**
* Save module & section once passed in REQUEST for future use
*
* @param Array $params
*/
function StoreSystemVars($params)
{
// save theese variables to session, because they are useful for most configuration templates
$this->Application->LinkVar('module');
$this->Application->LinkVar('section');
}
-
+
/**
* Saves all required data for popups to return to it's parent window
*
* @param Array $params
*/
function StoreMainPrefix($params)
{
$this->Application->LinkVar('main_prefix'); // window prefix, that opener selector
$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
*
* @param Array $params
* @return int
*/
function TemplateMatches($params)
{
$templates = explode(',' ,$params['templates']);
$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
*
* @param Array $params
*/
function SaveReturnScript($params)
{
// admin/save_redirect.php?do=
$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
*
* @param Array $params
*/
function ImportRedirect($params)
{
$import_id = $this->Application->GetVar('import_id');
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');
}
elseif ($is_params['is_type'] == 'csv') {
$module = strtolower($is_params['is_Module']);
$template = $module.'/import';
$sql = 'SELECT Var
FROM '.TABLE_PREFIX.'Modules
WHERE LOWER(Name) = '.$db->qstr($module);
$item_prefix = $db->GetOne($sql);
$pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import');
$this->Application->Redirect($template, $pass_params);
}
}
else {
// redirect back to step2 (import type choosing)
$this->Application->Redirect('', null, '', 'import/step2.php');
}
}
-
+
/**
* Returns version of module by name
*
* @param Array $params
* @return string
*/
function ModuleVersion($params)
{
$module_info = $this->Application->findModule('Name', $params['module']);
return $module_info['Version'];
}
-
+
/**
* Builds xml for tree in left frame in admin
*
* @param Array $params
*/
function BuildTree($params)
{
$this->Tree = Array();
$unit_config_reader =& $this->Application->recallObject('kUnitConfigReader');
$prefixes = array_keys($unit_config_reader->configData);
foreach ($prefixes as $prefix) {
$config =& $unit_config_reader->configData[$prefix];
$sections = getArrayValue($config, 'Sections');
if (!$sections) continue;
-
- echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections<br />';
-
+
+// echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections<br />';
+
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 '<pre>'.print_r($this->Tree, true).'</pre>';
- }
-
-
+ }
+
+
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']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
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);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/admin/admin_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/admin_templates/categories/xml/tree_categories.tpl
===================================================================
--- trunk/core/admin_templates/categories/xml/tree_categories.tpl (nonexistent)
+++ trunk/core/admin_templates/categories/xml/tree_categories.tpl (revision 4464)
@@ -0,0 +1,7 @@
+<inp2:m_XMLTemplate/>
+<inp2:m_DefineElement name="category">
+ <folder name="<inp2:Field name="Name"/>" icon="<inp2:c_ModulePath/>img/icons/icon24_catalog.gif" href="<inp2:CategoryLink index_file="browse.php" template="catalog" pass="m"/>" load_url="<inp2:CategoryLink pass="m"/>"></folder>
+</inp2:m_DefineElement>
+<tree>
+<inp2:c_ListCategories render_as="category" row_start_render_as="html:" row_end_render_as="html:"/>
+</tree>
Property changes on: trunk/core/admin_templates/categories/xml/tree_categories.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline