*** empty log message ***
This commit is contained in:
parent
7391795ac5
commit
b74cb6e047
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: sebastian $
|
Author : $Author: sebastian $
|
||||||
Version : $Revision: 1.8 $
|
Version : $Revision: 1.9 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -124,5 +124,5 @@ define('UI_SEARCH_MAX_ROWS', 8);
|
||||||
define('UI_SEARCH_MIN_ROWS', 2);
|
define('UI_SEARCH_MIN_ROWS', 2);
|
||||||
define('UI_REGEX_URL', '/^(ht|f)tps?:\/\/[^ ]+$/');
|
define('UI_REGEX_URL', '/^(ht|f)tps?:\/\/[^ ]+$/');
|
||||||
define('UI_SCRATCHPAD_KEY', 'djBagContents');
|
define('UI_SCRATCHPAD_KEY', 'djBagContents');
|
||||||
define('UI_SCRATCHPAD_REGEX', '/^([0-9a-f]{16}:[0-9]{4}-[0-9]{2}-[0-9]{2}( )?)+$/');
|
#define('UI_SCRATCHPAD_REGEX', '/^[0-9a-f]{16}:[0-9]{4}-[0-9]{2}-[0-9]{2}$/');
|
||||||
?>
|
?>
|
|
@ -1,10 +1,10 @@
|
||||||
<div id="menu_top">
|
<div id="menu_top">
|
||||||
<a href="{$UI_BROWSER}" class="button">[Home directory]</a>
|
<a href="{$UI_BROWSER}" class="button">[Home directory]</a>
|
||||||
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=newfile" class="button">[UploadM]</a>
|
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=newfile" class="button">[UploadM]</a>
|
||||||
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=upload_1" class="button">[Upload]</a>
|
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=uploadFile" class="button">[Upload]</a>
|
||||||
<a href="javascript:newFolder()" class="button">[Create new folder]</a>
|
<a href="javascript:newFolder()" class="button">[Create new folder]</a>
|
||||||
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=search" class="button">[Search]</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]' 1=x}</a>
|
<a href="{$UI_BROWSER}?id={$GLOBALS.id}&act=subjects" class="button">{tra 0='[Subjects]'}</a>
|
||||||
<!-- <br>
|
<!-- <br>
|
||||||
<a href="{$UI_BROWSER}?act=MetaDataValues&Main=1" class="button">[Metadata]</a> -->
|
<a href="{$UI_BROWSER}?act=MetaDataValues&Main=1" class="button">[Metadata]</a> -->
|
||||||
<a href="{$UI_BROWSER}?act=systemPrefs" class="button">[SystemPrefs]</a>
|
<a href="{$UI_BROWSER}?act=systemPrefs" class="button">[SystemPrefs]</a>
|
||||||
|
|
|
@ -13,41 +13,38 @@
|
||||||
{foreach from=$structure.listdata item=o}
|
{foreach from=$structure.listdata item=o}
|
||||||
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
|
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
|
||||||
<td>
|
<td>
|
||||||
{if $structure.tree}
|
<span id="ID{$o.id}">
|
||||||
{str_repeat str=' ' count=$o.level}<span id="ID{$o.id}">
|
{if $structure.tree}
|
||||||
{else}
|
{str_repeat str=' ' count=$o.level}
|
||||||
{str_repeat str=' ' count=3} <span id="ID{$o.id}">
|
{else}
|
||||||
{/if}
|
{str_repeat str=' ' count=3}
|
||||||
<a {if $o.type eq 'Folder'}href="{$UI_BROWSER}?id={$o.id}" {/if}>[{$o.title}]</a>:
|
{/if}
|
||||||
</span>
|
<a {if $o.type eq 'Folder'}href="{$UI_BROWSER}?id={$o.id}" {/if}>[{$o.title}]</a>:
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
{$a.$o.type}
|
{$a.$o.type}
|
||||||
<a href="javascript:frename('{$o.name}', '{$o.id}')" class="button">[rename]</a>
|
<a href="javascript:frename('{$o.name}', '{$o.id}')">[rename]</a>
|
||||||
<a href="javascript:fmove('{$o.id}', '.')" class="button">[move]</a>
|
<a href="javascript:fmove('{$o.id}', '.')">[move]</a>
|
||||||
<a href="javascript:fcopy('{$o.id}', '.')" class="button">[copy]</a>
|
<a href="javascript:fcopy('{$o.id}', '.')">[copy]</a>
|
||||||
{*
|
<a href="{$UI_BROWSER}?act=permissions&id={$o.id}">[permissions]</a>
|
||||||
<a href="javascript:freplicate('<?php echo$o['name']?>', '{$o.id}')" class="button">[replicate]</a>
|
|
||||||
*}
|
|
||||||
<a href="{$UI_BROWSER}?act=permissions&id={$o.id}" class="button">[permissions]</a>
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
{if ($delOverride eq $o.id)}
|
{if ($delOverride eq $o.id)}
|
||||||
<a href="{$UI_HANDLER}?act=delete&id={$o.id}&delOverride={$o.id}" class="button"
|
<a href="{$UI_HANDLER}?act=delete&id={$o.id}&delOverride={$o.id}"
|
||||||
onClick="return confirm('Really delete non empty object "{$o.name}" now?')">[DEL]</a>
|
onClick="return confirm('Really delete non empty object "{$o.name}" now?')">[DEL]</a>
|
||||||
{else}
|
{else}
|
||||||
<a href="{$UI_HANDLER}?act=delete&id={$o.id}" class="button"
|
<a href="{$UI_HANDLER}?act=delete&id={$o.id}"
|
||||||
onClick="return confirm('Delete object "{$o.name}"?')">[DEL]</a>
|
onClick="return confirm('Delete object "{$o.name}"?')">[DEL]</a>
|
||||||
{/if}
|
{/if}
|
||||||
{if $o.type != 'Folder'}
|
{if $o.type != 'Folder'}
|
||||||
<a href="{$UI_BROWSER}?act=getFile&id={$o.id}" class="button">[Access]</a>
|
<a href="{$UI_BROWSER}?act=getFile&id={$o.id}">[Access]</a>
|
||||||
<a href="{$UI_BROWSER}?act=getInfo&id={$o.id}" class="button">[Analyze]</a>
|
<a href="{$UI_BROWSER}?act=getMData&id={$o.id}">[vMData]</a>
|
||||||
<a href="{$UI_BROWSER}?act=editMetaDataValues&id={$o.id}" class="button">[MData]</a>
|
<a href="{$UI_BROWSER}?act=getInfo&id={$o.id}">[Analyze]</a>
|
||||||
<a href="#" onclick="popup('{$UI_HANDLER}?act=add2SP&id={$o.id}', '2SP', 1, 1)" class="button">[SP]</a>
|
<a href="{$UI_BROWSER}?act=editFile&id={$o.id}">[Edit]</a>
|
||||||
{/if}
|
<a href="{$UI_BROWSER}?act=editMetaDataValues&id={$o.id}">[eMData]</a>
|
||||||
{if $o.type eq 'Replica'}
|
<a href="#" onclick="hpopup('{$UI_HANDLER}?act=add2SP&id={$o.id}', '2SP')">[SP]</a>
|
||||||
(->$o.target})
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<td>{$i.title}</td>
|
<td>{$i.title}</td>
|
||||||
<td>{$i.duration}</td>
|
<td>{$i.duration}</td>
|
||||||
<td>{$i.type} </td>
|
<td>{$i.type} </td>
|
||||||
<th><a href="#" onclick="popup('{$UI_HANDLER}?act=remFromSP&id={$i.id}', 'remFromSP', 1, 1)">X</th>
|
<th><a href="#" onclick="hpopup('{$UI_HANDLER}?act=remFromSP&id={$i.id}', 'remFromSP')">X</th>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tr><td></td><td colspan="2">[Edit]</td><td colspan="2">[Delete]</td></tr>
|
<tr><td></td><td colspan="2">[Edit]</td><td colspan="2">[Delete]</td></tr>
|
||||||
|
|
|
@ -29,21 +29,27 @@
|
||||||
{literal}}{/literal}
|
{literal}}{/literal}
|
||||||
|
|
||||||
{literal}
|
{literal}
|
||||||
function popup(url, name, width, height)
|
function popup(url, name, width, height) // popup in center of perent window
|
||||||
{
|
{
|
||||||
var screenX;
|
var screenX;
|
||||||
var screenY;
|
var screenY;
|
||||||
|
|
||||||
screenX = (window.screenX + window.innerWidth/2 - width/2);
|
screenX = (window.screenX + window.innerWidth/2 - width/2);
|
||||||
screenY = (window.screenY + window.innerHeight/2 - height/2);
|
screenY = (window.screenY + window.innerHeight/2 - height/2);
|
||||||
arg = 'width='+width+', height='+height+', scrollbars=no, menubar=no, depend=yes, screenX='+screenX+', screenY='+screenY;
|
arg = 'width='+width+', height='+height+', scrollbars=no, menubar=no, depend=yes, left='+screenX+', top='+screenY;
|
||||||
|
|
||||||
popupwin = window.open(url, name, arg);
|
popupwin = window.open(url, name, arg);
|
||||||
window.popupwin.focus();
|
window.popupwin.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hpopup(url, name) //hidden popup!
|
||||||
|
{
|
||||||
|
popupwin = window.open(url, name, 'width=1, height=1, scrollbars=no, menubar=no, depend=yes');
|
||||||
|
window.parent.focus();
|
||||||
|
}
|
||||||
{/literal}
|
{/literal}
|
||||||
|
|
||||||
{uiBrowser->alertMsg assign='alertMsg'}
|
{uiBrowser->getAlertMsg assign='alertMsg'}
|
||||||
{if $alertMsg}
|
{if $alertMsg}
|
||||||
alert('{$alertMsg}');
|
alert('{$alertMsg}');
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<td>{$s.duration}</td>
|
<td>{$s.duration}</td>
|
||||||
<td><a href="{$UI_BROWSER}?act=getMdata&id={$s.id}">[XML]</a>
|
<td><a href="{$UI_BROWSER}?act=getMdata&id={$s.id}">[XML]</a>
|
||||||
<a href="{$UI_BROWSER}?act=editMetaDataValues&id={$s.id}">[Form]</a>
|
<a href="{$UI_BROWSER}?act=editMetaDataValues&id={$s.id}">[Form]</a>
|
||||||
<a href="#" onClick="popup('{$UI_HANDLER}?act=add2SP&id={$s.id}', '2SP', 1, 1)">[SP]</a>
|
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=add2SP&id={$s.id}', '2SP')">[SP]</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -58,7 +58,7 @@ if ($uiBrowser->userid) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "permissions":
|
case "permissions":
|
||||||
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id, $_REQUEST['act']=='getHomeDir' ? TRUE : FALSE));
|
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
||||||
$Smarty->assign('showPath', TRUE);
|
$Smarty->assign('showPath', TRUE);
|
||||||
|
|
||||||
$Smarty->assign('perms', $uiBrowser->getPermissions($uiBrowser->id));
|
$Smarty->assign('perms', $uiBrowser->getPermissions($uiBrowser->id));
|
||||||
|
@ -67,29 +67,31 @@ if ($uiBrowser->userid) {
|
||||||
|
|
||||||
|
|
||||||
case "newfile":
|
case "newfile":
|
||||||
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id, $_REQUEST['act']=='getHomeDir' ? TRUE : FALSE));
|
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
||||||
$Smarty->assign('showPath', TRUE);
|
$Smarty->assign('showPath', TRUE);
|
||||||
|
|
||||||
$Smarty->assign('newfileform', $uiBrowser->getNewFileForm($uiBrowser->id, $ui_fmask['upload']));
|
$Smarty->assign('newfileform', $uiBrowser->getNewFileForm($uiBrowser->id, $ui_fmask['upload']));
|
||||||
$Smarty->assign('showNewFileForm', TRUE);
|
$Smarty->assign('showNewFileForm', TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case "upload_1":
|
case "uploadFile":
|
||||||
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id, $_REQUEST['act']=='getHomeDir' ? TRUE : FALSE));
|
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
||||||
|
$Smarty->assign('showPath', FALSE);
|
||||||
|
|
||||||
|
$Smarty->assign('uploadform', $uiBrowser->getUploadFileForm($uiBrowser->id, $ui_fmask['uploadFile']));
|
||||||
|
$Smarty->assign('showUploadForm', TRUE);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case "editFile":
|
||||||
|
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
||||||
$Smarty->assign('showPath', FALSE);
|
$Smarty->assign('showPath', FALSE);
|
||||||
|
|
||||||
$Smarty->assign('uploadform', $uiBrowser->getUploadFileForm($uiBrowser->id, $ui_fmask['upload_1']));
|
$Smarty->assign('uploadform', $uiBrowser->getUploadFileForm($uiBrowser->id, $ui_fmask['upload_1']));
|
||||||
$Smarty->assign('showUploadForm', TRUE);
|
$Smarty->assign('showUploadForm', TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "upload_2":
|
|
||||||
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id, $_REQUEST['act']=='getHomeDir' ? TRUE : FALSE));
|
|
||||||
$Smarty->assign('showPath', FALSE);
|
|
||||||
|
|
||||||
$Smarty->assign('mDataForm', $uiBrowser->getMetaDataForm($uiBrowser->id, $ui_fmask['mData'], FALSE, $uiBrowser->getInfo($id, 'array')));
|
|
||||||
$Smarty->assign('showMetaDataForm', TRUE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "search":
|
case "search":
|
||||||
if($_REQUEST['doSearch']) {
|
if($_REQUEST['doSearch']) {
|
||||||
|
@ -130,7 +132,7 @@ if ($uiBrowser->userid) {
|
||||||
$Smarty->assign('showFile', TRUE);
|
$Smarty->assign('showFile', TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "getMdata":
|
case "getMData":
|
||||||
$Smarty->assign('fMetaData', $uiBrowser->getMdata($uiBrowser->id));
|
$Smarty->assign('fMetaData', $uiBrowser->getMdata($uiBrowser->id));
|
||||||
$Smarty->assign('showFile', TRUE);
|
$Smarty->assign('showFile', TRUE);
|
||||||
break;
|
break;
|
||||||
|
@ -141,7 +143,7 @@ if ($uiBrowser->userid) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "getInfo":
|
case "getInfo":
|
||||||
$Smarty->assign('fInfo', $uiBrowser->getInfo($uiBrowser->id, 'text'));
|
$Smarty->assign('fInfo', $uiBrowser->_getInfo($uiBrowser->id, 'text'));
|
||||||
$Smarty->assign('showFile', TRUE);
|
$Smarty->assign('showFile', TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -15,16 +15,12 @@ switch($_REQUEST['act']){
|
||||||
$uiHandler->logout(TRUE);
|
$uiHandler->logout(TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "upload": ## media- and metadata file together
|
case "upload": ## media- and metadata file together #####
|
||||||
$uiHandler->upload(array_merge($_REQUEST, $_FILES), $uiHandler->id, $ui_fmask["upload"]);
|
$uiHandler->upload(array_merge($_REQUEST, $_FILES), $uiHandler->id, $ui_fmask["upload"]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "upload_1": ## first upload
|
case "uploadFile": ## just media file #######################
|
||||||
$uiHandler->upload_1(array_merge($_REQUEST, $_FILES), $uiHandler->id, $ui_fmask["upload_1"]);
|
$uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $uiHandler->id, $ui_fmask["uploadFile"]);
|
||||||
break;
|
|
||||||
|
|
||||||
case "upload_2": ## then edit metadata
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "newFolder":
|
case "newFolder":
|
||||||
|
|
|
@ -28,12 +28,12 @@ class uiBase
|
||||||
*/
|
*/
|
||||||
function uiBase(&$config)
|
function uiBase(&$config)
|
||||||
{
|
{
|
||||||
$dbc = DB::connect($config['dsn'], TRUE);
|
$this->dbc = DB::connect($config['dsn'], TRUE);
|
||||||
if (DB::isError($dbc)) {
|
if (DB::isError($this->dbc)) {
|
||||||
die($dbc->getMessage());
|
die($this->dbc->getMessage());
|
||||||
}
|
}
|
||||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
$this->dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
$this->gb =& new GreenBox(&$dbc, $config);
|
$this->gb =& new GreenBox(&$this->dbc, $config);
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->sessid = $_REQUEST[$config['authCookieName']];
|
$this->sessid = $_REQUEST[$config['authCookieName']];
|
||||||
$this->userid = $this->gb->getSessUserId($this->sessid);
|
$this->userid = $this->gb->getSessUserId($this->sessid);
|
||||||
|
@ -211,7 +211,7 @@ class uiBase
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
>
|
>
|
||||||
<dc:title>'.$this->_getFileTitle($id).'</dc:title>
|
<dc:title>'.$this->_getFileTitle($id).'</dc:title>
|
||||||
<dc:format.extent>'.$ia['playtime_string'].'</dc:format.extent>
|
<dcterms:extent>'.$ia['playtime_string'].'</dcterms:extent>
|
||||||
</metadata>
|
</metadata>
|
||||||
</audioClip>';
|
</audioClip>';
|
||||||
|
|
||||||
|
@ -250,20 +250,50 @@ class uiBase
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _toHex($gunid)
|
||||||
|
{
|
||||||
|
$res = $this->dbc->query("SELECT to_hex($gunid)");
|
||||||
|
$row = $res->fetchRow();
|
||||||
|
|
||||||
|
return $row['to_hex'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _toInt8($gunid)
|
||||||
|
{
|
||||||
|
$res = $this->dbc->query("SELECT x'$gunid'::bigint");
|
||||||
|
$row = $res->fetchRow();
|
||||||
|
|
||||||
|
return $row['int8'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getSP()
|
function getSP()
|
||||||
{
|
{
|
||||||
$spData = $this->gb->loadPref($this->sessid, UI_SCRATCHPAD_KEY);
|
$spData = $this->gb->loadPref($this->sessid, UI_SCRATCHPAD_KEY);
|
||||||
if (!PEAR::isError($spData) && trim($spData) != '') {
|
if (!PEAR::isError($spData) && trim($spData) != '') {
|
||||||
$arr = explode(' ', $spData);
|
$arr = explode(' ', $spData);
|
||||||
|
/*
|
||||||
|
## Akos old format #####################################
|
||||||
foreach($arr as $val) {
|
foreach($arr as $val) {
|
||||||
$pieces = explode(':', $val);
|
|
||||||
|
|
||||||
if (preg_match(UI_SCRATCHPAD_REGEX, $val)) {
|
if (preg_match(UI_SCRATCHPAD_REGEX, $val)) {
|
||||||
$res[] = array_merge($this->_getMetaInfo($this->gb->_idFromGunid($pieces[0])),
|
list ($gunid, $date) = explode(':', $val);
|
||||||
array('added' => $pieces[1])
|
if ($this->gb->_idFromGunid($gunid) != FALSE) {
|
||||||
);
|
$res[] = array_merge($this->_getMetaInfo($this->gb->_idFromGunid($gunid)), array('added' => $date));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
## new format ##########################################
|
||||||
|
foreach($arr as $gunid) {
|
||||||
|
if (preg_match('/[0-9]{1,20}/', $gunid)) {
|
||||||
|
if ($this->gb->_idFromGunid($this->_toHex($gunid)) != FALSE) {
|
||||||
|
$res[] = $this->_getMetaInfo($this->gb->_idFromGunid($this->_toHex($gunid)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return ($res);
|
return ($res);
|
||||||
} else {
|
} else {
|
||||||
|
@ -275,11 +305,12 @@ class uiBase
|
||||||
{
|
{
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
foreach($data as $val) {
|
foreach($data as $val) {
|
||||||
$str .= $val['gunid'].':'.$val['added'].' ';
|
#$str .= $val['gunid'].':'.$val['added'].' '; ## new format ###
|
||||||
|
$str .= $this->_toInt8($val['gunid']).' '; ## Akos´ old format ###
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->gb->savePref($this->sessid, UI_SCRATCHPAD_KEY, trim($str));
|
$this->gb->savePref($this->sessid, UI_SCRATCHPAD_KEY, $str);
|
||||||
}
|
}
|
||||||
|
|
||||||
function add2SP($id)
|
function add2SP($id)
|
||||||
|
@ -288,27 +319,26 @@ class uiBase
|
||||||
$this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
$this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||||
|
|
||||||
if ($sp = $this->getSP()) {
|
if ($sp = $this->getSP()) {
|
||||||
foreach ($sp as $val) {
|
foreach ($sp as $key => $val) {
|
||||||
if ($val['gunid'] == $info['gunid']) {
|
if ($val['gunid'] == $info['gunid']) {
|
||||||
$exists = TRUE;
|
unset($sp[$key]);
|
||||||
|
$this->_retMsg('Entry $1 was already on $2.\nMoved to Top.', $info['title'], $val['added']);
|
||||||
|
} else {
|
||||||
|
#$this->incAccessCounter($id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$exists) {
|
|
||||||
$sp = array_merge(array(array('gunid' => $info['gunid'],
|
$sp = array_merge(array(array('gunid' => $info['gunid'],
|
||||||
'added' => date('Y-m-d')
|
'added' => date('Y-m-d')
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
is_array($sp) ? $sp : NULL);
|
is_array($sp) ? $sp : NULL);
|
||||||
#print_r($sp);
|
|
||||||
$this->_saveSP($sp);
|
$this->_saveSP($sp);
|
||||||
#$this->_retmsg('Entry $1 added', $gunid);
|
#$this->_retmsg('Entry $1 added', $info['title']);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
|
||||||
$this->_retmsg('Entry $1 already exists', $info['title']);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -339,12 +369,13 @@ class uiBase
|
||||||
|
|
||||||
function _getMetaInfo($id)
|
function _getMetaInfo($id)
|
||||||
{
|
{
|
||||||
$data['id'] = $id;
|
$data = array('id' => $id,
|
||||||
$data['gunid'] = $this->gb->_gunidFromId($id);
|
'gunid' => $this->gb->_gunidFromId($id),
|
||||||
$data['title'] = $this->_getMDataValue($id, 'Title');
|
'title' => $this->_getMDataValue($id, 'title'),
|
||||||
$data['artist'] = $this->_getMDataValue($id, 'Artist');
|
'artist' => $this->_getMDataValue($id, 'artist'),
|
||||||
$data['duration'] = substr($this->_getMDataValue($id, 'format.extent'), 0 ,8);
|
'duration' => substr($this->_getMDataValue($id, 'format.extent'), 0 ,8),
|
||||||
$data['type'] = $this->gb->existsPlaylist($this->sessid, $this->gb->_idFromgunid($id)) ? $this->tra('playlist') : $this->tra('file');
|
'type' => $this->_getType($id),
|
||||||
|
);
|
||||||
|
|
||||||
return ($data);
|
return ($data);
|
||||||
}
|
}
|
||||||
|
@ -362,5 +393,15 @@ class uiBase
|
||||||
$file = array_pop($this->gb->getPath($id));
|
$file = array_pop($this->gb->getPath($id));
|
||||||
return $file['name'];
|
return $file['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _getType($id)
|
||||||
|
{
|
||||||
|
if ($this->gb->existsPlaylist($this->sessid, $this->gb->_gunidFromId($id))) return 'playlist';
|
||||||
|
return 'file';
|
||||||
|
#if ($this->gb->existsAudioClip($this->sessid, $this->gb->_gunidFromId($id))) return 'audioclip';
|
||||||
|
#if ($this->gb->existsFile($this->sessid, $this->gb->_gunidFromId($id))) return 'File';
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -16,20 +16,45 @@ class uiBrowser extends uiBase {
|
||||||
$this->uiBase($config);
|
$this->uiBase($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* login
|
||||||
|
*
|
||||||
|
* Perform a frontend action
|
||||||
|
* map to a function called action_<actionName>.inc.php
|
||||||
|
*
|
||||||
|
* @param actionName string, name of a action
|
||||||
|
* @param params array[], request vars
|
||||||
|
*/
|
||||||
|
function performAction( $actionName, $params )
|
||||||
|
{
|
||||||
|
$actionFunctionName = 'action_' . $actionName ;
|
||||||
|
$actionFunctionFileName = ACTION_BASE . '/action_' . $actionName . '.inc.php' ;
|
||||||
|
if ( file_exists( $actionFunctionFileName ) )
|
||||||
|
{
|
||||||
|
include ( $actionFunctionFileName ) ;
|
||||||
|
if ( method_exists( $actionFunctionName ) )
|
||||||
|
{
|
||||||
|
$actionFunctionName( &$this, $params ) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// --- error handling ---
|
// --- error handling ---
|
||||||
/**
|
/**
|
||||||
* alertMsg
|
* getAlertMsg
|
||||||
*
|
*
|
||||||
* takes error message from session var
|
* extractes error message from session var
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function alertMsg()
|
|
||||||
|
function getAlertMsg()
|
||||||
{
|
{
|
||||||
if ($_SESSION['alertMsg']) {
|
if ($_SESSION['alertMsg']) {
|
||||||
$this->alertMsg = $_SESSION['alertMsg'];
|
$this->alertMsg = $_SESSION['alertMsg'];
|
||||||
unset($_SESSION['alertMsg']);
|
unset($_SESSION['alertMsg']);
|
||||||
|
|
||||||
return $this->alertMsg;
|
return $this->alertMsg;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -30,7 +30,7 @@ $uiBase = new uiBase($config);
|
||||||
|
|
||||||
## load Smarty+filters ##############################################
|
## load Smarty+filters ##############################################
|
||||||
require_once dirname(__FILE__).'/SmartyExtensions.inc.php';
|
require_once dirname(__FILE__).'/SmartyExtensions.inc.php';
|
||||||
#$Smarty->load_filter('output', 'trimwhitespace');
|
$Smarty->load_filter('output', 'trimwhitespace');
|
||||||
$Smarty->load_filter('post', 'template_marker');
|
$Smarty->load_filter('post', 'template_marker');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ $ui_fmask = array(
|
||||||
'pages' => array(
|
'pages' => array(
|
||||||
'Main' => array(
|
'Main' => array(
|
||||||
array(
|
array(
|
||||||
'element' => 'Title',
|
'element' => 'dc:title',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Title',
|
'label' => 'Title',
|
||||||
'required' => TRUE
|
'required' => TRUE
|
||||||
|
@ -174,31 +174,31 @@ $ui_fmask = array(
|
||||||
'element' => 'Creator',
|
'element' => 'Creator',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Creator',
|
'label' => 'Creator',
|
||||||
'required' => TRUE
|
#'required' => TRUE,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Type_Genre',
|
'element' => 'Type_Genre',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Type_Genre',
|
'label' => 'Type_Genre',
|
||||||
'required' => TRUE,
|
#'required' => TRUE,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Format',
|
'element' => 'dc:format',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Format',
|
'label' => 'Format',
|
||||||
'required' => TRUE,
|
#'required' => TRUE,
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'' => '',
|
'' => '',
|
||||||
|
'audio/mpeg' => 'audio/mpeg',
|
||||||
'File' => 'File',
|
'File' => 'File',
|
||||||
'live stream' => 'Live Stream',
|
'live stream' => 'Live Stream',
|
||||||
'networked file'=> 'Networked File',
|
'networked file'=> 'Networked File',
|
||||||
'audio/mpeg' => 'audio/mpeg'
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Format_Extent',
|
'element' => 'dcterms:extent',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Format_Extent',
|
'label' => 'Extent',
|
||||||
#'attributes'=> array('readonly' => 'on')
|
#'attributes'=> array('readonly' => 'on')
|
||||||
),
|
),
|
||||||
/*
|
/*
|
||||||
|
@ -233,12 +233,12 @@ $ui_fmask = array(
|
||||||
),
|
),
|
||||||
'Music_Basic' => array(
|
'Music_Basic' => array(
|
||||||
array(
|
array(
|
||||||
'element' => 'Title',
|
'element' => 'dc:title',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Title',
|
'label' => 'Title',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Creator',
|
'element' => 'dc:creator',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Creator',
|
'label' => 'Creator',
|
||||||
),
|
),
|
||||||
|
@ -247,6 +247,7 @@ $ui_fmask = array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Source_Album',
|
'label' => 'Source_Album',
|
||||||
),
|
),
|
||||||
|
/*
|
||||||
array(
|
array(
|
||||||
'element' => 'Source_Year',
|
'element' => 'Source_Year',
|
||||||
'type' => 'date',
|
'type' => 'date',
|
||||||
|
@ -258,25 +259,27 @@ $ui_fmask = array(
|
||||||
'minYear' => 1900
|
'minYear' => 1900
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
*/
|
||||||
array(
|
array(
|
||||||
'element' => 'Type_Genre',
|
'element' => 'Type_Genre',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Type_Genre',
|
'label' => 'Type_Genre',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Description',
|
'element' => 'dc:description',
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
'label' => 'Description',
|
'label' => 'Description',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Format',
|
'element' => 'dc:format',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Format',
|
'label' => 'Format',
|
||||||
'options' => array(
|
'options' => array(
|
||||||
|
'' => '',
|
||||||
|
'audio/mpeg' => 'audio/mpeg',
|
||||||
'File' => 'File',
|
'File' => 'File',
|
||||||
'live stream' => 'Live Stream',
|
'live stream' => 'Live Stream',
|
||||||
'networked file'=> 'Networked File',
|
'networked file'=> 'Networked File'
|
||||||
'audio/mpeg' => 'audio/mpeg'
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
@ -292,9 +295,9 @@ $ui_fmask = array(
|
||||||
'rule' => 'numeric',
|
'rule' => 'numeric',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Format_Extent',
|
'element' => 'dcterms:extent',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Format_Extent',
|
'label' => 'Extent',
|
||||||
'attributes'=> array('readonly' => 'on')
|
'attributes'=> array('readonly' => 'on')
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -342,6 +345,7 @@ $ui_fmask = array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Format_Medium_Channels',
|
'label' => 'Format_Medium_Channels',
|
||||||
'options' => array(
|
'options' => array(
|
||||||
|
'' => '',
|
||||||
'mono' => 'Mono',
|
'mono' => 'Mono',
|
||||||
'stereo' => 'Stereo',
|
'stereo' => 'Stereo',
|
||||||
'5.1' => '5.1'
|
'5.1' => '5.1'
|
||||||
|
@ -444,7 +448,7 @@ $ui_fmask = array(
|
||||||
),
|
),
|
||||||
'Talk_Basic' => array(
|
'Talk_Basic' => array(
|
||||||
array(
|
array(
|
||||||
'element' => 'Title',
|
'element' => 'dc:title',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'Title',
|
'label' => 'Title',
|
||||||
'relation' => 1
|
'relation' => 1
|
||||||
|
@ -455,7 +459,7 @@ $ui_fmask = array(
|
||||||
'label' => 'Coverage',
|
'label' => 'Coverage',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Description',
|
'element' => 'dc:description',
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
'label' => 'Description',
|
'label' => 'Description',
|
||||||
),
|
),
|
||||||
|
@ -475,14 +479,15 @@ $ui_fmask = array(
|
||||||
'label' => 'Type_Genre',
|
'label' => 'Type_Genre',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'Format',
|
'element' => 'dc:format',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Format',
|
'label' => 'Format',
|
||||||
'options' => array(
|
'options' => array(
|
||||||
|
'' => '',
|
||||||
|
'audio/mpeg' => 'audio/mpeg',
|
||||||
'File' => 'File',
|
'File' => 'File',
|
||||||
'live stream' => 'Live Stream',
|
'live stream' => 'Live Stream',
|
||||||
'networked file'=> 'Networked File',
|
'networked file'=> 'Networked File',
|
||||||
'audio/mpeg' => 'audio/mpeg'
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -663,11 +668,11 @@ $ui_fmask = array(
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
'upload_1' => array(
|
'uploadFile' => array(
|
||||||
array(
|
array(
|
||||||
'element' => 'act',
|
'element' => 'act',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'constant' => 'upload_1'
|
'constant' => 'uploadFile'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'id',
|
'element' => 'id',
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define('ACTION_BASE', '/actions' ) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uiHandler class
|
* uiHandler class
|
||||||
*
|
*
|
||||||
|
@ -22,6 +25,9 @@ class uiHandler extends uiBase {
|
||||||
$this->uiBase($config);
|
$this->uiBase($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --- authentication ---
|
// --- authentication ---
|
||||||
/**
|
/**
|
||||||
* login
|
* login
|
||||||
|
@ -42,7 +48,7 @@ class uiHandler extends uiBase {
|
||||||
$fid = $this->gb->getObjId($formdata['login'], $this->gb->storId);
|
$fid = $this->gb->getObjId($formdata['login'], $this->gb->storId);
|
||||||
if(!PEAR::isError($fid)) $this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
if(!PEAR::isError($fid)) $this->redirUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||||
}else{
|
}else{
|
||||||
$this->alertMsg = 'Login failed.';
|
$this->_retMsg('Login failed.');
|
||||||
$_SESSION['retransferFormData']['login']=$formdata['login'];
|
$_SESSION['retransferFormData']['login']=$formdata['login'];
|
||||||
$this->redirUrl = UI_BROWSER.'?popup[]=login';
|
$this->redirUrl = UI_BROWSER.'?popup[]=login';
|
||||||
}
|
}
|
||||||
|
@ -97,7 +103,7 @@ class uiHandler extends uiBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, $mdtmp, $this->sessid);
|
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, $mdtmp, $this->sessid);
|
||||||
if(PEAR::isError($r)) $this->alertMsg = $r->getMessage();
|
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
|
||||||
else{
|
else{
|
||||||
# $gb->updateMetadataDB($gb->_pathFromId($r), $mdata, $sessid);
|
# $gb->updateMetadataDB($gb->_pathFromId($r), $mdata, $sessid);
|
||||||
@unlink($ntmp);
|
@unlink($ntmp);
|
||||||
|
@ -114,14 +120,14 @@ class uiHandler extends uiBase {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* upload_1
|
* uploadS1
|
||||||
*
|
*
|
||||||
* Provides file upload and store it to the storage
|
* Provides file upload and store it to the storage
|
||||||
*
|
*
|
||||||
* @param formdata array, submitted text and file
|
* @param formdata array, submitted text and file
|
||||||
* @param id int, destination folder id
|
* @param id int, destination folder id
|
||||||
*/
|
*/
|
||||||
function upload_1(&$formdata, $id, &$mask)
|
function uploadFile(&$formdata, $id, &$mask)
|
||||||
{
|
{
|
||||||
if ($this->_validateForm($formdata, $mask)) {
|
if ($this->_validateForm($formdata, $mask)) {
|
||||||
$tmpgunid = md5(
|
$tmpgunid = md5(
|
||||||
|
@ -134,7 +140,7 @@ class uiHandler extends uiBase {
|
||||||
chmod($ntmp, 0664);
|
chmod($ntmp, 0664);
|
||||||
|
|
||||||
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, NULL, $this->sessid);
|
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, NULL, $this->sessid);
|
||||||
if(PEAR::isError($r)) $this->alertMsg = $r->getMessage();
|
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
|
||||||
else{
|
else{
|
||||||
# $gb->updateMetadataDB($gb->_pathFromId($r), $mdata, $sessid);
|
# $gb->updateMetadataDB($gb->_pathFromId($r), $mdata, $sessid);
|
||||||
@unlink($ntmp);
|
@unlink($ntmp);
|
||||||
|
@ -147,7 +153,7 @@ class uiHandler extends uiBase {
|
||||||
$this->redirUrl = UI_BROWSER."?act=editMetaDataValues&id=$r";
|
$this->redirUrl = UI_BROWSER."?act=editMetaDataValues&id=$r";
|
||||||
return $r;
|
return $r;
|
||||||
} else {
|
} else {
|
||||||
$this->redirUrl = UI_BROWSER."?act=upload_1&id=$id";
|
$this->redirUrl = UI_BROWSER."?act=uploadFile&id=$id";
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,7 +169,7 @@ class uiHandler extends uiBase {
|
||||||
function newFolder($newname, $id)
|
function newFolder($newname, $id)
|
||||||
{
|
{
|
||||||
$r = $this->gb->createFolder($id, $newname, $this->sessid);
|
$r = $this->gb->createFolder($id, $newname, $this->sessid);
|
||||||
if(PEAR::isError($r)) $this->alertMsg = $r->getMessage();
|
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
|
||||||
$this->redirUrl = UI_BROWSER.'?id='.$id;
|
$this->redirUrl = UI_BROWSER.'?id='.$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +185,7 @@ class uiHandler extends uiBase {
|
||||||
{
|
{
|
||||||
$parid = $this->gb->getparent($this->id);
|
$parid = $this->gb->getparent($this->id);
|
||||||
$r = $this->gb->renameFile($id, $newname, $this->sessid);
|
$r = $this->gb->renameFile($id, $newname, $this->sessid);
|
||||||
if(PEAR::isError($r)) $this->alertMsg = $r->getMessage();
|
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
|
||||||
$this->redirUrl = UI_BROWSER."?id=$parid";
|
$this->redirUrl = UI_BROWSER."?id=$parid";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +205,7 @@ class uiHandler extends uiBase {
|
||||||
$parid = $this->gb->getparent($id);
|
$parid = $this->gb->getparent($id);
|
||||||
$r = $this->gb->moveFile($id, $did, $this->sessid);
|
$r = $this->gb->moveFile($id, $did, $this->sessid);
|
||||||
if(PEAR::isError($r)){
|
if(PEAR::isError($r)){
|
||||||
$this->alertMsg = $r->getMessage();
|
$this->_retMsg($r->getMessage());
|
||||||
$this->redirUrl = UI_BROWSER."?id=$parid";
|
$this->redirUrl = UI_BROWSER."?id=$parid";
|
||||||
}
|
}
|
||||||
else $this->redirUrl = UI_BROWSER."?id=$did";
|
else $this->redirUrl = UI_BROWSER."?id=$did";
|
||||||
|
@ -221,7 +227,7 @@ class uiHandler extends uiBase {
|
||||||
$parid = $this->gb->getparent($id);
|
$parid = $this->gb->getparent($id);
|
||||||
$r = $this->gb->copyFile($id, $did, $this->sessid);
|
$r = $this->gb->copyFile($id, $did, $this->sessid);
|
||||||
if(PEAR::isError($r)){
|
if(PEAR::isError($r)){
|
||||||
$this->alertMsg = $r->getMessage();
|
$this->_retMsg($r->getMessage());
|
||||||
$this->redirUrl = UI_BROWSER."?id=$parid";
|
$this->redirUrl = UI_BROWSER."?id=$parid";
|
||||||
}
|
}
|
||||||
else $this->redirUrl = UI_BROWSER."?id=$did";
|
else $this->redirUrl = UI_BROWSER."?id=$did";
|
||||||
|
@ -242,14 +248,14 @@ class uiHandler extends uiBase {
|
||||||
## add emtyness-test here ###
|
## add emtyness-test here ###
|
||||||
if (!($delOverride==$id) && (count($this->gb->getObjType($id)=='Folder'?
|
if (!($delOverride==$id) && (count($this->gb->getObjType($id)=='Folder'?
|
||||||
$this->gb->listFolder($id, $this->sessid):NULL))) {
|
$this->gb->listFolder($id, $this->sessid):NULL))) {
|
||||||
$this->alertMsg = $this->tra("Folder is not empty. You can override this protection by clicking DEL again");
|
$this->_retMsg("Folder is not empty. You can override this protection by clicking DEL again");
|
||||||
$this->redirUrl = UI_BROWSER."?id=$parid&delOverride=$id";
|
$this->redirUrl = UI_BROWSER."?id=$parid&delOverride=$id";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#############################
|
#############################
|
||||||
|
|
||||||
$r = $this->gb->deleteFile($id, $this->sessid);
|
$r = $this->gb->deleteFile($id, $this->sessid);
|
||||||
if(PEAR::isError($r)) $this->alertMsg = $r->getMessage();
|
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
|
||||||
$this->redirUrl = UI_BROWSER."?id=$parid";
|
$this->redirUrl = UI_BROWSER."?id=$parid";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +272,7 @@ class uiHandler extends uiBase {
|
||||||
function getFile($id)
|
function getFile($id)
|
||||||
{
|
{
|
||||||
$r = $this->gb->access($id, $this->sessid);
|
$r = $this->gb->access($id, $this->sessid);
|
||||||
if(PEAR::isError($r)) $this->alertMsg = $r->getMessage();
|
if(PEAR::isError($r)) $this->_retMsg($r->getMessage());
|
||||||
else echo $r;
|
else echo $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,13 +306,13 @@ class uiHandler extends uiBase {
|
||||||
if ($this->_validateForm($formdata, $mask)) {
|
if ($this->_validateForm($formdata, $mask)) {
|
||||||
if($this->gb->checkPerm($this->userid, 'subjects')){
|
if($this->gb->checkPerm($this->userid, 'subjects')){
|
||||||
$res = $this->gb->addSubj($formdata['login'], ($formdata['pass']=='' ? NULL:$formdata['pass'] ));
|
$res = $this->gb->addSubj($formdata['login'], ($formdata['pass']=='' ? NULL:$formdata['pass'] ));
|
||||||
$this->alertMsg = $this->tra('Subject "'.$formdata['login'].'" added.');
|
$this->_retMsg('Subject $1 added.', $formdata['login']);
|
||||||
} else {
|
} else {
|
||||||
$this->alertMsg = $this->tra('Access denied.');
|
$this->_retMsg('Access denied.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(PEAR::isError($res)) $this->alertMsg = $res->getMessage();
|
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -323,10 +329,10 @@ class uiHandler extends uiBase {
|
||||||
if($this->gb->checkPerm($this->userid, 'subjects')){
|
if($this->gb->checkPerm($this->userid, 'subjects')){
|
||||||
$res = $this->gb->removeSubj($login);
|
$res = $this->gb->removeSubj($login);
|
||||||
}else{
|
}else{
|
||||||
$this->alertMsg='Access denied.';
|
$this->_retMsg('Access denied.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(PEAR::isError($res)) $this->alertMsg = $res->getMessage();
|
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -346,15 +352,15 @@ class uiHandler extends uiBase {
|
||||||
|
|
||||||
if($this->userid != $uid &&
|
if($this->userid != $uid &&
|
||||||
! $this->gb->checkPerm($this->userid, 'subjects')){
|
! $this->gb->checkPerm($this->userid, 'subjects')){
|
||||||
$this->alertMsg='Access denied..';
|
$this->_retMsg('Access denied.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(FALSE === $this->gb->authenticate($ulogin, $oldpass)){
|
if(FALSE === $this->gb->authenticate($ulogin, $oldpass)){
|
||||||
$this->alertMsg='Wrong old pasword.';
|
$this->_retMsg('Wrong old pasword.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if($pass !== $pass2){
|
if($pass !== $pass2){
|
||||||
$this->alertMsg = "Passwords do not match. ".
|
$this->_retMsg("Passwords do not match.").
|
||||||
"($pass/$pass2)";
|
"($pass/$pass2)";
|
||||||
$this->redirUrl = UI_BROWSER.'?act=subjects';
|
$this->redirUrl = UI_BROWSER.'?act=subjects';
|
||||||
return;
|
return;
|
||||||
|
@ -379,7 +385,7 @@ class uiHandler extends uiBase {
|
||||||
$this->gb->addPerm($subj, $permAction,
|
$this->gb->addPerm($subj, $permAction,
|
||||||
$id, $allowDeny);
|
$id, $allowDeny);
|
||||||
}else{
|
}else{
|
||||||
$this->alertMsg='Access denied.';
|
$this->_retMsg('Access denied.');
|
||||||
}
|
}
|
||||||
$this->redirUrl = UI_BROWSER.'?id='.$id.'&act=permissions';
|
$this->redirUrl = UI_BROWSER.'?id='.$id.'&act=permissions';
|
||||||
}
|
}
|
||||||
|
@ -396,7 +402,7 @@ class uiHandler extends uiBase {
|
||||||
{
|
{
|
||||||
if($this->gb->checkPerm($this->userid, 'editPerms', $oid))
|
if($this->gb->checkPerm($this->userid, 'editPerms', $oid))
|
||||||
$this->gb->removePerm($permid);
|
$this->gb->removePerm($permid);
|
||||||
else $this->alertMsg='Access denied.';
|
else $this->_retMsg('Access denied.');
|
||||||
$this->redirUrl = UI_BROWSER.'?act=permissions&id='.$oid;
|
$this->redirUrl = UI_BROWSER.'?act=permissions&id='.$oid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,10 +422,10 @@ class uiHandler extends uiBase {
|
||||||
if($this->gb->checkPerm($this->userid, 'subjects')){
|
if($this->gb->checkPerm($this->userid, 'subjects')){
|
||||||
$res = $this->gb->addSubj2Gr($login, $gname);
|
$res = $this->gb->addSubj2Gr($login, $gname);
|
||||||
}else{
|
}else{
|
||||||
$this->alertMsg='Access denied.';
|
$this->_retMsg('Access denied.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(PEAR::isError($res)) $this->alertMsg = $res->getMessage();
|
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
||||||
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=groups&id='.$reid;
|
$this->redirUrl = UI_BROWSER.'?act=groups&id='.$reid;
|
||||||
}
|
}
|
||||||
|
@ -436,10 +442,10 @@ class uiHandler extends uiBase {
|
||||||
if($this->gb->checkPerm($this->userid, 'subjects')){
|
if($this->gb->checkPerm($this->userid, 'subjects')){
|
||||||
$res = $this->gb->removeSubjFromGr($login, $gname);
|
$res = $this->gb->removeSubjFromGr($login, $gname);
|
||||||
}else{
|
}else{
|
||||||
$this->alertMsg='Access denied.';
|
$this->_retMsg('Access denied.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(PEAR::isError($res)) $this->alertMsg = $res->getMessage();
|
if(PEAR::isError($res)) $this->_retMsg($res->getMessage());
|
||||||
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=groups&id='.$reid;
|
$this->redirUrl = UI_BROWSER.'?act=groups&id='.$reid;
|
||||||
}
|
}
|
||||||
|
@ -457,10 +463,11 @@ class uiHandler extends uiBase {
|
||||||
$this->_dateArr2Str(&$mData);
|
$this->_dateArr2Str(&$mData);
|
||||||
|
|
||||||
foreach ($mData as $key=>$val) {
|
foreach ($mData as $key=>$val) {
|
||||||
|
#echo "id: {$formdata['id']}, key: $key, val: $val<br>";
|
||||||
$this->gb->setMDataValue($formdata['id'], $key, $this->sessid, $val);
|
$this->gb->setMDataValue($formdata['id'], $key, $this->sessid, $val);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->alertMsg = $this->tra('Metadata saved');
|
$this->_retMsg('Metadata saved');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -519,7 +526,7 @@ class uiHandler extends uiBase {
|
||||||
}
|
}
|
||||||
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
|
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
|
||||||
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
|
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
|
||||||
$this->alertMsg = $this->tra('Error uploading Logo');
|
$this->_retMsg('Error uploading Logo');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue