*** empty log message ***

This commit is contained in:
sebastian 2005-02-21 14:42:15 +00:00
parent 1635d18c45
commit cdabb1b704
27 changed files with 1286 additions and 764 deletions

View File

@ -23,7 +23,7 @@
Author : $Author: sebastian $
Version : $Revision: 1.11 $
Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
------------------------------------------------------------------------------*/
@ -117,9 +117,9 @@ define('UI_INPUT_STANDARD_SIZE', 20);
define('UI_INPUT_STANDARD_MAXLENGTH', 50);
define('UI_TEXTAREA_STANDART_ROWS', 5);
define('UI_TEXTAREA_STANDART_COLS', 17);
define('UI_QFORM_REQUIRED', 'templates/form_parts/required.tpl');
define('UI_QFORM_REQUIREDNOTE', 'templates/form_parts/requirednote.tpl');
define('UI_QFORM_ERROR', 'templates/form_parts/error.tpl');
define('UI_QFORM_REQUIRED', 'templates/sub/form_required.tpl');
define('UI_QFORM_REQUIREDNOTE', 'templates/sub/form_requirednote.tpl');
define('UI_QFORM_ERROR', 'templates/sub/form_error.tpl');
define('UI_SEARCH_MAX_ROWS', 8);
define('UI_SEARCH_MIN_ROWS', 2);
define('UI_REGEX_URL', '/^(ht|f)tps?:\/\/[^ ]+$/');

View File

@ -0,0 +1,417 @@
<?php
$ui_fmask = array(
/* ===================== list of system preferences which can be adjusted */
'systemPrefs' => array(
array(
'element' => 'act',
'type' => 'hidden',
'constant' => 'systemPrefs'
),
array(
'element' => 'basics',
'type' => 'header',
'label' => 'Basic Settings',
),
array(
'element' => 'stationMaxfilesize',
'isPref' => TRUE,
'type' => 'text',
'label' => 'Maximum File Size for Upload',
'required' => TRUE,
'default' => ini_get('upload_max_filesize')
),
array(
'rule' => 'nopunctuation',
'element' => 'maxfilesize',
),
array(
'element' => 'stationFrequency',
'isPref' => TRUE,
'type' => 'text',
'label' => 'Frequency',
'required' => TRUE
),
array(
'element' => 'stationName',
'isPref' => TRUE,
'type' => 'text',
'label' => 'Staion Name',
'required' => TRUE
),
array(
'element' => 'stationLogoPath',
'isPref' => TRUE,
'type' => 'text',
'label' => 'Station Logo path',
'default' => 'img/logo.jpg',
'required' => TRUE
),
array(
'rule' => 'regex',
'element' => 'stationLogoPath',
'format' => '/^img\/[a-z0-9.-_]*$/',
'rulemsg' => 'Path seems invalid'
),
array(
'element' => 'stationURL',
'isPref' => TRUE,
'type' => 'text',
'label' => 'Station URL',
'default' => 'http://'
),
array(
'rule' => 'regex',
'element' => 'stationURL',
'format' => UI_REGEX_URL,
'rulemsg' => 'URL seems not to be valid'
),
array(
'element' => UI_SCRATCHPAD_MAXLENGTH_KEY,
'isPref' => TRUE,
'type' => 'select',
'label' => 'Maximun length of ScratchPad',
'options' => array(
'4' => '4',
'5' => '5',
'6' => '6',
'7' => '7',
'8' => '8',
'9' => '9',
'10'=>'10'
)
),
array(
'element' => 'upload',
'type' => 'header',
'label' => 'Upload'
),
array(
'element' => 'stationlogo',
'type' => 'file',
'label' => 'Station Logo',
'requiredmsg'=> 'please select Logo file'
),
array(
'element' =>'Submit',
'type' =>'submit',
'label' =>'Submit'
)
),
'chgPasswd' => array(
array(
'element' => 'act',
'type' => 'hidden',
'default' => 'chgPasswd'
),
array(
'element' => 'uid',
'type' => 'hidden',
),
array(
'element' => 'oldpass',
'type' => 'password',
'label' => 'Old Password',
'required' => TRUE,
),
array(
'element' => 'pass',
'type' => 'password',
'label' => 'New Password',
'required' => TRUE,
),
array(
'element' => 'pass2',
'type' => 'password',
'label' => 'Retype Password',
'required' => TRUE,
),
array(
'rule' => 'compare',
'element' => array('pass','pass2'),
'rulemsg' => 'The Passwords do not match'
),
array(
'element' =>'Submit',
'type' =>'submit',
'label' =>'Submit'
)
),
'addUser' => array(
array(
'element' => 'act',
'type' => 'hidden',
'constant' => 'addUser'
),
array(
'element' => 'login',
'type' => 'text',
'label' => 'Username',
'required' => TRUE
),
array(
'element' =>'pass',
'type' =>'password',
'label' =>'Users Password',
'required' =>TRUE
),
array(
'element' =>'pass2',
'type' =>'password',
'label' =>'Repeat Password',
'required' =>TRUE
),
array(
'rule' =>'compare',
'element' =>array('pass','pass2'),
'rulemsg' =>'The Passwords do not match'
),
array(
'element' =>'Submit',
'type' =>'submit',
'label' =>'Submit'
)
),
'addGroup' => array(
array(
'element' => 'act',
'type' => 'hidden',
'constant' => 'addGroup'
),
array(
'element' => 'login',
'type' => 'text',
'label' => 'Group Name',
'required' => TRUE
),
array(
'element' =>'Submit',
'type' =>'submit',
'label' =>'Submit'
)
),
'login' => array(
array(
'element' => 'act',
'type' => 'hidden',
'constant' => 'login'
),
array(
'element' => 'login',
'type' => 'text',
'label' => 'Username',
'required' => TRUE
),
array(
'element' => 'pass',
'type' => 'password',
'label' => 'Password',
'required' => TRUE
),
array(
'element' => 'Submit',
'type' => 'submit',
'label' => 'Submit'
),
array(
'element' => 'cancel',
'type' => 'button',
'label' => 'Cancel',
'attributes'=> array('onClick' => 'window.close()')
)
),
'uploadFileM' => array(
array(
'element' => 'act',
'type' => 'hidden'
),
array(
'element' => 'id',
'type' => 'hidden'
),
array(
'element' => 'mediafile',
'type' => 'file',
'label' => 'Mediafile',
'required' => TRUE,
'requiredmsg'=> 'please select Media file'
),
array(
'element' => 'mdatafile',
'type' => 'file',
'label' => 'Metadata',
'required' => TRUE,
'requiredmsg'=> 'please select Metadata file'
),
array(
'element' => 'Submit',
'type' => 'submit',
'label' => 'Submit'
)
),
'uploadFile' => array(
array(
'element' => 'act',
'type' => 'hidden'
),
array(
'element' => 'id',
'type' => 'hidden'
),
array(
'element' => 'mediafile',
'type' => 'file',
'label' => 'Mediafile',
'required' => TRUE,
'requiredmsg'=> 'please select Media file'
),
array(
'element' => 'Submit',
'type' => 'submit',
'label' => 'Submit'
)
),
'addWebstream' => array(
array(
'element' => 'act',
'type' => 'hidden',
),
array(
'element' => 'id',
'type' => 'hidden'
),
array(
'element' => 'name',
'type' => 'text',
'label' => 'Name',
'required' => TRUE,
'rule' => 'alphanumeric',
'rulemsg' => 'Name must be alphanumeric'
),
array(
'element' => 'url',
'type' => 'text',
'default' => 'http://',
'label' => 'Stream URL',
'required' => TRUE,
'requiredmsg'=> 'URL is missing',
'rule' => 'regex',
'format' => UI_REGEX_URL,
'rulemsg' => 'URL seems invalid',
),
array(
'element' => 'duration',
'type' => 'date',
'label' => 'Duration',
'options' => array(
'format' => 'His',
)
),
array(
'element' => 'Submit',
'type' => 'submit',
'label' => 'Submit'
)
),
'searchform' => array(
array(
'element' => 'act',
'type' => 'hidden',
'constant' => 'search'
),
array(
'element' => 'id',
'type' => 'hidden'
),
array(
'element' => 'counter',
'type' => 'hidden'
),
array(
'element' => 'max_rows',
'type' => 'hidden',
'constant' => UI_SEARCH_MAX_ROWS
),
array(
'element' => 'operator',
'type' => 'select',
'label' => 'Operator',
'options' => array(
'or' => 'Or',
'and' => 'And',
)
),
array(
'element' => 'filetype',
'type' => 'select',
'label' => 'Filetype',
'options' => array(
'File' => '*',
'audioclip' => 'Audioclip',
'webstream' => 'Webstream',
'playlist' => 'Playlist'
)
),
array(
'element' => 'clear',
'type' => 'button',
'label' => 'Clear',
'attributes' => array('onClick' => "this.form.reset(); hpopup('".UI_HANDLER."?act=search&clear=1', 'SF')"),
'groupit' => TRUE,
),
array(
'element' => 'addrow',
'type' => 'button',
'label' => 'One more Row',
'attributes' => array('onClick' => 'SearchForm_addRow()'),
'groupit' => TRUE,
),
array(
'element' => 'submit',
'type' => 'submit',
'label' => 'Submit',
'groupit' => TRUE,
),
array('group' => array('clear', 'addrow', 'submit')
),
),
'relations' => array(
'standard' => array(
'partial' => 'partial',
'full' => 'full',
'prefix' => 'prefix',
'=' => '=' ,
'<' => '<',
'<=' => '<=',
'>' => '>',
'>=' => '>='
),
1 => array(
'partial' => 'partial',
'full' => 'full',
'prefix' => 'prefix',
'=' => '='
),
),
'languages' => array(
array(
'element' => 'langid',
'type' => 'select',
'label' => 'Language',
'options' => array(
'en' => 'English',
'cz' => 'Czech',
'de' => 'German',
'hu' => 'Hungarian',
)
)
)
);

