subdirectory() 공개 정적인 메소드

Generate correct subdirectory links.
public static subdirectory ( string $base, string $dir ) : string
$base string The base directory.
$dir string The directory string.
리턴 string The correct subdirectoy string.
예제 #1
0
         case '**dir':
             $url = $self_url->copy()->add(array('cacheid' => $cacheid, 'dir' => Gollem::subdirectory(Gollem::$backend['dir'], $val['name']), 'formid' => $vars->formid));
             $item['link'] = $url->link() . '<strong>' . $name . '</strong></a>';
             $item['dir'] = true;
             break;
         case '**sym':
             if ($val['linktype'] === '**dir') {
                 if (substr($val['link'], 0, 1) == '/') {
                     $parts = explode('/', $val['link']);
                     $name = array_pop($parts);
                     $dir = implode('/', $parts);
                 } else {
                     $name = $val['link'];
                     $dir = Gollem::$backend['dir'];
                 }
                 $url = $self_url->copy()->add(array('cacheid' => $cacheid, 'dir' => Gollem::subdirectory(Gollem::$backend['dir'], $val['name']), 'formid' => $vars->formid));
                 $item['link'] = $item['name'] . ' -> <strong>' . $url->link() . $val['link'] . '</a></strong>';
             } else {
                 $item['link'] = $item['name'] . ' -> ' . $val['link'];
             }
             break;
         default:
             $item['link'] = $name;
             break;
     }
     if (!empty($selectlist['files']) && in_array(Gollem::$backend['dir'] . '|' . $val['name'], $selectlist['files'])) {
         $item['selected'] = true;
     }
     $item['item'] = ++$rowct % 2 ? 'rowEven' : 'rowOdd';
     $entry[] = $item;
 }
예제 #2
0
파일: manager.php 프로젝트: horde/horde
     }
     break;
 case '**broken':
     $item['link'] = $name;
     break;
 case '**sym':
     if ($val['linktype'] === '**dir') {
         if (substr($val['link'], 0, 1) == '/') {
             $parts = explode('/', $val['link']);
             $name = array_pop($parts);
             $dir = implode('/', $parts);
         } else {
             $name = $val['link'];
             $dir = Gollem::$backend['dir'];
         }
         $url = $manager_url->copy()->add('dir', Gollem::subdirectory($dir, $name));
         $item['link'] = $item['name'] . ' -> ' . $url->link() . $val['link'] . '</a>';
     } else {
         $item['link'] = $item['name'] . ' -> ' . $val['link'];
     }
     break;
 default:
     $mime_type = Horde_Mime_Magic::extToMime($val['type']);
     // Edit link if possible.
     if (strpos($mime_type, 'text/') === 0) {
         $url = $edit_url->copy()->add(array('actionID' => 'edit_file', 'type' => $val['type'], 'file' => $val['name'], 'dir' => Gollem::$backend['dir'], 'driver' => Gollem::$backend['driver']));
         $item['edit'] = Horde::link('#', '', '', '_blank', Horde::popupJs($url));
     }
     // We can always download files.
     $item['dl'] = $registry->downloadUrl($val['name'], array('dir' => Gollem::$backend['dir'], 'backend' => $GLOBALS['session']->get('gollem', 'backend_key')))->link(array('title' => sprintf(_("Download %s"), $val['name'])));
     // Try a view link.