Пример #1
0
 public function info()
 {
     global $store;
     if (ar_store::$rememberShortcuts) {
         $path = ar_store::makePath($this->path);
         $realpath = ar_store::makeRealPath($this->path);
         if ($realpath != $path) {
             // must do a call for each seperate path.
             $list = array();
             $parent = $path;
             while ($realpath != $this->top && $parent != $this->top && end($list) != $realpath) {
                 $list[$parent] = $realpath;
                 $parent = ar_store::makePath($parent . '../');
                 $realpath = ar_store::makeRealPath($parent);
             }
             if ($realpath == $this->top || $parent == $this->top) {
                 $list[$parent] = $realpath;
             }
             $list = array_reverse($list);
             $result = array();
             foreach ($list as $virtualpath => $path) {
                 $result[$virtualpath] = current($store->info($store->get($path)));
             }
             return $result;
         }
     }
     return $store->info($store->parents($this->path, $this->top), array('usePathAsKey' => true));
 }
Пример #2
0
 public static function crumbs($options = array())
 {
     $current = $options['current'];
     if (!$current) {
         $current = ar::context()->getPath();
     }
     $top = $options['top'];
     if (!$top) {
         $top = ar_store::currentSite($current);
     }
     $options += array('current' => $current, 'top' => $top, 'filter' => '');
     $current = $options['current'];
     if (!$current) {
         $current = $top;
     }
     if ($options['filter']) {
         $query .= ' and ( ' . $options['filter'] . ' )';
     }
     return ar::get($current)->parents()->top($top);
 }
Пример #3
0
 public static function callAtPath($path, $callback)
 {
     $ob = current(ar_store::get($path)->call('system.get.phtml'));
     pobject::pushContext(array("arCurrentObject" => $ob, "scope" => "php"));
     call_user_func($callback);
     pobject::popContext();
 }