View File

@ -0,0 +1,440 @@
<?php /* =========================================================== Matadata-Mask */
$mask = array(
'basics' => array(
array(
'element' => 'act',
'type' => 'hidden',
'constant'=> 'editMetaData'
),
array(
'element' => 'id',
'type' => 'hidden'
),
array(
'element' => 'langid',
'type' => 'hidden'
),
),
'buttons' => array (
array(
'element' =>'reset',
'type' =>'reset',
'label' =>'Reset',
'groupit' => TRUE,
),
array(
'element' =>'button',
'type' =>'button',
'label' =>'Submit',
'groupit' => TRUE,
'attributes'=> array(
'onClick' => 'return switchMDataLang();'
),
),
array(
'group' => array('reset', 'button'),
)
),
'tabs' => array(
array(
'element' => 'Main',
'type' => 'button',
'label' => 'Main',
'groupit' => TRUE,
'attributes' => array('onClick' => 'showMain()')
),
array(
'element' => 'Music_Basic',
'type' => 'button',
'label' => 'Music_Basic',
'groupit' => TRUE,
'attributes' => array('onClick' => 'showMusic_Basic()')
),
array(
'element' => 'Music_Advanced',
'type' => 'button',
'label' => 'Music_Advanced',
'groupit' => TRUE,
'attributes' => array('onClick' => 'showMusic_Advanced()')
),
array(
'element' => 'Talk_Basic',
'type' => 'button',
'label' => 'Talk_Basic',
'groupit' => TRUE,
'attributes' => array('onClick' => 'showTalk_Basic()')
),
array(
'element' => 'Talk_Advanced',
'type' => 'button',
'label' => 'Talk_Advanced',
'groupit' => TRUE,
'attributes' => array('onClick' => 'showTalk_Advanced()')
),
'group' => array(
'group' => array('Main', 'Music_Basic', 'Music_Advanced', 'Talk_Basic', 'Talk_Advanced'),
)
),
'langswitch' => array(
array(
'element' => 'langid',
'type' => 'select',
'label' => 'Language',
'options' => array(
'en' => 'English',
'cz' => 'Czech',
'de' => 'German',
'hu' => 'Hungarian',
),
'attributes'=> array('onChange' => 'return switchMDataLang()')
)
),
'pages' => array(
'Main' => array(
array(
'element' => 'dc:title',
'type' => 'text',
'label' => 'Title',
'required' => TRUE
),
array(
'element' => 'Creator',
'type' => 'text',
'label' => 'Creator',
#'required' => TRUE,
),
array(
'element' => 'Type_Genre',
'type' => 'text',
'label' => 'Type_Genre',
#'required' => TRUE,
),
array(
'element' => 'dc:format',
'type' => 'select',
'label' => 'Format',
#'required' => TRUE,
'options' => array(
'' => '',
'audio/mpeg' => 'audio/mpeg',
'File' => 'File',
'live stream' => 'Live Stream',
'networked file'=> 'Networked File',
)
),
array(
'element' => 'dcterms:extent',
'type' => 'text',
'label' => 'Extent',
#'attributes'=> array('readonly' => 'on')
),
/*
array(
'element' => 'Format_Extent_h',
'type' => 'select',
'options' => getDArr('h'),
'groupit' => TRUE
),
array(
'element' => 'Format_Extent_m',
'type' => 'select',
'options' => getDArr('m'),
'groupit' => TRUE
),
array(
'element' => 'Format_Extent_s',
'type' => 'select',
'options' => getDArr('h'),
'groupit' => TRUE
),
array(
'group' => array('Main__Format_Extent_h', 'Main__Format_Extent_m', 'Main__Format_Extent_s'),
#'name' => 'gr_Format_Extent',
'label' => 'Format_Extent',
'rule' => 'required',
#'grouprule' => 'regex',
#'format' => '/([1-9]0)|([1-9]{2})|(0[1-9])/',
#'arg1' => 'Please enter Format_Extent',
#'howmany' => 1
), */
),
'Music_Basic' => array(
array(
'element' => 'dc:title',
'type' => 'text',
'label' => 'Title',
),
array(
'element' => 'dc:creator',
'type' => 'text',
'label' => 'Creator',
),
array(
'element' => 'Source_Album',
'type' => 'text',
'label' => 'Source_Album',
),
/*
array(
'element' => 'Source_Year',
'type' => 'date',
'label' => 'Source_Year',
'options' => array(
'language' => 'en',
'format' => 'dMY',
'addEmptyOption'=> TRUE,
'minYear' => 1900
)
),
*/
array(
'element' => 'Type_Genre',
'type' => 'text',
'label' => 'Type_Genre',
),
array(
'element' => 'dc:description',
'type' => 'textarea',
'label' => 'Description',
),
array(
'element' => 'dc:format',
'type' => 'select',
'label' => 'Format',
'options' => array(
'' => '',
'audio/mpeg' => 'audio/mpeg',
'File' => 'File',
'live stream' => 'Live Stream',
'networked file'=> 'Networked File'
)
),
array(
'element' => 'Type_BPM',
'type' => 'text',
'label' => 'Type_BPM',
'rule' => 'numeric',
),
array(
'element' => 'Description_Rating',
'type' => 'text',
'label' => 'Description_Rating',
'rule' => 'numeric',
),
array(
'element' => 'dcterms:extent',
'type' => 'text',
'label' => 'Extent',
'attributes'=> array('readonly' => 'on')
),
),
'Music_Advanced'=> array(
array(
'element' => 'Creator_Role_Encoder',
'type' => 'text',
'label' => 'Creator_Role_Encoder',
),
array(
'element' => 'Source_Album_TrackNumber',
'type' => '',
'label' => 'Source_Album_TrackNumber',
'rule' => 'numeric',
),
array(
'element' => 'Source_Album_DiscNumber',
'type' => 'text',
'label' => 'Source_Album_DiscNumber',
'rule' => 'numeric',
),
array(
'element' => 'Description_Mood',
'type' => 'text',
'label' => 'Description_Mood',
),
array(
'element' => 'Publisher',
'type' => 'text',
'label' => 'Publisher',
),
array(
'element' => 'Creator_Role_Composer',
'type' => 'text',
'label' => 'Creator_Role_Composer',
),
array(
'element' => 'Format_Medium_Bitrate',
'type' => 'text',
'label' => 'Format_Medium_Bitrate',
'rule' => 'numeric'
),
array(
'element' => 'Format_Medium_Channels',
'type' => 'select',
'label' => 'Format_Medium_Channels',
'options' => array(
'' => '',
'mono' => 'Mono',
'stereo' => 'Stereo',
'5.1' => '5.1'
)
),
array(
'element' => 'Format_Medium_Samplerate',
'type' => 'text',
'label' => 'Format_Medium_Samplerate',
'rule' => 'numeric'
),
array(
'element' => 'Format_Medium_Encoder',
'type' => 'text',
'label' => 'Format_Medium_Encoder',
),
array(
'element' => 'Format_CRC',
'type' => 'text',
'label' => 'Format_CRC',
'rule' => 'numeric'
),
array(
'element' => 'Description_Lyrics',
'type' => 'textarea',
'label' => 'Description_Lyrics',
),
array(
'element' => 'Creator_Role_Orchestra',
'type' => 'text',
'label' => 'Creator_Role_Orchestra',
),
array(
'element' => 'Creator_Role_Conductor',
'type' => 'text',
'label' => 'Creator_Role_Conductor',
),
array(
'element' => 'Creator_Role_Lyricist',
'type' => 'text',
'label' => 'Creator_Role_Lyricist',
),
array(
'element' => 'Creator_Role_OriginalLyricist',
'type' => 'text',
'label' => 'Creator_Role_OriginalLyricist',
),
array(
'element' => 'Creator_Role_RadioStationName',
'type' => 'text',
'label' => 'Creator_Role_RadioStationName',
),
array(
'element' => 'Description_AudioFileInfoURL',
'type' => 'text',
'label' => 'Description_AudioFileInfoURL',
),
array(
'element' => 'Description_ArtistURL',
'type' => 'text',
'label' => 'Description_ArtistURL',
),
array(
'element' => 'Description_AudioSourceURL',
'type' => 'text',
'label' => 'Description_AudioSourceURL',
),
array(
'element' => 'Description_RadioStationURL',
'type' => 'text',
'label' => 'Description_RadioStationURL',
),
array(
'element' => 'Description_BuyCDURL',
'type' => 'text',
'label' => 'Description_BuyCDURL',
),
array(
'element' => 'Identifier_ISRCNumber',
'type' => 'text',
'label' => 'Identifier_ISRCNumber',
'rule' => 'numeric'
),
array(
'element' => 'Identifier_CatalogNumber',
'type' => 'text',
'label' => 'Identifier_CatalogNumber',
'rule' => 'numeric'
),
array(
'element' => 'Creator_Role_OriginalArtist',
'type' => 'text',
'label' => 'Creator_Role_OriginalArtist',
),
array(
'element' => 'Rights_Copyright',
'type' => 'text',
'label' => 'Rights_Copyright',
),
),
'Talk_Basic' => array(
array(
'element' => 'dc:title',
'type' => 'text',
'label' => 'Title',
),
array(
'element' => 'Coverage',
'type' => 'text',
'label' => 'Coverage',
),
array(
'element' => 'dc:description',
'type' => 'textarea',
'label' => 'Description',
),
array(
'element' => 'Creator',
'type' => 'text',
'label' => 'Creator',
),
array(
'element' => 'Subject',
'type' => 'text',
'label' => 'Subject',
),
array(
'element' => 'Type_Genre',
'type' => 'text',
'label' => 'Type_Genre',
),
array(
'element' => 'dc:format',
'type' => 'select',
'label' => 'Format',
'options' => array(
'' => '',
'audio/mpeg' => 'audio/mpeg',
'File' => 'File',
'live stream' => 'Live Stream',
'networked file'=> 'Networked File',
)
),
),
'Talk_Advanced' => array(
array(
'element' => 'Contributor',
'type' => 'text',
'label' => 'Contributor',
),
array(
'element' => 'Language',
'type' => 'text',
'label' => 'Language',
),
array(
'element' => 'Rights',
'type' => 'text',
'label' => 'Rights',
),
)
)
);
?>

