Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1159995
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Sep 18, 10:12 PM
Size
64 KB
Mime Type
text/x-diff
Expires
Sat, Sep 20, 10:12 PM (1 h, 15 m)
Engine
blob
Format
Raw Data
Handle
748325
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/kernel/units/admin/admin_tag_processor.php
===================================================================
--- trunk/kernel/units/admin/admin_tag_processor.php (revision 4683)
+++ trunk/kernel/units/admin/admin_tag_processor.php (revision 4684)
@@ -1,272 +1,283 @@
<?php
class AdminTagProcessor extends kDBTagProcessor {
function SetConst($params)
{
$name = $this->SelectParam($params, 'name,const');
safeDefine($name, $params['value']);
}
/**
* 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']);
}
/**
* 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)
{
return $this->Application->findModule('Name', $params['module'], 'Version');
}
/**
* Builds xml for tree in left frame in admin
*
* @param Array $params
*/
function BuildTree($params)
{
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$sections_helper->BuildTree();
}
function DrawTree($params)
{
static $deep_level = 0;
// 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');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$params['deep_level'] = $deep_level++;
$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);
$deep_level--;
}
return $ret;
}
function PrintSection($params)
{
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$params['section_name'] = $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) );
return $ret;
}
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($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 =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$late_load = getArrayValue($section_data, 'late_load');
if ($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 preg_replace("/\r\n|\n/", '', $ret);
}
function ListSectionPermissions($params)
{
$section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$block_params = array_merge_recursive2($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
$ret = '';
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
$block_params['perm_name'] = $perm_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function ModuleInclude($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = replaceModuleSection($param_value);
}
return $this->Application->ProcessParsedTag('m', 'ModuleInclude', $params);
}
function TodayDate($params)
{
return date($params['format']);
}
+
+ function TreeEditWarrning($params)
+ {
+ $ret = $this->Application->Phrase($params['label']);
+ $ret = str_replace(Array('<', '>', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $ret);
+ if (getArrayValue($params, 'escape')) {
+ $ret = addslashes($ret);
+ }
+ $ret = str_replace('<br>', '\n', $ret);
+ return $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.11
\ No newline at end of property
+1.12
\ No newline at end of property
Index: trunk/kernel/admin_templates/incs/tree.js
===================================================================
--- trunk/kernel/admin_templates/incs/tree.js (revision 4683)
+++ trunk/kernel/admin_templates/incs/tree.js (revision 4684)
@@ -1,383 +1,382 @@
function TreeItem(title, url, icon, onclick)
{
this.Title = title;
this.Url = url;
this.Rendered = false;
this.Displayed = false;
this.Level = 0;
this.Icon = icon;
this.Onclick = onclick;
}
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.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 = 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) )
link.treeItem = this;
//addEvent(link, 'click',
link.onclick =
function(ev) {
var e = is.ie ? window.event : ev;
res = true;
if (isset(this.treeItem.Onclick)) {
res = eval(this.treeItem.Onclick);
- alert('res: '+res);
}
if (!res) { // if we need to cancel onclick action
if (is.ie) {
window.event.cancelBubble = true;
window.event.returnValue = false;
} else {
ev.preventDefault();
ev.stopPropagation();
}
return res;
}
if (!this.treeItem.Expanded && typeof(this.treeItem.folderClick) == 'function') {
if (this.treeItem.folderClick());
}
}
// )
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, onclick)
{
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.Onclick = onclick;
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') {
var backupLastFolder = this.LastFolder;
this.LastFolder = this.LastFolder.AddItem(new TreeFolder(null, child.getAttribute('name'), child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('load_url'), child.getAttribute('onclick')), render);
if (child.hasChildNodes) {
this.ProcessXMLNode(child);
}
this.LastFolder = backupLastFolder;
}
else if (child.tagName == 'item') {
this.LastFolder.AddItem(new TreeItem(child.firstChild.nodeValue, child.getAttribute('href'), child.getAttribute('icon'), child.getAttribute('onclick')), render)
}
else if (child.tagName == 'tree') {
this.LastFolder = this;
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.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/kernel/admin_templates/tree.tpl
===================================================================
--- trunk/kernel/admin_templates/tree.tpl (revision 4683)
+++ trunk/kernel/admin_templates/tree.tpl (revision 4684)
@@ -1,110 +1,120 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
<inp2:adm_SetConst name="DBG_SKIP_REPORTING" value="1"/>
<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-size: 11px;
color: #000000;
font-family: Helvetica, Arial, Verdana;
text-decoration: none;
}
.tree tr td a:hover {
color: #009FF0;
}
</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">
<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', 'index');">
<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" style="padding: 5px;">
<inp2:adm_BuildTree/>
<inp2:m_DefineElement name="xml_node">
<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">
+ <item href="<inp2:m_param name="section_url"/>" onclick="checkEditMode()" 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"/>">
+ <folder href="<inp2:m_param name="section_url"/>" onclick="checkEditMode()" 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"/>
</folder>
</inp2:m_if>
</inp2:m_DefineElement>
<table class="tree">
<tbody id="tree">
</tbody>
</table>
<script type="text/javascript">
var TREE_ICONS_PATH = 'img/tree'
<inp2:m_DefineElement name="root_node">
var the_tree = new TreeFolder('tree', '<inp2:m_param name="label"/>', '<inp2:m_param name="section_url"/>', '<inp2:$SectionPrefix_ModulePath/>img/icons/icon24_<inp2:m_param name="icon"/>.gif');
</inp2:m_DefineElement>
<inp2:adm_PrintSection render_as="root_node" section_name="in-portal:root"/>
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">
+ // when changing language submit is made to frameset, not the current frame
var $kf = document.getElementById($form_name);
$kf.target = 'main_frame';
- $kf.action = '<inp2:m_t pass="" index_file="index.php" escape="1"/>';
+
+ function checkEditMode()
+ {
+ var $phrase = "<inp2:adm_TreeEditWarrning label="la_EditingInProgress" escape="1"/>";
+ if (window.parent.getFrame('main').$edit_mode) {
+ return confirm($phrase) ? true : false;
+ }
+
+ return true;
+ }
</script>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/tree.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/admin/tree/ftv2mnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2mnode.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2node.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2node.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2folderopen.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2folderopen.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2vertline.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2vertline.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2folderclosed.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2folderclosed.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2link.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2link.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2pnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2pnode.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2blank.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2blank.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2mlastnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2mlastnode.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2lastnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2lastnode.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/tree.php
===================================================================
--- trunk/admin/tree/tree.php (revision 4683)
+++ trunk/admin/tree/tree.php (nonexistent)
@@ -1,121 +0,0 @@
-<?php
- define('DBG_SHOW_MEMORY_USAGE', 0);
-
- // new startup: begin
- define('REL_PATH', 'admin/tree');
- $relation_level = count( explode('/', REL_PATH) );
- define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
- require_once FULL_PATH.'/kernel/startup.php';
- // new startup: end
-
- $pathtolocal = $pathtoroot;
-
- $envar = "env=" . BuildEnv();
-
- include_once($pathtoroot.$admin."/include/sections.php");
-
- $ServerName = $objConfig->Get('Site_Name');
- $rootLink = $adminURL."/subitems.php?env=".BuildEnv()."§ion=in-portal:root";
- $charset = GetRegionalOption('Charset');
-
- $main_tag_processor =& $application->recallTagProcessor('m');
- $phrase_EditingInProgress = $main_tag_processor->Phrase( Array('name' => 'la_EditingInProgress', 'escape' => 1) );
-
- $phrase_EditingInProgress = str_replace(Array('<', '>', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $phrase_EditingInProgress);
-?>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="<?php echo $adminURL."/include/style.css"; ?>">
-<meta http-equiv="content-type" content="text/html;charset=<?php echo $charset; ?>">
-<script src="ua.js"></script>
-<script src="ftiens4.js"></script>
-<script type="text/javascript">
-// Decide if the names are links or just the icons
-USETEXTLINKS = 1 //replace 0 with 1 for hyperlinks
-
-// Decide if the tree is to start all open or just showing the root folders
-STARTALLOPEN = 0 //replace 0 with 1 to show the whole tree
-
-var foldersTree = gFld('In-Portal','<?php echo $rootLink; ?>');
-var $phrase_EditingInProgress = '<?php echo $phrase_EditingInProgress; ?>';
-
-$phrase_EditingInProgress = replaceLineEndings($phrase_EditingInProgress);
-
-function replaceLineEndings($src)
-{
- var $tmp = '';
- while (true) {
- $tmp = $src.replace('<br>', "\n");
- if ($tmp == $src) {
- break;
- }
- $src = $tmp;
- }
- return $src;
-}
-
-
-foldersTree.desc = '<?php echo addslashes($ServerName); ?>';
-foldersTree.iconSrc='<?php echo $adminURL."/icons/icon24_site.gif"; ?>';
-
-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);
-}
-
-<?php
- $objSections->BuildTree('in-portal:site', 'foldersTree');
- $title = "In-Portal v ".$kernel_version." ";
-?>
-
-</script>
-
-
-
-</head>
-<body topmargin="0" marginheight="0" marginwidth="0" marginheight="0" bgcolor="#DCEBF6">
-
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
-<!--<tr><td colspan="2" bgcolor="black"><img title="" width="1" height="1" src="images/spacer.gif"></td></tr>-->
- <tr>
- <td background="../images/menu_bar.gif" align="left" class="tree_head" width="80%"> <!-- 60000 -->
- <a class="tree_head_credits" href="javascript:credits('<?php echo $rootURL.$admin."/help/credits.php?env=".BuildEnv();?>&destform=popup');"><?php echo $title; ?></a>
- </td>
- <td background="../images/menu_bar.gif" align="right" class="tree_head" width="20%"> <!-- 40000 -->
- <FORM style="display:inline" name="lang_select" method="POST" action="<?php echo $rootURL.$admin."/index.php?env=".BuildEnv(); ?>" TARGET="main_frame">
- <SELECT NAME="langselect" style="width: 62px; border: 0px; background-color: #FFFFFF; font-size: 9px; color: black" onchange="document.lang_select.submit()">
- <!-- width: 52px; font-size: 8.5px; -->
- <?php
- $objLanguages->Query_Item("SELECT * FROM ".$objLanguages->SourceTable." WHERE Enabled=1");
- foreach($objLanguages->Items as $l)
- {
- $selected = "";
- if($l->Get("LanguageId")==$m_var_list["lang"])
- $selected = " SELECTED";
- echo "<OPTION onclick=\"this.form.submit();\" value=\"".$l->Get("LanguageId")."\" $selected>".$l->Get("LocalName")."</OPTION>\n";
- }
- ?>
- </SELECT>
- <input type=hidden name="Action" value="m_lang_select">
- </FORM>
- </td>
- <td background="../images/menu_bar.gif"><img title="" height="21" width="1" src="../images/spacer.gif"></td>
- </tr>
-</table>
-
-<table cellpadding="5" cellspacing="0" border="0">
- <tr>
- <td>
- <script type="text/javascript">
- initializeDocument();
- </script>
- </td>
- </tr>
-</table>
-
-</body>
-</html>
Property changes on: trunk/admin/tree/tree.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.14
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/tree/ftv2plastnode.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2plastnode.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftv2doc.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/admin/tree/ftv2doc.gif
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/admin/tree/ftiens4.js
===================================================================
--- trunk/admin/tree/ftiens4.js (revision 4683)
+++ trunk/admin/tree/ftiens4.js (nonexistent)
@@ -1,551 +0,0 @@
-//****************************************************************
-// Keep this copyright notice:
-// This copy of the script is the property of the owner of the
-// particular web site you were visiting.
-// Do not download the script's files from there.
-// For a free download and full instructions go to:
-// http://www.geocities.com/marcelino_martins/foldertree.html
-//
-// Author: Marcelino Alves Martins (http://www.mmartins.com)
-// 1997--2001.
-//****************************************************************
-
-// Log of changes:
-// 10 Aug 01 - Support for Netscape 6
-//
-// 17 Feb 98 - Fix initialization flashing problem with Netscape
-//
-// 27 Jan 98 - Root folder starts open; support for USETEXTLINKS;
-// make the ftien4 a js file
-
-
-// Definition of class Folder
-// *****************************************************************
-
-
-function Folder(folderDescription, hreference, onClick) //constructor
-{
-//constant data
- this.desc = folderDescription
- this.hreference = hreference
- this.onClick = onClick
- this.id = -1
- this.navObj = 0
- this.iconImg = 0
- this.nodeImg = 0
- this.isLastNode = 0
-
- //dynamic data
- this.isOpen = true
- this.iconSrc = "ftv2folderopen.gif"
- this.children = new Array
- this.nChildren = 0
-
- //methods
- this.initialize = initializeFolder
- this.setState = setStateFolder
- this.addChild = addChild
- this.createIndex = createEntryIndex
- this.escondeBlock = escondeBlock
- this.esconde = escondeFolder
- this.mostra = mostra
- this.renderOb = drawFolder
- this.totalHeight = totalHeight
- this.subEntries = folderSubEntries
- this.outputLink = outputFolderLink
- this.blockStart = blockStart
- this.blockEnd = blockEnd
-}
-
-function initializeFolder(level, lastNode, leftSide)
-{
- var j=0
- var i=0
- var numberOfFolders
- var numberOfDocs
- var nc
-
- nc = this.nChildren
-
- this.createIndex()
-
- var auxEv = ""
-
- if (browserVersion > 0)
- auxEv = "<a href='javascript:clickOnNode("+this.id+")'>"
- else
- auxEv = "<a>"
-
- if (level>0)
- if (lastNode) //the last child in the children array
- {
- this.renderOb(leftSide + auxEv + "<img name='nodeIcon" + this.id + "' id='nodeIcon" + this.id + "' src='ftv2mlastnode.gif' width=16 height=22 border=0></a>")
- leftSide = leftSide + "<img src='ftv2blank.gif' width=16 height=22>"
- this.isLastNode = 1
- }
- else
- {
- this.renderOb(leftSide + auxEv + "<img name='nodeIcon" + this.id + "' id='nodeIcon" + this.id + "' src='ftv2mnode.gif' width=16 height=22 border=0></a>")
- leftSide = leftSide + "<img src='ftv2vertline.gif' width=16 height=22>"
- this.isLastNode = 0
- }
- else
- this.renderOb("")
-
- if (nc > 0)
- {
- level = level + 1
- for (i=0 ; i < this.nChildren; i++)
- {
- if (i == this.nChildren-1)
- this.children[i].initialize(level, 1, leftSide)
- else
- this.children[i].initialize(level, 0, leftSide)
- }
- }
-}
-
-function setStateFolder(isOpen)
-{
- var subEntries
- var totalHeight
- var fIt = 0
- var i=0
-
- if (isOpen == this.isOpen)
- return
-
- if (browserVersion == 2)
- {
- totalHeight = 0
- for (i=0; i < this.nChildren; i++)
- totalHeight = totalHeight + this.children[i].navObj.clip.height
- subEntries = this.subEntries()
- if (this.isOpen)
- totalHeight = 0 - totalHeight
- for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++)
- indexOfEntries[fIt].navObj.moveBy(0, totalHeight)
- }
- this.isOpen = isOpen
- propagateChangesInState(this)
-}
-
-function propagateChangesInState(folder)
-{
- var i=0
-
- if (folder.isOpen)
- {
- if (folder.nodeImg)
- if (folder.isLastNode)
- folder.nodeImg.src = "ftv2mlastnode.gif"
- else
- folder.nodeImg.src = "ftv2mnode.gif"
- folder.iconImg.src = folder.iconSrc; // "ftv2folderopen.gif"
- for (i=0; i<folder.nChildren; i++)
- folder.children[i].mostra()
- }
- else
- {
- if (folder.nodeImg)
- if (folder.isLastNode)
- folder.nodeImg.src = "ftv2plastnode.gif"
- else
- folder.nodeImg.src = "ftv2pnode.gif"
- folder.iconImg.src = folder.iconSrc; // "ftv2folderclosed.gif"
- for (i=0; i<folder.nChildren; i++)
- folder.children[i].esconde()
- }
-}
-
-function escondeFolder()
-{
- this.escondeBlock()
-
- this.setState(0)
-}
-
-function drawFolder(leftSide)
-{
- var idParam = "id='folder" + this.id + "'"
-
- if (browserVersion == 2) {
- if (!doc.yPos)
- doc.yPos=20
- }
-
- this.blockStart("folder")
-
- doc.write("<tr><td>")
- doc.write(leftSide)
- this.outputLink()
- doc.write("<img id='folderIcon" + this.id + "' name='folderIcon" + this.id + "' src='" + this.iconSrc+"' border=0></a>")
- doc.write("</td><td valign=middle nowrap class=tree>")
- if (USETEXTLINKS)
- {
- this.outputLink()
- doc.write(this.desc + "</a>")
- }
- else
- doc.write(this.desc)
- doc.write("</td>")
-
- this.blockEnd()
-
- if (browserVersion == 1) {
- this.navObj = doc.all["folder"+this.id]
- this.iconImg = doc.all["folderIcon"+this.id]
- this.nodeImg = doc.all["nodeIcon"+this.id]
- } else if (browserVersion == 2) {
- this.navObj = doc.layers["folder"+this.id]
- this.iconImg = this.navObj.document.images["folderIcon"+this.id]
- this.nodeImg = this.navObj.document.images["nodeIcon"+this.id]
- doc.yPos=doc.yPos+this.navObj.clip.height
- } else if (browserVersion == 3) {
- this.navObj = doc.getElementById("folder"+this.id)
- this.iconImg = doc.getElementById("folderIcon"+this.id)
- this.nodeImg = doc.getElementById("nodeIcon"+this.id)
- }
-}
-
-function outputFolderLink()
-{
- if (this.hreference)
- {
- doc.write('<a class="tree" href="' + this.hreference + '" target="main" ');
- if (browserVersion > 0) {
- doc.write('onClick="javascript:return clickOnFolder('+this.id+', \'' + this.onClick + '\')"');
- }
- else {
- doc.write('onclick="' + this.onClick + '"');
- }
- doc.write('>');
- }
- else {
- doc.write('<a>');
- }
-// doc.write("<a href='javascript:clickOnFolder("+this.id+")'>")
-}
-
-function addChild(childNode)
-{
- this.children[this.nChildren] = childNode
- this.nChildren++
- return childNode
-}
-
-function folderSubEntries()
-{
- var i = 0
- var se = this.nChildren
-
- for (i=0; i < this.nChildren; i++){
- if (this.children[i].children) //is a folder
- se = se + this.children[i].subEntries()
- }
-
- return se
-}
-
-
-// Definition of class Item (a document or link inside a Folder)
-// *************************************************************
-
-function Item(itemDescription, itemLink, itemOnClick) // Constructor
-{
-// alert('creating item: ['+itemDescription+'] ; ['+itemLink+'] ; [' + itemOnClick + ']');
-
- // constant data
- this.desc = itemDescription
- this.link = itemLink
- this.onClick = itemOnClick
- this.id = -1 //initialized in initalize()
- this.navObj = 0 //initialized in render()
- this.iconImg = 0 //initialized in render()
- //this.iconSrc = "ftv2doc.gif"
-
- // methods
- this.initialize = initializeItem
- this.createIndex = createEntryIndex
- this.esconde = escondeBlock
- this.mostra = mostra
- this.renderOb = drawItem
- this.totalHeight = totalHeight
- this.blockStart = blockStart
- this.blockEnd = blockEnd
-}
-
-function initializeItem(level, lastNode, leftSide)
-{
- this.createIndex()
-
- if (level>0)
- if (lastNode) //the last 'brother' in the children array
- {
- this.renderOb(leftSide + "<img src='ftv2lastnode.gif' width=16 height=22>")
- leftSide = leftSide + "<img src='ftv2blank.gif' width=16 height=22>"
- }
- else
- {
- this.renderOb(leftSide + "<img src='ftv2node.gif' width=16 height=22>")
- leftSide = leftSide + "<img src='ftv2vertline.gif' width=16 height=22>"
- }
- else
- this.renderOb("")
-}
-
-function drawItem(leftSide)
-{
- this.blockStart("item")
-
- doc.write("<tr><td>")
- doc.write(leftSide)
- doc.write("<a class=tree href=" + this.link + ">")
- doc.write("<img id='itemIcon"+this.id+"' ")
- doc.write("src='"+this.iconSrc+"' border=0>")
- doc.write("</a>")
- doc.write("</td><td valign=middle nowrap>")
- if (USETEXTLINKS) {
-// alert('writing: [' + '<a class="tree" href="' + this.link + '" onclick="' + this.onClick + '">' + this.desc + '</a>' +']');
- doc.write('<a class="tree" href=' + this.link + ' onclick="' + this.onClick + '">' + this.desc + '</a>');
- }
- else {
- doc.write(this.desc);
- }
-
- this.blockEnd()
-
- if (browserVersion == 1) {
- this.navObj = doc.all["item"+this.id]
- this.iconImg = doc.all["itemIcon"+this.id]
- } else if (browserVersion == 2) {
- this.navObj = doc.layers["item"+this.id]
- this.iconImg = this.navObj.document.images["itemIcon"+this.id]
- doc.yPos=doc.yPos+this.navObj.clip.height
- } else if (browserVersion == 3) {
- this.navObj = doc.getElementById("item"+this.id)
- this.iconImg = doc.getElementById("itemIcon"+this.id)
- }
-}
-
-
-// Methods common to both objects (pseudo-inheritance)
-// ********************************************************
-
-function mostra()
-{
- if (browserVersion == 1 || browserVersion == 3) {
- var str = new String(doc.links[0])
- // if (str.slice(16,20) != "ins.")
- // return
- }
-
- if (browserVersion == 1 || browserVersion == 3)
- this.navObj.style.display = "block"
- else
- this.navObj.visibility = "show"
-}
-
-function escondeBlock()
-{
- if (browserVersion == 1 || browserVersion == 3) {
- if (this.navObj.style.display == "none")
- return
- this.navObj.style.display = "none"
- } else {
- if (this.navObj.visibility == "hiden")
- return
- this.navObj.visibility = "hiden"
- }
-}
-
-function blockStart(idprefix) {
- var idParam = "id='" + idprefix + this.id + "'"
-
- if (browserVersion == 2)
- doc.write("<layer "+ idParam + " top=" + doc.yPos + " visibility=show>")
-
- if (browserVersion == 3) //N6 has bug on display property with tables
- doc.write("<div " + idParam + " style='display:block; position:block;'>")
-
- doc.write("<table border=0 cellspacing=0 cellpadding=0 ")
-
- if (browserVersion == 1)
- doc.write(idParam + " style='display:block; position:block; '>")
- else
- doc.write(">")
-}
-
-function blockEnd() {
- doc.write("</table>")
-
- if (browserVersion == 2)
- doc.write("</layer>")
- if (browserVersion == 3)
- doc.write("</div>")
-}
-
-function createEntryIndex()
-{
- this.id = nEntries
- indexOfEntries[nEntries] = this
- nEntries++
-}
-
-// total height of subEntries open
-function totalHeight() //used with browserVersion == 2
-{
- var h = this.navObj.clip.height
- var i = 0
-
- if (this.isOpen) //is a folder and _is_ open
- for (i=0 ; i < this.nChildren; i++)
- h = h + this.children[i].totalHeight()
-
- return h
-}
-
-
-// Events
-// *********************************************************
-
-function clickOnFolder(folderId, customOnClick)
-{
- var clicked = indexOfEntries[folderId]
- eval('function doClick() {'+customOnClick+'} var $clickResult = doClick();');
-
- if (!$clickResult) {
- return false;
- }
-
- if (!clicked.isOpen) {
- clickOnNode(folderId);
- }
-
- return true;
-
- if (clicked.isSelected) {
- return true;
- }
-}
-
-function clickOnNode(folderId)
-{
- var clickedFolder = 0
- var state = 0
-
- clickedFolder = indexOfEntries[folderId]
- state = clickedFolder.isOpen
-
- clickedFolder.setState(!state) //open<->close
-}
-
-
-// Auxiliary Functions for Folder-Tree backward compatibility
-// ***********************************************************
-
-function gFld(description, hreference, onClick)
-{
- return new Folder(description, hreference, onClick);
-}
-
-function gLnk(target, description, linkData, onClick)
-{
- var fullLink = '';
-
- if (target == 0) {
- fullLink = '"' + linkData + '" target="main"';
- }
- else {
- if (target == 1) {
- fullLink = '"http://' + linkData + '" target="_blank"';
- }
- else {
- fullLink = '"http://' + linkData + '" target="main"';
- }
- }
-
- return new Item(description, fullLink, onClick);
-}
-
-function insFld(parentFolder, childFolder)
-{
- return parentFolder.addChild(childFolder);
-
-}
-
-function insDoc(parentFolder, document)
-{
- return parentFolder.addChild(document)
-}
-
-
-// Global variables
-// ****************
-
-//These two variables are overwriten on defineMyTree.js if needed be
-USETEXTLINKS = 0
-STARTALLOPEN = 0
-indexOfEntries = new Array
-nEntries = 0
-doc = document
-browserVersion = 0
-selectedFolder=0
-
-
-// Main function
-// *************
-
-// This function uses an object (navigator) defined in
-// ua.js, imported in the main html page (left frame).
-function initializeDocument()
-{
- switch(navigator.family)
- {
- case 'ie4':
- browserVersion = 1 //IE4
- break;
- case 'nn4':
- browserVersion = 2 //NS4
- break;
- case 'gecko':
- browserVersion = 3 //NS6
- break;
- default:
- browserVersion = 0 //other
- break;
- }
-
- //foldersTree (with the site's data) is created in an external .js
- foldersTree.initialize(0, 1, "");
-
- if (browserVersion == 2)
- doc.write("<layer top="+indexOfEntries[nEntries-1].navObj.top+"> </layer>")
-
- //The tree starts in full display
- if (!STARTALLOPEN)
- if (browserVersion > 0) {
- // close the whole tree
- clickOnNode(0)
- // open the root folder
- clickOnNode(0)
- }
-
- if (browserVersion == 0)
- doc.write("<table border=0><tr><td><br><br><font size=-1>This tree only expands or contracts with DHTML capable browsers</font></table>")
-}
-
-function checkEditMode()
-{
- if (window.parent.getFrame('main').$edit_mode) {
- return confirm($phrase_EditingInProgress) ? true : false;
- }
-
- return true;
-}
-
-function isset(variable)
-{
- if(variable==null) return false;
- return (typeof(variable)=='undefined')?false:true;
-}
\ No newline at end of file
Property changes on: trunk/admin/tree/ftiens4.js
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/tree/ua.js
===================================================================
--- trunk/admin/tree/ua.js (revision 4683)
+++ trunk/admin/tree/ua.js (nonexistent)
@@ -1,328 +0,0 @@
-// ua.js - Detect Browser
-
-// Requires JavaScript 1.1
-
-/*
-
-The contents of this file are subject to the Netscape Public
-
-License Version 1.1 (the "License"); you may not use this file
-
-except in compliance with the License. You may obtain a copy of
-
-the License at http://www.mozilla.org/NPL/
-
-
-
-Software distributed under the License is distributed on an "AS
-
-IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-
-implied. See the License for the specific language governing
-
-rights and limitations under the License.
-
-
-
-The Initial Developer of the Original Code is Bob Clary.
-
-
-
-Contributor(s): Bob Clary, Original Work, Copyright 1999-2000
-
- Bob Clary, Netscape Communications, Copyright 2001
-
-
-
-Alternatively, the contents of this file may be used under the
-
-terms of the GNU Public License (the "GPL"), in which case the
-
-provisions of the GPL are applicable instead of those above.
-
-If you wish to allow use of your version of this file only
-
-under the terms of the GPL and not to allow others to use your
-
-version of this file under the NPL, indicate your decision by
-
-deleting the provisions above and replace them with the notice
-
-and other provisions required by the GPL. If you do not delete
-
-the provisions above, a recipient may use your version of this
-
-file under either the NPL or the GPL.
-
-*/
-
-
-
-// work around bug in xpcdom Mozilla 0.9.1
-
-window.saveNavigator = window.navigator;
-
-
-
-// Handy functions
-
-function noop() {}
-
-function noerror() { return true; }
-
-
-
-function defaultOnError(msg, url, line)
-
-{
-
- // customize this for your site
-
- if (top.location.href.indexOf('_files/errors/') == -1)
-
- top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(msg) + '&url=' + escape(url) + '&line=' + escape(line);
-
-}
-
-
-
-// Display Error page...
-
-// XXX: more work to be done here
-
-//
-
-function reportError(message)
-
-{
-
- // customize this for your site
-
- if (top.location.href.indexOf('_files/errors/') == -1)
-
- top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(message);
-
-}
-
-
-
-function pageRequires(cond, msg, redirectTo)
-
-{
-
- if (!cond)
-
- {
-
- msg = 'This page requires ' + msg;
-
- top.location = redirectTo + '?msg=' + escape(msg);
-
- }
-
- // return cond so can use in <A> onclick handlers to exclude browsers
-
- // from pages they do not support.
-
- return cond;
-
-}
-
-
-
-function detectBrowser()
-
-{
-
- var oldOnError = window.onerror;
-
- var element = null;
-
-
-
- window.onerror = defaultOnError;
-
-
-
- navigator.OS = '';
-
- navigator.version = 0;
-
- navigator.org = '';
-
- navigator.family = '';
-
-
-
- var platform;
-
- if (typeof(window.navigator.platform) != 'undefined')
-
- {
-
- platform = window.navigator.platform.toLowerCase();
-
- if (platform.indexOf('win') != -1)
-
- navigator.OS = 'win';
-
- else if (platform.indexOf('mac') != -1)
-
- navigator.OS = 'mac';
-
- else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1)
-
- navigator.OS = 'nix';
-
- }
-
-
-
- var i = 0;
-
- var ua = window.navigator.userAgent.toLowerCase();
-
-
-
- if (ua.indexOf('opera') != -1)
-
- {
-
- i = ua.indexOf('opera');
-
- navigator.family = 'opera';
-
- navigator.org = 'opera';
-
- navigator.version = parseFloat('0' + ua.substr(i+6), 10);
-
- }
-
- else if ((i = ua.indexOf('msie')) != -1)
-
- {
-
- navigator.org = 'microsoft';
-
- navigator.version = parseFloat('0' + ua.substr(i+5), 10);
-
-
-
- if (navigator.version < 4)
-
- navigator.family = 'ie3';
-
- else
-
- navigator.family = 'ie4'
-
- }
-
- else if (typeof(window.controllers) != 'undefined' && typeof(window.locationbar) != 'undefined')
-
- {
-
- i = ua.lastIndexOf('/')
-
- navigator.version = parseFloat('0' + ua.substr(i+1), 10);
-
- navigator.family = 'gecko';
-
-
-
- if (ua.indexOf('netscape') != -1)
-
- navigator.org = 'netscape';
-
- else if (ua.indexOf('compuserve') != -1)
-
- navigator.org = 'compuserve';
-
- else
-
- navigator.org = 'mozilla';
-
- }
-
- else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1))
-
- {
-
- var is_major = parseFloat(navigator.appVersion);
-
-
-
- if (is_major < 4)
-
- navigator.version = is_major;
-
- else
-
- {
-
- i = ua.lastIndexOf('/')
-
- navigator.version = parseFloat('0' + ua.substr(i+1), 10);
-
- }
-
- navigator.org = 'netscape';
-
- navigator.family = 'nn' + parseInt(navigator.appVersion);
-
- }
-
- else if ((i = ua.indexOf('aol')) != -1 )
-
- {
-
- // aol
-
- navigator.family = 'aol';
-
- navigator.org = 'aol';
-
- navigator.version = parseFloat('0' + ua.substr(i+4), 10);
-
- }
-
-
-
- navigator.DOMCORE1 = (typeof(document.getElementsByTagName) != 'undefined' && typeof(document.createElement) != 'undefined');
-
- navigator.DOMCORE2 = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined' && typeof(document.createElementNS) != 'undefined');
-
- navigator.DOMHTML = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined');
-
- navigator.DOMCSS1 = ( (navigator.family == 'gecko') || (navigator.family == 'ie4') );
-
-
-
- navigator.DOMCSS2 = false;
-
- if (navigator.DOMCORE1)
-
- {
-
- element = document.createElement('p');
-
- navigator.DOMCSS2 = (typeof(element.style) == 'object');
-
- }
-
-
-
- navigator.DOMEVENTS = (typeof(document.createEvent) != 'undefined');
-
-
-
- window.onerror = oldOnError;
-
-}
-
-
-
-detectBrowser();
-
-
-
Property changes on: trunk/admin/tree/ua.js
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/core/units/admin/admin_tag_processor.php
===================================================================
--- trunk/core/units/admin/admin_tag_processor.php (revision 4683)
+++ trunk/core/units/admin/admin_tag_processor.php (revision 4684)
@@ -1,272 +1,283 @@
<?php
class AdminTagProcessor extends kDBTagProcessor {
function SetConst($params)
{
$name = $this->SelectParam($params, 'name,const');
safeDefine($name, $params['value']);
}
/**
* 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']);
}
/**
* 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)
{
return $this->Application->findModule('Name', $params['module'], 'Version');
}
/**
* Builds xml for tree in left frame in admin
*
* @param Array $params
*/
function BuildTree($params)
{
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$sections_helper->BuildTree();
}
function DrawTree($params)
{
static $deep_level = 0;
// 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');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$params['deep_level'] = $deep_level++;
$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);
$deep_level--;
}
return $ret;
}
function PrintSection($params)
{
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$params['section_name'] = $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) );
return $ret;
}
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($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 =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$late_load = getArrayValue($section_data, 'late_load');
if ($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 preg_replace("/\r\n|\n/", '', $ret);
}
function ListSectionPermissions($params)
{
$section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$block_params = array_merge_recursive2($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
$ret = '';
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
$block_params['perm_name'] = $perm_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function ModuleInclude($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = replaceModuleSection($param_value);
}
return $this->Application->ProcessParsedTag('m', 'ModuleInclude', $params);
}
function TodayDate($params)
{
return date($params['format']);
}
+
+ function TreeEditWarrning($params)
+ {
+ $ret = $this->Application->Phrase($params['label']);
+ $ret = str_replace(Array('<', '>', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $ret);
+ if (getArrayValue($params, 'escape')) {
+ $ret = addslashes($ret);
+ }
+ $ret = str_replace('<br>', '\n', $ret);
+ return $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.11
\ No newline at end of property
+1.12
\ No newline at end of property
Event Timeline
Log In to Comment