mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +00:00
add more commands
removefromclipboard removes an item from the clipboard view returns the html of some views
This commit is contained in:
parent
1936054ba2
commit
91dcc5cf1d
|
@ -168,14 +168,31 @@ switch($command) {
|
||||||
$session->addToClipboard($dms->getDocument($_GET['id']));
|
$session->addToClipboard($dms->getDocument($_GET['id']));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$view = UI::factory($theme, '', array('dms'=>$dms, 'user'=>$user));
|
|
||||||
if($view) {
|
|
||||||
$view->setParam('refferer', '');
|
|
||||||
$content = $view->menuClipboard($session->getClipboard());
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode($content);
|
echo json_encode(array('success'=>true));
|
||||||
} else {
|
} else {
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode(array('success'=>false, 'message'=>getMLText('error')));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break; /* }}} */
|
||||||
|
|
||||||
|
case 'removefromclipboard': /* {{{ */
|
||||||
|
if($user) {
|
||||||
|
if (isset($_GET["id"]) && is_numeric($_GET["id"]) && isset($_GET['type'])) {
|
||||||
|
switch($_GET['type']) {
|
||||||
|
case "folder":
|
||||||
|
$session->removeFromClipboard($dms->getFolder($_GET['id']));
|
||||||
|
break;
|
||||||
|
case "document":
|
||||||
|
$session->removeFromClipboard($dms->getDocument($_GET['id']));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode(array('success'=>true));
|
||||||
|
} else {
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode(array('success'=>false, 'message'=>getMLText('error')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break; /* }}} */
|
break; /* }}} */
|
||||||
|
@ -328,5 +345,26 @@ switch($command) {
|
||||||
}
|
}
|
||||||
break; /* }}} */
|
break; /* }}} */
|
||||||
|
|
||||||
|
case 'view': /* {{{ */
|
||||||
|
require_once("SeedDMS/Preview.php");
|
||||||
|
$view = UI::factory($theme, '', array('dms'=>$dms, 'user'=>$user));
|
||||||
|
if($view) {
|
||||||
|
$view->setParam('refferer', '');
|
||||||
|
$view->setParam('cachedir', $settings->_cacheDir);
|
||||||
|
}
|
||||||
|
$viewname = $_REQUEST["view"];
|
||||||
|
switch($viewname) {
|
||||||
|
case 'menuclipboard':
|
||||||
|
$content = $view->menuClipboard($session->getClipboard());
|
||||||
|
break;
|
||||||
|
case 'mainclipboard':
|
||||||
|
$content = $view->mainClipboard($session->getClipboard());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$content = '';
|
||||||
|
}
|
||||||
|
echo $content;
|
||||||
|
|
||||||
|
break; /* }}} */
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user