View File

@ -8,11 +8,12 @@
{/literal}
<div id="metadataform">
{include file="sub/x.tpl"}
<center>
{$editMetaData.tabs}
{$editMetaData.langswitch}
{foreach from=$editMetaData.pages key=key item=dynform}
{include file="form_parts/dynForm_plain.tpl"}
{include file="sub/dynForm_plain.tpl"}
{/foreach}
</center>
</div>
@ -31,7 +32,7 @@ function switchMDataLang()
}
function spread(element, name)
{
{
if (document.forms['editMetaData'].elements['Main___' + name]) document.forms['editMetaData'].elements['Main___' + name].value = element.value;
if (document.forms['editMetaData'].elements['Music_Basic___' + name]) document.forms['editMetaData'].elements['Music_Basic___' + name].value = element.value;
if (document.forms['editMetaData'].elements['Music_Advanced___' + name]) document.forms['editMetaData'].elements['Music_Advanced___' + name].value = element.value;

View File

@ -1,5 +1,6 @@
{* Smarty template *}
<div id="filedata">
{include file="sub/x.tpl"}
<center>
{if $fMetaData}
<textarea rows="25" cols="90" style="font-size:small">{htmlspecialchars str=$fMetaData}</textarea>

View File

@ -11,23 +11,14 @@
{include file="ScratchPad.tpl"}
{/if}
{if $showPath}
{include file="path.tpl"}
{if $structure}
{include file="fileBrowse/path.tpl"}
{/if}
{if $showTree}
{include file="tree.tpl"}
{if $fileBrowse}
{include file="fileBrowse/fileBrowse.tpl"}
{/if}
{if $showObjects}
{include file="objects.tpl"}
{/if}
{if $permissions}
{include file="permissions.tpl"}
{/if}
{if ($showSearchForm || $showSearchRes)}
{include file="search.tpl"}
{/if}
@ -40,6 +31,10 @@
{include file="filedata.tpl"}
{/if}
{if $uploadform}
{include file="uploadform.tpl"}
{/if}
{if $editMetaData}
{include file="editMetaData.tpl"}
{/if}
@ -48,9 +43,6 @@
{include file="systemPrefs.tpl"}
{/if}
{if $uploadform}
{include file="uploadform.tpl"}
{/if}
</div>

View File

@ -1,12 +1,12 @@
<div id="menu_top">
<a href="{$UI_BROWSER}" class="button">[Home directory]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=uploadFileM" class="button">[UploadM]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=uploadFile" class="button">[Upload]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=addWebstream" class="button">[Stream]</a>
<a href="javascript:newFolder()" class="button">[Create&nbsp;new&nbsp;folder]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=search" class="button">[Search]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=subjects" class="button">{tra 0='[Subjects]'}</a>
<a href="{$UI_BROWSER}?act=fileBrowse&id={$GLOBALS.fid}">[File Browser]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.fid}&act=uploadFileM">[UploadM]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.fid}&act=uploadFile">[Upload]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.fid}&act=addWebstream">[Stream]</a>
<a href="javascript:newFolder()">[Create&nbsp;new&nbsp;folder]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=search">[Search]</a>
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=subjects">{tra 0='[Subjects]'}</a>
<!-- <br>
<a href="{$UI_BROWSER}?act=MetaDataValues&Main=1" class="button">[Metadata]</a> -->
<a href="{$UI_BROWSER}?act=editSystemPrefs" class="button">[SystemPrefs]</a>
<a href="{$UI_BROWSER}?act=MetaDataValues&Main=1">[Metadata]</a> -->
<a href="{$UI_BROWSER}?act=editSystemPrefs">[SystemPrefs]</a>
</div>

View File

@ -1,58 +0,0 @@
<div id="objects">
<table border="0" align="center">
{if $structure.msg}
<script langauge="javascript">
<!--
alert('{$structure.msg}');
-->
</script>
{/if}
{if count($structure.listdata)}
{foreach from=$structure.listdata item=o}
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
<td>
<span id="ID{$o.id}">
{if $structure.tree}
{str_repeat str='&nbsp;' count=$o.level}
{else}
{str_repeat str='&nbsp;' count=3}
{/if}
<a {if $o.type eq 'Folder'}href="{$UI_BROWSER}?id={$o.id}" {/if}>[{$o.title}]</a>:&nbsp;&nbsp;
</span>
</td>
<td>
{$a.$o.type}
&nbsp;<a href="javascript:frename('{$o.name}', '{$o.id}')">[rename]</a>
&nbsp;<a href="javascript:fmove('{$o.id}', '.')">[move]</a>
&nbsp;<a href="javascript:fcopy('{$o.id}', '.')">[copy]</a>
&nbsp;<a href="{$UI_BROWSER}?act=permissions&id={$o.id}">[permissions]</a>
<br>
&nbsp;
{if ($delOverride eq $o.id)}
<a href="{$UI_HANDLER}?act=delete&id={$o.id}&delOverride={$o.id}"
onClick="return confirm('Really delete non empty object &quot;{$o.name}&quot; now?')">[DEL]</a>
{else}
<a href="{$UI_HANDLER}?act=delete&id={$o.id}"
onClick="return confirm('Delete object &quot;{$o.name}&quot;?')">[DEL]</a>
{/if}
{if $o.type != 'Folder'}
&nbsp;<a href="{$UI_BROWSER}?act=getFile&id={$o.id}">[Access]</a>
&nbsp;<a href="{$UI_BROWSER}?act=getMData&id={$o.id}">[vMData]</a>
&nbsp;<a href="{$UI_BROWSER}?act=_analyzeFile&id={$o.id}">[Analyze]</a>
&nbsp;<a href="{$UI_BROWSER}?act=editFile&id={$o.id}">[Edit]</a>
&nbsp;<a href="{$UI_BROWSER}?act=editMetaData&id={$o.id}">[eMData]</a>
&nbsp;<a href="#" onclick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$o.id}', '2SP')">[SP]</a>
{/if}
&nbsp;
</td>
</tr>
{/foreach}
{else}
<tr><td align="center" width="400">No objects</td></tr>
{/if}
</table>
</div>

View File

@ -1,17 +0,0 @@
{*Smarty template*}
<div id="path">
<a href="{$UI_BROWSER}?id={$structure.id}&tree=Y" class="button">[Tree view]</a>&nbsp;&nbsp;|&nbsp;
{foreach from=$structure.pathdata item=o}
<a href="{$UI_BROWSER}?id={urlencode str=$o.id}">[{$o.name}]</a>
{if ($o.type eq 'Folder')}
<span class="slash b">/</span>
{/if}
{/foreach}
<!--
<span style="padding-left:6em">
<a href="gbHtmlPerms.php?id={$id}" class="button">permissions</a>
</span> -->
</div>

View File

