getDisplayPath() public static method

Generate the display path (the path with any root information stripped out).
public static getDisplayPath ( string $path ) : string
$path string The path to display.
return string The display path.
示例#1
0
文件: clipboard.php 项目: horde/horde
 *
 * @author   Michael Slusarz <*****@*****.**>
 * @category Horde
 * @license  http://www.horde.org/licenses/gpl GPL
 * @package  Gollem
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('gollem');
$vars = Horde_Variables::getDefaultVariables();
/* Set up the template object. */
$template = $injector->createInstance('Horde_View');
$template->cancelbutton = _("Cancel");
$template->clearbutton = _("Clear");
$template->pastebutton = _("Paste");
$template->cutgraphic = Horde::img('cut.png', _("Cut"));
$template->copygraphic = Horde::img('copy.png', _("Copy"));
$template->currdir = Gollem::getDisplayPath($vars->dir);
$template->dir = $vars->dir;
$template->manager_url = Horde::url('manager.php');
$entry = array();
foreach ($session->get('gollem', 'clipboard') as $key => $val) {
    $entry[] = array('copy' => $val['action'] == 'copy', 'cut' => $val['action'] == 'cut', 'id' => $key, 'name' => $val['display']);
}
$template->entries = $entry;
$page_output->addScriptFile('clipboard.js');
$page_output->addScriptFile('tables.js', 'horde');
$page_output->addInlineJsVars(array('GollemClipboard.selectall' => _("Select All"), 'GollemClipboard.selectnone' => _("Select None")));
$page_output->header(array('title' => _("Clipboard")));
$notification->notify(array('listeners' => 'status'));
echo $template->render('clipboard');
$page_output->footer();
示例#2
0
文件: manager.php 项目: horde/horde
                     Gollem::expireCache($old_dir);
                     $notification->push(sprintf(_("File received: %s"), $filename), 'horde.success');
                 } catch (Gollem_Exception $e) {
                     $notification->push($e, 'horde.error');
                 }
             }
         }
     }
     break;
 case 'copy_items':
 case 'cut_items':
     if ($edit_perms) {
         $action = $vars->actionID == 'copy_items' ? 'copy' : 'cut';
         if (is_array($vars->items) && count($vars->items)) {
             foreach ($vars->items as $item) {
                 $file = array('action' => $action, 'backend' => $backkey, 'display' => Gollem::getDisplayPath($old_dir . '/' . $item), 'name' => $item, 'path' => $old_dir);
                 $clipboard[] = $file;
                 $session->set('gollem', 'clipboard', $clipboard);
                 if ($action == 'copy') {
                     $notification->push(sprintf(_("Item copied to clipboard: %s"), $item), 'horde.success');
                 } else {
                     $notification->push(sprintf(_("Item cut to clipboard: %s"), $item), 'horde.success');
                 }
             }
         } elseif ($action == 'copy') {
             $notification->push(_("Cannot copy items onto clipboard."), 'horde.error');
         } else {
             $notification->push(_("Cannot cut items onto clipboard."), 'horde.error');
         }
     }
     break;