@ -1,67 +0,0 @@
<div id='permissions'>
<table id="tbl" border="0" cellpadding="5">
<tr><td><b>Subject Name</b></td><td><b>Action</b></td><td><b>Permission</b></td><td></td></tr>
{if (is_array($perms.perms) && count($perms.perms)>0)}
{foreach from=$perms.perms item=row}
{if $row.type eq 'A'}
{assign var='da' value='allow'}
{else}
{if $row.type eq 'D'}
{assign var='da' value='deny'}
{else}
{assign var='da' value=$row.type}
{/if}
{/if}
<tr bgcolor="{cycle values='#eeeeee, #dadada'}">
<td>{* <a <?php #href="alibExPList.php?id=<?php echo$row['subj']? >"?>> *}{$row.login}</a></td>
<td>{$row.action}</td>
<td>{$da}</td>
<td>
<a href="{$UI_HANDLER}?act=removePerm&permid={$row.permid}&oid={$perms.id}&id={$perms.id}"
onClick="return confirm('Delete permission &quot;{$da}&nbsp;{$row.action}&quot; for user {$row.login}?')">[remove]</a>
</td>
</tr>
{/foreach}
{else}
<tr><td colspan="4">No Permissions set.</td></tr>
{/if}
</table>
<br>
<form action="{$UI_HANDLER}" method="post">
Add Permission
<select name="allowDeny">
<option value="A">Allow</option>
<option value="D">Deny</option>
</select>
for Action
<select name="permAction">
<option value="_all">all</option>
{if is_array($perms.actions)}
{foreach from=$perms.actions item='it'}
<option value="{$it}">{$it}</option>
{/foreach}
{/if}
</select>
to Subject
<select name="subj">
{if is_array($perms.subjects)}
{foreach from=$perms.subjects item='it'}
<option value="{$it.id}">{$it.login}</option>
{/foreach}
{/if}
</select>
<input type="hidden" name="act" value="addPerm">
<input type="hidden" name="id" value="{$perms.id}">
<input type="submit" value="Do it!">
</form>
</div>

View File

@ -1,21 +0,0 @@
{*Smarty template*}
<div id="scratchpad">
<center><b>ScratchPad</b></center>
{if is_array($sp)}
<table>
<tr><th></th><th>{tra 0=Name}</th><th>{tra 0=Duration}</th><th>{tra 0=Type}</th><th>Del</th></tr>
{foreach from=$sp item=i}
<tr>
<td><input type="checkbox" name="spid[{$i.id}]"></td>
<td>{$i.title}</td>
<td>{$i.duration}</td>
<td>{$i.type} </td>
<th><a href="#" onclick="hpopup('{$UI_HANDLER}?act=remFromSP&id={$i.id}', 'remFromSP')">X</th>
</tr>
{/foreach}
<tr><td></td><td colspan="2">[Edit]</td><td colspan="2">[Delete]</td></tr>
</table>
{/if}
</div>

View File

@ -44,8 +44,8 @@
function hpopup(url, name) //hidden popup!
{
popupwin = window.open(url, name);
//window.parent.focus();
popupwin = window.open(url, name, 'width=1, height=1');
window.parent.focus();
}
{/literal}

View File

@ -11,9 +11,10 @@
</style>
{/literal}
<div id="searchform">
{include file="sub/x.tpl"}
<center>
{foreach from=$searchform item=dynform}
{include file="form_parts/dynForm_plain.tpl"}
{include file="sub/dynForm_plain.tpl"}
{/foreach}
</center>
</div>
@ -29,8 +30,8 @@
<tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<td>{$s.title}</td>
<td>{$s.duration}</td>
<td><a href="{$UI_BROWSER}?act=getMdata&id={$s.id}">[XML]</a>
<a href="{$UI_BROWSER}?act=editMetaDataValues&id={$s.id}">[Form]</a>
<td>
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=PL.addItem&id={$s.id}', '2PL')">[PL]</a>
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.addItem&id={$s.id}', '2SP')">[SP]</a>
</td>
</tr>

View File

@ -1,156 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id: smarty-static.tpl,v 1.7 2005/02/10 14:27:04 sebastian Exp $ -->
<html>
<head>
<title>Smarty template for ArraySmarty renderer: 2 column layout example</title>
<style type="text/css">
{literal}
.errors {
font-family: sans-serif;
color : #000;
background-color : #FFF;
font-size : 12pt;
}
.label {
font-family: sans-serif;
color : Navy;
font-size : 11px;
text-align : right;
vertical-align : top;
white-space: nowrap;
}
.element {
font-family: sans-serif;
background-color : #EEE;
text-align : left;
white-space: nowrap;
}
.note {
font-family: sans-serif;
background-color : #EEE;
text-align : center;
font-size : 10pt;
color : AAA;
white-space: nowrap;
}
th {
font-family: sans-serif;
font-size : small;
color : #FFF;
background-color : #AAA;
}
.maintable {
border : thin dashed #D0D0D0;
background-color : #EEE;
}
{/literal}
</style>
{$form.javascript}
</head>
<body>
<form {$form.attributes}>
{$form.hidden}
<table class="maintable" width="600" align="center">
<tr>
<td width="50%" valign="top"><!-- Personal info -->
<table width="100%" cellpadding="4">
<tr><th colspan="2">{$form.header.personal}</th></tr>
<tr>
<td class="label">{$form.name.label}</td>
<td class="element">{$form.name.error}
<table cellspacing="0" cellpadding="1">
<tr>
<td>{$form.name.first.html}</td>
<td>{$form.name.last.html}</td>
</tr>
<tr>
<td><font size="1" color="grey">{$form.name.first.label}</font></td>
<td><font size="1" color="grey">{$form.name.last.label}</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="label">{$form.phone.label}</td>
<td class="element">{$form.phone.html}</td>
</tr>
<tr>
<td class="label">{$form.email.label}</td>
<td class="element">{$form.email.html}</td>
</tr>
<tr><td colspan="2" class="note">{$form.pass.label_note}</td></tr>
<tr>
<td class="label">{$form.pass.label}</td>
<td class="element">{$form.pass.html}</td>
</tr>
</table>
</td>
<td width="50%" valign="top"><!-- Company info -->
<table width="100%" cellpadding="4">
<tr><th colspan="2">{$form.header.company_info}</th></tr>
<tr>
<td class="label">{$form.company.label}</td>
<td class="element">{$form.company.html}</td>
</tr>
<tr>
<td class="label" valign="top">{$form.street.label}</td>
<td class="element">{$form.street.html}</td>
</tr>
<tr>
<td class="label">{$form.address.label}</td>
<td class="element">{$form.address.error}
<table cellspacing="0" cellpadding="1">
<tr>
<td>{$form.address.zip.html}</td>
<td>{$form.address.city.html}</td>
</tr>
<tr>
<td><font size="1" color="grey">{$form.address.zip.label}</font></td>
<td><font size="1" color="grey">{$form.address.city.label}</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="label">{$form.country.label}</td>
<td class="element">{$form.country.html}</td>
</tr>
<tr>
<td class="label">{$form.destination.label}</td>
<td class="element">{$form.destination.html}</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="600" align="center">
<tr>
<td>{$form.requirednote}</td>
<td align="right">{$form.reset.html}&nbsp;{$form.submit.html}</td>
</tr>
<tr>
<td colspan="2" style="font-size:11px; color: navy;"><br />{$form.news.html}</td>
</tr>
</table>
</form>
<br />
<b>Collected Errors:</b><br />
{foreach key=name item=error from=$form.errors}
<font color="red">{$error}</font> in element [{$name}]<br />
{/foreach}
&nbsp;
<p><strong>The used "Static" Array</strong></p>
<pre style="font-size: 12px;">
{$static_array|htmlentities}
</pre>
</body>
</html>

View File

@ -143,6 +143,13 @@
margin-top: 10px;
}
.closer {
width : 10px;
float : right;
font-weight : bold;
background-color : Gray;
}
a {
text-decoration: none;
}

View File

@ -1,5 +1,6 @@
{* Smarty template *}
<div id="subjects">
{include file="sub/x.tpl"}
{if $chgPasswd}
{$chgPasswd}

View File

@ -1,5 +1,6 @@
<div id="systemPrefs">
{include file="sub/x.tpl"}
<center>
{include file="form_parts/dynForm_sections.tpl"}
{include file="sub/dynForm_sections.tpl"}
</center>
</div>

View File

@ -1,20 +0,0 @@
{*Smarty template*}
<div id="tree">
{if is_array($structure.treedata)}
{foreach from=$structure.treedata item=o}
<div style="background-color: {cycle values="#eeeeee,#dadada"}">
{$structure.treedata.type}
{if $structure.treedata.tree}
{str_repeat str='&nbsp;' count=3}
{else}
{str_repeat str='&nbsp;&nbsp;' count=$o.level}
{/if}
<a href="{$UI_BROWSER}?id={$o.id}">[{$o.name}]</a><br>
</div>
{/foreach}
{/if}
</div>

View File

@ -1,6 +1,7 @@
{*Smarty template*}
<div id="uploadform">
{include file="sub/x.tpl"}
<center>
{$uploadform}
</center>

View File

@ -1,161 +1,151 @@
<?php
require_once dirname(__FILE__).'/../ui_browser_init.php';
if (is_array($_REQUEST['popup'])){
foreach ($_REQUEST['popup'] as $val) {
switch ($val) {
case "_reload_parent":
$Smarty->display('popup/_reload_parent.tpl');
break;
case "_close":
$Smarty->display('popup/_close.tpl');
break;
case "login":
$Smarty->assign('login', $uiBrowser->login($Smarty, $ui_fmask));
$Smarty->display('popup/login.tpl');
break;
case "logout":
$Smarty->assign('logouttype', 'logout');
$Smarty->display('popup/logout.tpl');
break;
case "signover_1":
$Smarty->assign('logouttype', 'signover');
$Smarty->display('popup/logout.tpl');
break;
case "signover_2":
$Smarty->assign('loginform', $uiBrowser->loginform($Smarty, $ui_fmask));
$Smarty->display('popup/login.tpl');
break;
}
}
die();
};
$uiBrowser->loadSystemPrefs($ui_fmask['systemPrefs']);
$Smarty->assign('systemPrefs', $uiBrowser->systemPrefs); #print_r($uiBrowser->systemPrefs);
if ($uiBrowser->userid) {
$Smarty->assign('showMenuTop', TRUE);
$Smarty->assign('ScratchPad', $uiBrowser->SP->get());
switch ($_REQUEST['act']){
default:
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('showPath', TRUE);
if ($_REQUEST['tree']=='Y') {
$Smarty->assign('showTree', TRUE);
} else {
$Smarty->assign('showObjects', TRUE);
}
$Smarty->assign('delOverride', $_REQUEST['delOverride']);
#$Smarty->assign('obj_types', array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R'));
break;
case "permissions":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('showPath', TRUE);
$Smarty->assign('perms', $uiBrowser->permissions($uiBrowser->id));
$Smarty->assign('permissions', TRUE);
break;
case "uploadFileM":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('showPath', TRUE);
$Smarty->assign('uploadform', $uiBrowser->uploadFileM($uiBrowser->id, $ui_fmask['uploadFileM']));
break;
case "uploadFile":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('showPath', TRUE);
$Smarty->assign('uploadform', $uiBrowser->uploadFile($uiBrowser->id, $ui_fmask['uploadFile']));
break;
case "addWebstream":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('showPath', TRUE);
$Smarty->assign('uploadform', $uiBrowser->addWebstream($uiBrowser->id, $ui_fmask['addWebstream']));
break;
case "editFile":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('showPath', FALSE);
$Smarty->assign('uploadform', $uiBrowser->uploadFile($uiBrowser->id, $ui_fmask['uploadFile']));
break;
case "search":
if (is_array($uiBrowser->search['result']) ){
$Smarty->assign('searchres', $uiBrowser->search['result']);
$Smarty->assign('showSearchRes', TRUE);
};
$Smarty->assign('searchform', $uiBrowser->getSearchForm($_REQUEST['id'], $ui_fmask));
$Smarty->assign('showSearchForm', TRUE);
break;
case "subjects":
case "addUser":
case "addGroup":
$Smarty->assign('subjects', $uiBrowser->getSubjects());
switch($_REQUEST['act']) {
case "addUser": $Smarty->assign('addSubjectForm', $uiBrowser->getAddSubjectForm($ui_fmask['addUser'])); break;
case "addGroup": $Smarty->assign('addSubjectForm', $uiBrowser->getAddSubjectForm($ui_fmask['addGroup'])); break;
}
$Smarty->assign('showSubjects', TRUE);
break;
case "chgPasswd":
$Smarty->assign('chgPasswd', $uiBrowser->chgPasswd($_REQUEST['uid'], $ui_fmask['chgPasswd']));
$Smarty->assign('showSubjects', TRUE);
break;
case "groupMembers":
$Smarty->assign('groupMembers', $uiBrowser->groupMembers($uiBrowser->id));
$Smarty->assign('addGroupMember', $uiBrowser->addGroupMember($uiBrowser->id));
$Smarty->assign('showSubjects', TRUE);
break;
case "getFile":
$Smarty->assign('fData', $uiBrowser->getFile($uiBrowser->id));
$Smarty->assign('showFile', TRUE);
break;
case "getMData":
$Smarty->assign('fMetaData', $uiBrowser->getMdata($uiBrowser->id));
$Smarty->assign('showFile', TRUE);
break;
case "editMetaData":
$Smarty->assign('editMetaData', $uiBrowser->editMetaData($uiBrowser->id, $ui_fmask['metaData'], TRUE));
break;
case "_analyzeFile":
$Smarty->assign('_analyzeFile', $uiBrowser->_analyzeFile($uiBrowser->id, 'text'));
$Smarty->assign('showFile', TRUE);
break;
case "editSystemPrefs":
$Smarty->assign('dynform', $uiBrowser->systemPrefsForm($ui_fmask['systemPrefs']));
$Smarty->assign('editSystemPrefs', TRUE);
break;
}
}
$Smarty->display('main.tpl');
?>
<?php
require_once dirname(__FILE__).'/../ui_browser_init.php';
if (is_array($_REQUEST['popup'])){
foreach ($_REQUEST['popup'] as $val) {
switch ($val) {
case "_reload_parent":
$Smarty->display('popup/_reload_parent.tpl');
break;
case "_close":
$Smarty->display('popup/_close.tpl');
break;
case "login":
$Smarty->assign('login', $uiBrowser->login($Smarty, $ui_fmask));
$Smarty->display('popup/login.tpl');
break;
case "logout":
$Smarty->assign('logouttype', 'logout');
$Smarty->display('popup/logout.tpl');
break;
case "signover_1":
$Smarty->assign('logouttype', 'signover');
$Smarty->display('popup/logout.tpl');
break;
case "signover_2":
$Smarty->assign('loginform', $uiBrowser->loginform($Smarty, $ui_fmask));
$Smarty->display('popup/login.tpl');
break;
}
}
die();
};
$uiBrowser->loadSystemPrefs($ui_fmask['systemPrefs']);
$Smarty->assign('systemPrefs', $uiBrowser->systemPrefs);
if ($uiBrowser->userid) {
$Smarty->assign('showMenuTop', TRUE);
$Smarty->assign('ScratchPad', $uiBrowser->SP->get());
switch ($_REQUEST['act']){
case "fileBrowse":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->fid));
$Smarty->assign('fileBrowse', TRUE);
if ($_REQUEST['tree']=='Y')
$Smarty->assign('showTree', TRUE);
else
$Smarty->assign('showObjects', TRUE);
$Smarty->assign('delOverride', $_REQUEST['delOverride']);
break;
case "permissions":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('permissions', $uiBrowser->permissions($uiBrowser->id));
$Smarty->assign('fileBrowse', TRUE);
break;
case "uploadFileM":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('uploadform', $uiBrowser->uploadFileM($ui_fmask['uploadFileM'], $uiBrowser->id));
break;
case "uploadFile":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('uploadform', $uiBrowser->uploadFile($ui_fmask['uploadFile'], $uiBrowser->id, $_REQUEST['replace']));
break;
case "addWebstream":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('uploadform', $uiBrowser->addWebstream($ui_fmask['addWebstream'], $uiBrowser->id, $_REQUEST['replace']));
break;
case "editMetaData":
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
$Smarty->assign('editMetaData', $uiBrowser->editMetaData($uiBrowser->id, TRUE));
break;
case "search":
if (is_array($uiBrowser->search['criteria']) ){
$Smarty->assign('searchres', $uiBrowser->search['result']);
$Smarty->assign('showSearchRes', TRUE);
};
$Smarty->assign('searchform', $uiBrowser->getSearchForm($uiBrowser->id, $ui_fmask));
$Smarty->assign('showSearchForm', TRUE);
break;
case "subjects":
case "addUser":
case "addGroup":
$Smarty->assign('subjects', $uiBrowser->getSubjects());
switch($_REQUEST['act']) {
case "addUser": $Smarty->assign('addSubjectForm', $uiBrowser->getAddSubjectForm($ui_fmask['addUser'])); break;
case "addGroup": $Smarty->assign('addSubjectForm', $uiBrowser->getAddSubjectForm($ui_fmask['addGroup'])); break;
}
$Smarty->assign('showSubjects', TRUE);
break;
case "chgPasswd":
$Smarty->assign('chgPasswd', $uiBrowser->chgPasswd($uiBrowser->id, $ui_fmask['chgPasswd']));
$Smarty->assign('showSubjects', TRUE);
break;
case "groupMembers":
$Smarty->assign('groupMembers', $uiBrowser->groupMembers($uiBrowser->id));
$Smarty->assign('addGroupMember', $uiBrowser->addGroupMember($uiBrowser->id));
$Smarty->assign('showSubjects', TRUE);
break;
case "getFile":
$Smarty->assign('fData', $uiBrowser->getFile($uiBrowser->id));
$Smarty->assign('showFile', TRUE);
break;
case "getMData":
$Smarty->assign('fMetaData', $uiBrowser->getMdata($uiBrowser->id));
$Smarty->assign('showFile', TRUE);
break;
case "_analyzeFile":
$Smarty->assign('_analyzeFile', $uiBrowser->_analyzeFile($uiBrowser->id, 'text'));
$Smarty->assign('showFile', TRUE);
break;
case "editSystemPrefs":
$Smarty->assign('dynform', $uiBrowser->systemPrefsForm($ui_fmask['systemPrefs']));
$Smarty->assign('editSystemPrefs', TRUE);
break;
}
}
$Smarty->display('main.tpl');
?>

View File

@ -27,11 +27,29 @@ switch($_REQUEST['act']){
$uiHandler->SP->addItem($ui_tmpid);
break;
case "replaceFile":
$ui_tmpgunid = $uiHandler->gb->_gunidFromId($uiHandler->id);
if ($uiHandler->delete($uiHandler->id)) {
$ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $uiHandler->pid, $ui_fmask["uploadFile"], $ui_tmpgunid);
$uiHandler->SP->removeItems($uiHandler->id);
$uiHandler->SP->addItem($ui_tmpid);
}
break;
case "addWebstream":
if ($ui_tmpid = $uiHandler->addWebstream($_REQUEST, $uiHandler->id, $ui_fmask['addWebstream']))
$uiHandler->SP->addItem($ui_tmpid);
break;
case "replaceWebstream":
$ui_tmpgunid = $uiHandler->gb->_gunidFromId($uiHandler->id);
if ($uiHandler->delete($uiHandler->id)) {
$ui_tmpid = $uiHandler->addWebstream($_REQUEST, $uiHandler->pid, $ui_fmask['addWebstream'], $ui_tmpgunid);
$uiHandler->SP->removeItems($uiHandler->id);
$uiHandler->SP->addItem($ui_tmpid);
}
break;
case "newFolder":
$uiHandler->newFolder($_REQUEST["newname"], $uiHandler->id);
break;
@ -49,7 +67,8 @@ switch($_REQUEST['act']){
break;
case "delete":
$uiHandler->delete($uiHandler->id, $_REQUEST["delOverride"]);
if ($uiHandler->delete($uiHandler->id, $_REQUEST['delOverride']))
$uiHandler->SP->removeItems($uiHandler->id);
break;
case "addUser":
@ -89,7 +108,8 @@ switch($_REQUEST['act']){
break;
case "editMetaData":
$uiHandler->editMetaData($uiHandler->id, $_REQUEST, $ui_fmask["metaData"]);
$uiHandler->editMetaData($uiHandler->id, $_REQUEST);
$uiHandler->SP->reLoadM();
break;
case "SP.addItem":
@ -113,7 +133,7 @@ switch($_REQUEST['act']){
default:
$_SESSION["alertMsg"] = tra("Unknown method: $1", $_REQUEST["act"]);
header("Location: ".UI_BROWSER);
header("Location: ".UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close');
die();
}
if ($uiHandler->alertMsg) $_SESSION['alertMsg'] = $uiHandler->alertMsg;

View File

@ -81,16 +81,20 @@ class uiBase
die($this->dbc->getMessage());
}
$this->dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$this->gb =& new GreenBox(&$this->dbc, $config);
$this->config = $config;
$this->sessid = $_REQUEST[$config['authCookieName']];
$this->userid = $this->gb->getSessUserId($this->sessid);
$this->login = $this->gb->getSessLogin($this->sessid);
$this->id = $_REQUEST['id'] ? $_REQUEST['id'] : $this->gb->getObjId($this->login, $this->gb->storId);
$this->gb =& new GreenBox($this->dbc, $config);
$this->config = $config;
$this->sessid = $_REQUEST[$config['authCookieName']];
$this->userid = $this->gb->getSessUserId($this->sessid);
$this->login = $this->gb->getSessLogin($this->sessid);
$this->id = $_REQUEST['id'] ? $_REQUEST['id'] : $this->gb->getObjId($this->login, $this->gb->storId);
$this->pid = $this->gb->getparent($this->id) != 1 ? $this->gb->getparent($this->id) : FALSE;
$this->type = $this->gb->getFileType($this->id);
$this->fid = $this->type=='Folder' ? $this->id : $this->pid;
$this->InputTextStandardAttrib = array('size' =>UI_INPUT_STANDARD_SIZE,
'maxlength'=>UI_INPUT_STANDARD_MAXLENGTH);
$this->SP =& new uiScratchPad(&$this);
$this->SP =& new uiScratchPad($this);
$this->systemPrefs =& $_SESSION[UI_STATIONINFO_SESSNAME];
$this->search =& $_SESSION[UI_SEARCH_SESSNAME];
}
@ -313,6 +317,7 @@ class uiBase
function _niceTime($in)
{
list ($in, $lost) = explode('.', $in);
if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in))
list($h, $i, $s) = explode(':', $in);
elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in))
@ -335,22 +340,27 @@ class uiBase
function _getMDataValue($id, $key)
{
$value = array_pop($this->gb->getMDataValue($id, $key, $this->sessid));
return $value['value'];
if (is_array($arr = $this->gb->getMDataValue($id, $key, $this->sessid))) {
$value = array_pop($arr);
return $value['value'];
}
return FALSE;
}
function _getFileTitle($id)
{
$file = array_pop($this->gb->getPath($id));
return $file['name'];
if (is_array($arr = $this->gb->getPath($id))) {
$file = array_pop($arr);
return $file['name'];
}
return FALSE;
}
function _isFolder($id)
{
if (strtolower($this->gb->getFileType($id)) != 'folder') {
$this->_retMsg('Parent is not Folder');
return FALSE;
}
return TRUE;

View File

@ -17,7 +17,7 @@ class uiBrowser extends uiBase {
}
/**
* login
* performAction
*
* Perform a frontend action
* map to a function called action_<actionName>.inc.php
@ -117,28 +117,27 @@ class uiBrowser extends uiBase {
{
$data = array(
'pathdata' => $this->gb->getPath($id, $this->sessid),
'listdata' => ($this->gb->getObjType($id)=='Folder'?
$this->gb->listFolder($id, $this->sessid) : array()),
#'tree' => ($_REQUEST['tree']=='Y'),
'showPath' => true,
'showTree' => true,
'listdata' => $this->gb->getObjType($id)=='Folder' ? $this->gb->listFolder($id, $this->sessid) : array(),
);
if($_REQUEST['tree']=='Y'){
$data['treedata'] = $this->gb->getSubTree($id, $this->sessid);
if($_REQUEST['tree']=='Y'){
$tmp = $this->gb->getSubTree($id, $this->sessid);
foreach ($tmp as $key=>$val) {
$val['type'] = $this->gb->getFileType($val['id']);
$data['treedata'][$key] = $val;
}
}
if(PEAR::isError($data['listdata'])){
$data['msg'] = $data['listdata']->getMessage();
$data['listdata'] = array();
} else {
foreach ($data['listdata'] as $key=>$val) {
if ($val['type'] != 'Folder')
$data['listdata'][$key]['title'] = $this->_getMDataValue($val['id'], 'title');
else
$data['listdata'][$key]['title'] = $val['name'];
}
return FALSE;
}
foreach ($data['listdata'] as $key=>$val) {
if ($val['type'] != 'Folder')
$data['listdata'][$key]['title'] = $this->_getMDataValue($val['id'], 'title');
else
$data['listdata'][$key]['title'] = $val['name'];
}
#print_r($data);
return $data;
}
@ -152,16 +151,13 @@ class uiBrowser extends uiBase {
*
* @eturn string (html)
*/
function uploadFileM($id, $mask)
function uploadFileM(&$mask, $id)
{
$form = new HTML_QuickForm('uploadFileM', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setMaxFileSize(!PEAR::isError($this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'maxfilesize')) ?
$this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'maxfilesize')
: ini_get('upload_max_filesize'));
$form->setConstants(array('id' => $id));
$form->setMaxFileSize($this->systemPrefs['stationMaxfilesize']);
$form->setConstants(array('id' => $id,
'act' => 'uploadFileM'));
$this->_parseArr2Form($form, $mask);
return $form->toHTML();
}
@ -175,16 +171,13 @@ class uiBrowser extends uiBase {
*
* @eturn string (html)
*/
function uploadFile($id, $mask)
function uploadFile(&$mask, $id, $replace=FALSE)
{
$form = new HTML_QuickForm('uploadFile', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setMaxFileSize(!PEAR::isError($this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'maxfilesize')) ?
$this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'maxfilesize')
: ini_get('upload_max_filesize'));
$form->setConstants(array('id' => $id));
$form->setMaxFileSize($this->systemPrefs['stationMaxfilesize']);
$form->setConstants(array('id' => $id,
'act' => $replace ? 'replaceFile' : 'uploadFile'));
$this->_parseArr2Form($form, $mask);
return $form->toHTML();
}
@ -198,16 +191,12 @@ class uiBrowser extends uiBase {
*
* @eturn string (html)
*/
function addWebstream($id, $mask)
function addWebstream($mask, $id, $replace=FALSE)
{
$form = new HTML_QuickForm('addWebstream', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setMaxFileSize(!PEAR::isError($this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'maxfilesize')) ?
$this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'maxfilesize')
: ini_get('upload_max_filesize'));
$form->setConstants(array('id' => $id));
$form->setConstants(array('id' => $id,
'act' => $replace ? 'replaceWebstream' : 'addWebstream'));
$this->_parseArr2Form($form, $mask);
return $form->toHTML();
}
@ -222,8 +211,7 @@ class uiBrowser extends uiBase {
function getSubjects()
{
return array('subj' => $this->gb->getSubjectsWCnt(),
'loggedAs' => $this->login
);
'loggedAs' => $this->login);
}
@ -291,7 +279,6 @@ class uiBrowser extends uiBase {
foreach($g['subj'] as $s) {
$this->logins[($s['login'])]=$s['login'];
}
$form = new HTML_QuickForm('addGroupMember', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setConstants(array('act'=>'addGroupMember',
'reid'=>$g['id'],
@ -303,7 +290,6 @@ class uiBrowser extends uiBase {
$s->loadArray($this->logins, NULL);
$form->addElement($s);
$form->addElement('submit', NULL, tra('Do'));
return $form->toHTML();
}
@ -323,8 +309,7 @@ class uiBrowser extends uiBase {
'actions' => $this->gb->getAllowedActions($this->gb->getObjType($id)),
'subjects' => $this->gb->getSubjects(),
'id' => $id,
'loggedAs' => $this->login
);
'loggedAs' => $this->login);
}
@ -337,26 +322,24 @@ class uiBrowser extends uiBase {
*
* @return string (html)
*/
function getSearchForm($id, &$mask)
function getSearchForm($id, &$mask2)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setConstants(array('id'=>$id, 'counter'=>UI_SEARCH_MIN_ROWS));
foreach ($mask['metaData']['tabs']['group']['group'] as $k=>$v) {
foreach ($mask['metaData']['pages'][$v] as $val){
foreach ($mask['tabs']['group']['group'] as $k=>$v) {
foreach ($mask['pages'][$v] as $val){
$col1[$this->_formElementEncode($val['element'])] = $val['label'];
if (isset($val['relation']))
$col2[$this->_formElementEncode($val['element'])] = $mask['relations'][$val['relation']];
$col2[$this->_formElementEncode($val['element'])] = $mask2['relations'][$val['relation']];
else
$col2[$this->_formElementEncode($val['element'])] = $mask['relations']['standard'];
$col2[$this->_formElementEncode($val['element'])] = $mask2['relations']['standard'];
};
};
for($n=1; $n<=UI_SEARCH_MAX_ROWS; $n++) {
unset ($group);
$form->addElement('static', 's1', NULL, "<div id='searchRow_$n'>");
if ($n > UI_SEARCH_MIN_ROWS) $form->addElement('static', 's1_style', NULL, "<style type='text/css'>#searchRow_$n {visibility : hidden; height : 0px;}</style>");
$sel = &$form->createElement('hierselect', "row_$n", NULL);
$sel->setOptions(array($col1, $col2));
@ -366,15 +349,13 @@ class uiBrowser extends uiBase {
$form->addGroup($group);
$form->addElement('static', 's2', NULL, "</div id='searchRow_$n'>");
}
$this->_parseArr2Form($form, $mask['searchform']);
$this->_parseArr2Form($form, $mask2['searchform']);
$form->setConstants($this->search['criteria']);
$form->validate();
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['dynform'] = $renderer->toArray();
#print_r($output);
#print_r($output);
return $output;
}
@ -417,8 +398,10 @@ class uiBrowser extends uiBase {
* @param id int
* @return string (html)
*/
function editMetaData($id, $mask, $get=FALSE, $data=NULL)
function editMetaData($id, $get=FALSE, $data=NULL)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';
$form = new HTML_QuickForm('tabs', UI_STANDARD_FORM_METHOD, UI_BROWSER);
$this->_parseArr2Form($form, $mask['tabs']);
$output['tabs'] = $form->toHTML();

View File

@ -7,7 +7,7 @@ require_once dirname(__FILE__).'/ui_base.inc.php';
require_once dirname(__FILE__).'/ui_browser.class.php';
require_once dirname(__FILE__).'/ui_scratchPad.class.php';
require_once dirname(__FILE__).'/../../storageServer/var/GreenBox.php';
require_once dirname(__FILE__).'/formmask/general.inc.php';
## well known classes ###############################################
require_once dirname(__FILE__).'/html/Smarty/libs/Smarty.class.php';
@ -40,7 +40,12 @@ $Smarty->load_filter('output', 'localizer');
## some basic things ################################################
$Smarty->assign('UI_BROWSER', UI_BROWSER);
$Smarty->assign('UI_HANDLER', UI_HANDLER);
$Smarty->assign('GLOBALS', array_merge($GLOBALS, array('id' => &$uiBrowser->id))); ## ??? really all GLOBALS ??? ##
$Smarty->assign('GLOBALS', array(
'id' => &$uiBrowser->id,
'pid' => &$uiBrowser->pid,
'fid' => &$uiBrowser->fid
)
);
$Smarty->assign('user', array('sessid' => &$uiBrowser->sessid,
'userid' => &$uiBrowser->userid,
'login' => &$uiBrowser->login
@ -55,8 +60,4 @@ if (is_array($_SESSION['retransferFormData'])){
}
unset($_SESSION['retransferFormData']);
}
## mask for forms, at the end because $uiBase is used ###############
require_once dirname(__FILE__).'/ui_fmask.inc.php';
?>

View File

@ -42,17 +42,15 @@ class uiHandler extends uiBase {
$sessid = $this->gb->login($formdata['login'], $formdata['pass']);
if($sessid && !PEAR::isError($sessid)){
setcookie($this->config['authCookieName'], $sessid);
$fid = $this->gb->getObjId($formdata['login'], $this->gb->storId);
if(!PEAR::isError($fid)) $this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
$id = $this->gb->getObjId($formdata['login'], $this->gb->storId);
if(!PEAR::isError($id)) $this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
}else{
$this->_retMsg('Login failed.');
$_SESSION['retransferFormData']['login']=$formdata['login'];
$this->redirUrl = UI_BROWSER.'?popup[]=login';
}
}
}
}
/**
* logout
@ -86,40 +84,35 @@ class uiHandler extends uiBase {
*/
function uploadFileM(&$formdata, $id, &$mask)
{
if ($this->_isFolder($id)) {
if ($this->_validateForm($formdata, $mask)) {
$tmpgunid = md5(
microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport"
);
$ntmp = $this->gb->bufferDir.'/'.$tmpgunid;
$mdtmp = "";
move_uploaded_file($formdata['mediafile']['tmp_name'], $ntmp);
chmod($ntmp, 0664);
if($formdata['mdatafile']['tmp_name']){
$mdtmp = "$ntmp.xml";
if(move_uploaded_file($formdata['mdatafile']['tmp_name'], $mdtmp)){
chmod($mdtmp, 0664);
}
}
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, $mdtmp, $this->sessid);
if(PEAR::isError($r)) {
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?act=uploadFileM&id=".$id;
return FALSE;
} else{
@unlink($ntmp);
@unlink($mdtmp);
$this->redirUrl = UI_BROWSER."?id=".$id;
return $r;
}
} else {
$this->redirUrl = UI_BROWSER."?act=uploadFileM&id=".$id;
return FALSE;
}
} else {
$this->redirUrl = UI_BROWSER.'?id='.$this->gb->getParent($id);
if (!$this->_isFolder($id)) {
$this->_retMsg('Target is not Folder');
$this->redirUrl = UI_BROWSER.'?act=fileBrowse&id='.$id;
return FALSE;
}
if (!$this->_validateForm($formdata, $mask)) {
$this->redirUrl = UI_BROWSER."?act=uploadFileM&id=".$id;
return FALSE;
}
$tmpgunid = md5(microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport");
$ntmp = $this->gb->bufferDir.'/'.$tmpgunid;
move_uploaded_file($formdata['mediafile']['tmp_name'], $ntmp);
chmod($ntmp, 0664);
if($formdata['mdatafile']['tmp_name']){
$mdtmp = "$ntmp.xml";
if(move_uploaded_file($formdata['mdatafile']['tmp_name'], $mdtmp)){
chmod($mdtmp, 0664);
}
}
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, $mdtmp, $this->sessid);
@unlink($ntmp);
@unlink($mdtmp);
if(PEAR::isError($r)) {
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?act=uploadFileM&id=".$id;
return FALSE;
}
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$id;
return $r;
}
@ -131,38 +124,32 @@ class uiHandler extends uiBase {
* @param formdata array, submitted text and file
* @param id int, destination folder id
*/
function uploadFile(&$formdata, $id, &$mask)
function uploadFile(&$formdata, $id, &$mask, $replace=NULL)
{
if ($this->_isFolder($id)) {
if ($this->_validateForm($formdata, $mask)) {
$tmpgunid = md5(
microtime().$_SERVER['SERVER_ADD3R'].rand()."org.mdlf.livesupport"
);
$ntmp = $this->gb->bufferDir.'/'.$tmpgunid;
$mdtmp = "";
move_uploaded_file($formdata['mediafile']['tmp_name'], $ntmp);
chmod($ntmp, 0664);
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, NULL, $this->sessid);
if(PEAR::isError($r)) {
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?act=uploadFile&id=$id";
return FALSE;
} else{
@unlink($ntmp);
@unlink($mdtmp);
$this->redirUrl = UI_BROWSER."?act=editMetaData&id=$r";
$this->gb->replaceMetadata($r, $this->_analyzeFile($r, 'xml'), 'string', $this->sessid);
return $r;
}
} else {
$this->redirUrl = UI_BROWSER."?act=uploadFile&id=$id";
return FALSE;
}
} else {
$this->redirUrl = UI_BROWSER.'?id='.$this->gb->getParent($id);
if (!$replace && $this->type!='Folder') {
$this->_retMsg ('Target is not Folder');
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$pid;
return FALSE;
}
if (!$this->_validateForm($formdata, $mask)) {
$this->redirUrl = UI_BROWSER."?act=addWebstream&id=".$id;
return FALSE;
}
$tmpgunid = md5(microtime().$_SERVER['SERVER_ADD3R'].rand()."org.mdlf.livesupport");
$ntmp = $this->gb->bufferDir.'/'.$tmpgunid;
move_uploaded_file($formdata['mediafile']['tmp_name'], $ntmp);
chmod($ntmp, 0664);
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, NULL, $this->sessid, $replace);
@unlink($ntmp);
if(PEAR::isError($r)) {
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?act=uploadFile&id=".$pid;
return FALSE;
}
$this->gb->replaceMetadata($r, $this->_analyzeFile($r, 'xml'), 'string', $this->sessid);
$this->redirUrl = UI_BROWSER."?act=editMetaData&id=$r";
return $r;
}
@ -174,32 +161,28 @@ class uiHandler extends uiBase {
* @param formdata array, submitted text and file
* @param id int, destination folder id
*/
function addWebstream(&$formdata, $id, &$mask)
function addWebstream(&$formdata, $id, &$mask, $replace=NULL)
{
if ($this->_isFolder($id)) {
if ($this->_validateForm($formdata, $mask)) {
$r = $this->gb->storeWebstream($id, $formdata['name'], NULL, $this->sessid, NULL, $formdata['url']);
if(PEAR::isError($r)) {
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?act=addWebstream&id=$id";
return FALSE;
}
else{
$data = $this->_dateArr2Str($formdata);
$this->gb->setMDataValue($r, 'dc:title', $this->sessid, $data['name']);
$this->gb->setMDataValue($r, 'dcterms:extent', $this->sessid, $data['duration']);
$this->redirUrl = UI_BROWSER."?act=editMetaData&id=$r";
return $r;
}
} else {
$this->redirUrl = UI_BROWSER."?act=addWebstream&id=$id";
return FALSE;
}
} else {
$this->redirUrl = UI_BROWSER.'?id='.$this->gb->getParent($id);
if (!$replace && $this->type != 'Folder') {
$this->_retMsg ('Target is not Folder');
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$pid;
return FALSE;
}
if (!$this->_validateForm($formdata, $mask)) {
$this->redirUrl = UI_BROWSER."?act=addWebstream&id=".$id;
return FALSE;
}
$r = $this->gb->storeWebstream($id, $formdata['name'], NULL, $this->sessid, $replace, $formdata['url']);
if(PEAR::isError($r)) {
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?act=addWebstream&id=".$id;
return FALSE;
}
$data = $this->_dateArr2Str($formdata);
$this->gb->setMDataValue($r, 'dc:title', $this->sessid, $data['name']);
$this->gb->setMDataValue($r, 'dcterms:extent', $this->sessid, $data['duration']);
$this->redirUrl = UI_BROWSER."?act=editMetaData&id=$r";
return $r;
}
@ -209,18 +192,14 @@ class uiHandler extends uiBase {
* Create new folder in the storage
*
* @param newname string, name for the new folder
* @param id int, destination folder id
* @param id int, local id to create folder in
*/
function newFolder($newname, $id)
function newFolder($name, $id)
{
if ($this->_isFolder($id)) {
$r = $this->gb->createFolder($id, $newname, $this->sessid);
if(PEAR::isError($r))
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER.'?id='.$id;
} else {
$this->redirUrl = UI_BROWSER.'?id='.$this->gb->getParent($id);
}
$r = $this->gb->createFolder($id, $name, $this->sessid);
if(PEAR::isError($r))
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER.'?act=fileBrowse&id='.$this->id;
}
/**
@ -233,10 +212,9 @@ class uiHandler extends uiBase {
*/
function rename($newname, $id)
{
$parid = $this->gb->getparent($this->id);
$r = $this->gb->renameFile($id, $newname, $this->sessid);
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?id=$parid";
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$this->pid;
}
/**
@ -250,15 +228,14 @@ class uiHandler extends uiBase {
*/
function move($newPath, $id)
{
$newPath = urlencode($newPath);
$newPath = urldecode($newPath);
$did = $this->gb->getObjIdFromRelPath($id, $newPath);
$parid = $this->gb->getparent($id);
$r = $this->gb->moveFile($id, $did, $this->sessid);
if(PEAR::isError($r)){
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?id=$parid";
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$this->pid;
}
else $this->redirUrl = UI_BROWSER."?id=$did";
else $this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$did;
}
/**
@ -274,13 +251,12 @@ class uiHandler extends uiBase {
{
$newPath = urldecode($newPath);
$did = $this->gb->getObjIdFromRelPath($id, $newPath);
$parid = $this->gb->getparent($id);
$r = $this->gb->copyFile($id, $did, $this->sessid);
if(PEAR::isError($r)){
$this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?id=$parid";
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$this->pid;
}
else $this->redirUrl = UI_BROWSER."?id=$did";
else $this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$did;
}
/**
@ -293,20 +269,21 @@ class uiHandler extends uiBase {
*/
function delete($id, $delOverride=FALSE)
{
$parid = $this->gb->getparent($id);
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$this->pid;
## add emtyness-test here ###
if (!($delOverride==$id) && (count($this->gb->getObjType($id)=='Folder'?
$this->gb->listFolder($id, $this->sessid):NULL))) {
$this->_retMsg("Folder is not empty. You can override this protection by clicking DEL again");
$this->redirUrl = UI_BROWSER."?id=$parid&delOverride=$id";
return;
$this->redirUrl = UI_BROWSER."?act=fileBrowse&id=".$this->pid."&delOverride=$id";
return FALSE;
}
#############################
$r = $this->gb->deleteFile($id, $this->sessid);
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
$this->redirUrl = UI_BROWSER."?id=$parid";
if(PEAR::isError($r)) {
$this->_retMsg($r->getMessage());
return FALSE;
}
return TRUE;
}
@ -439,7 +416,7 @@ class uiHandler extends uiBase {
}else{
$this->_retMsg('Access denied.');
}
$this->redirUrl = UI_BROWSER.'?id='.$id.'&act=permissions';
$this->redirUrl = UI_BROWSER.'?act=permissions&id='.$id;
}
/**
@ -504,9 +481,11 @@ class uiHandler extends uiBase {
}
function editMetaData($id, &$formdata, &$mask)
function editMetaData($id, &$formdata)
{
$this->redirUrl = UI_BROWSER.'?id='.$this->gb->getParent($id);
include dirname(__FILE__).'/formmask/metadata.inc.php';
$this->redirUrl = UI_BROWSER.'?act=fileBrowse&id='.$this->pid;
## first remove old entrys
$this->gb->replaceMetaData($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid);
@ -546,6 +525,7 @@ class uiHandler extends uiBase {
}
if ($was_error) {
$_SESSION['retransferFormData'] = array_merge($_REQUEST, $_FILES);
$this->retMsg('Invalid Form Data');
return FALSE;
}
}
@ -601,30 +581,33 @@ class uiHandler extends uiBase {
*/
function search(&$formdata)
{
$this->search = FALSE;;
$this->search['criteria']['operator'] = $formdata['operator'];
$this->search['criteria']['filetype'] = $formdata['filetype'];
$this->search = FALSE;
if ($formdata['clear']) {
$this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
} else {
$this->redirUrl = UI_BROWSER.'?act=search&id='.$formdata['id'];
$this->search['criteria']['operator'] = $formdata['operator'];
$this->search['criteria']['filetype'] = $formdata['filetype'];
foreach ($formdata as $key=>$val) {
if (is_array($val) && strlen($val[2])) {
$critArr[] = array('cat' => $this->_formElementDecode($val[0]),
'op' => $val[1],
'val' => $val[2]
);
$this->search['criteria'][$key] = $val;
foreach ($formdata as $key=>$val) {
if (is_array($val) && strlen($val[2])) {
$critArr[] = array('cat' => $this->_formElementDecode($val[0]),
'op' => $val[1],
'val' => $val[2]
);
$this->search['criteria'][$key] = $val;
}
}
}
$searchCriteria = array('filetype' => $formdata['filetype'],
'operator' => $formdata['operator'],
'conditions'=> $critArr
);
$searchCriteria = array('filetype' => $formdata['filetype'],
'operator' => $formdata['operator'],
'conditions'=> $critArr
);
$results = $this->gb->localSearch($searchCriteria, $this->sessid);
foreach ($results['results'] as $rec) {
$results = $this->gb->localSearch($searchCriteria, $this->sessid);
foreach ($results['results'] as $rec) {
$this->search['result'][] = $this->_getMetaInfo($this->gb->_idFromGunid($rec));
}
$this->redirUrl = UI_BROWSER.'?act=search&id='.$formdata['id'];
}
}
}

View File

@ -8,7 +8,7 @@ require_once dirname(__FILE__).'/ui_base.inc.php';
require_once dirname(__FILE__).'/ui_handler.class.php';
require_once dirname(__FILE__).'/ui_scratchPad.class.php';
require_once dirname(__FILE__).'/../../storageServer/var/GreenBox.php';
require_once dirname(__FILE__).'/formmask/general.inc.php';
## well known classes ###############################################
require_once 'DB.php';
@ -23,9 +23,6 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
## initialize objects ###############################################
$uiHandler =& new uiHandler($config);
#$uiBase = new uiBase($config);
$uiBase =& $uiHandler;
$uiBase =& $uiHandler;
#$uiScratchPad =& new uiScratchPad(&$uiHandler);
## mask for forms, at the end because $uiBase is used ###############
require_once dirname(__FILE__).'/ui_fmask.inc.php';
?>

View File

@ -3,9 +3,9 @@ class uiScratchPad
{
function uiScratchPad(&$uiBase)
{
$this->Base = &$uiBase;
$this->items = &$_SESSION[UI_SCRATCHPAD_SESSNAME]['content'];
$this->order = &$_SESSION[UI_SCRATCHPAD_SESSNAME]['order'];
$this->Base =& $uiBase;
$this->items =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['content'];
$this->order =& $_SESSION[UI_SCRATCHPAD_SESSNAME]['order'];
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
}
@ -44,7 +44,8 @@ class uiScratchPad
foreach($arr as $gunid) {
if (preg_match('/[0-9]{1,20}/', $gunid)) {
if ($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)) != FALSE) {
$this->items[] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid)));
if ($i = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($this->Base->_toHex($gunid))))
$this->items[] = $i;
}
}
}
@ -64,10 +65,15 @@ class uiScratchPad
function addItem($id)
{
if(!$this->Base->systemPrefs[UI_SCRATCHPAD_MAXLENGTH_KEY]) {
$this->Base->_retMsg('ScratchPad length is not set in System Preferences, so it cannot be used.');
return false;
}
$item = $this->Base->_getMetaInfo($id);
$sp = $this->get();
foreach ($sp as $key=>$val) {
if ($val['gunid'] == $item['gunid']) {
if ($val['id'] == $item['id']) {
unset($sp[$key]);
$this->Base->_retMsg('Entry $1 was already on SP since $2.\nMoved to Top.', $item['title'], $val['added']);
} else {
@ -84,7 +90,7 @@ class uiScratchPad
function removeItems($ids)
{
if (!$ids)
return; ## empty parameter
return FALSE; ## empty parameter
if (!is_array($ids))
$ids = array($ids); ## just single id given
@ -92,12 +98,14 @@ class uiScratchPad
$info = $this->Base->_getMetaInfo($id);
$sp =& $this->get();
foreach ($sp as $key=>$val) {
if ($val['gunid'] == $info['gunid']) {
if ($val['id'] == $info['id']) {
unset ($sp[$key]);
#$this->Base->decAccessCounter($id);
}
}
}
return TRUE;
}
@ -119,5 +127,12 @@ class uiScratchPad
$this->items = $res;
}
function reLoadM()
{
foreach($this->items as $key=>$val)
$this->items[$key] = $this->Base->_getMetaInfo($val['id']);
}
}
?>