Пример #1
0
 public static function getCallback($method, $params = array())
 {
     if (is_string($method)) {
         return function () use($params, $method) {
             $me = ar::context()->getObject();
             $args_in = func_get_args();
             if (count($params)) {
                 $args = array();
                 foreach ($params as $key => $arg) {
                     $args[$arg] = $args_in[$key];
                 }
             } else {
                 $args = $args_in;
             }
             return ar::call($method, $args);
         };
     } else {
         return false;
     }
 }
Пример #2
0
<?php

$ARCurrent->nolangcheck = true;
$ARCurrent->allnls = true;
if ($this->CheckLogin("read") && $this->CheckConfig()) {
    require_once $this->store->get_config("code") . "modules/mod_yui.php";
    if ($AR->user->data->language) {
        ldSetNls($AR->user->data->language);
    }
    $wwwroot = $AR->dir->www;
    $menuitems = array(array('label' => $ARnls['ariadne:logoff'], 'iconalt' => $ARnls['ariadne:logoff'], 'icon' => $AR->dir->images . 'icons/medium/logout.png', 'href' => $this->make_ariadne_url() . 'logoff.php'), array('label' => $ARnls['ariadne:search'], 'iconalt' => $ARnls['ariadne:search'], 'icon' => $AR->dir->images . 'icons/small/search.png', 'onclick' => "muze.ariadne.explore.toolbar.searchwindow(); return false;", 'href' => $this->make_ariadne_url() . 'dialog.search.php'), array('label' => $ARnls['ariadne:folders'], 'iconalt' => $ARnls['ariadne:folders'], 'icon' => $AR->dir->images . 'icons/small/view_tree.png', 'href' => "#", 'onclick' => 'muze.ariadne.explore.tree.toggle(); return false;'), array('label' => $ARnls['ariadne:preferences'], 'iconalt' => $ARnls['ariadne:preferences'], 'icon' => $AR->dir->images . 'icons/small/preferences.png', 'onclick' => "muze.ariadne.explore.arshow('dialog.preferences','" . $this->store->get_config('root') . $AR->user->path . "dialog.preferences.php'); return false;", 'href' => $this->make_ariadne_url($AR->user->path) . "dialog.preferences.php"), array('iconalt' => $ARnls['ariadne:iconview'], 'icon' => $AR->dir->images . 'icons/small/view_icon.png', 'onclick' => 'return false;', 'submenu' => array(array('href' => "javascript:muze.ariadne.explore.viewpane.setviewmode('list');", 'label' => $ARnls['ariadne:small']), array('href' => "javascript:muze.ariadne.explore.viewpane.setviewmode('icons');", 'label' => $ARnls['ariadne:large']), array('href' => "javascript:muze.ariadne.explore.viewpane.setviewmode('details');", 'label' => $ARnls['ariadne:details']))), array('iconalt' => $ARnls['ariadne:help'], 'icon' => $AR->dir->images . 'icons/small/help.png', 'onclick' => 'return false;', 'submenu' => array(array('href' => "#", 'onclick' => "muze.ariadne.explore.arshow('help', 'http://www.ariadne-cms.org/docs/'); return false;", 'label' => $ARnls['ariadne:help']), array('href' => "#", 'onclick' => "muze.ariadne.explore.arshow('help.about','help.about.php'); return false;", 'label' => $ARnls['ariadne:about']))), array('iconalt' => $ARnls['ariadne:up'], 'icon' => $AR->dir->images . 'icons/small/up.png', 'href' => $this->make_ariadne_url($this->parent) . "explore.html", 'onclick' => "muze.ariadne.explore.toolbar.viewparent(); return false;", 'id' => "viewparent"));
    ar::call('ariadne.logo.html');
    ?>
		<?php 
    echo yui::yui_menuitems($menuitems, "yuimenubar", "explore_menubar") . "\n";
    ?>
		<div class="searchdiv">
			<form action="explore.html" onsubmit="muze.ariadne.explore.toolbar.searchsubmit(this.arPath.value); return false;">
				<div>
					<input size="30" id="searchpath" class="text searchpath" type="text" name="arPath" value="<?php 
    echo $this->path;
    ?>
">
					<input type="image" src="<?php 
    echo $AR->dir->www;
    ?>
images/icons/small/go.png" title="<?php 
    echo htmlspecialchars($ARnls['ariadne:search']);
    ?>
" id="searchbutton" name="searchsubmit" value="<?php 
    echo $ARnls["ariadne:search"];
Пример #3
0
 public static function _call($template, $params = null)
 {
     return ar::call($template, $params);
 }
Пример #4
0
$colDefs = ar::getvar('columns');
$defaults = array("name" => $this->nlsdata->name, "filename" => basename($this->path), "path" => $this->path, "parent" => $this->parent, "type" => $this->type, "size" => $this->size, "owner" => $this->data->config->owner, "lastchanged" => date("Y-m-d H:i", $this->lastchanged), "modified" => date("Y-m-d H:i", $this->data->mtime), "created" => date("Y-m-d H:i", $this->data->ctime), "language" => $this->data->nls->list, 'local_url' => $this->make_ariadne_url(), 'priority' => $this->priority, "vtype" => $this->vtype, "icons" => array("small" => $ARCurrent->arTypeIcons[$this->type]["small"] ? $ARCurrent->arTypeIcons[$this->type]["small"] : $this->call('system.get.icon.php', array('size' => 'small')), "medium" => $ARCurrent->arTypeIcons[$this->type]["medium"] ? $ARCurrent->arTypeIcons[$this->type]["medium"] : $this->call('system.get.icon.php', array('size' => 'medium')), "large" => $ARCurrent->arTypeIcons[$this->type]["large"] ? $ARCurrent->arTypeIcons[$this->type]["large"] : $this->call('system.get.icon.php', array('size' => 'large'))));
if (!$colDefs) {
    $colDefs = $defaults;
}
if (!isset($colDefs["local_url"])) {
    $colDefs["local_url"] = $defaults["local_url"];
}
$arResult = [];
//FIXME: needs refactoring, or \arc\hash::get() must accept '/' as 'return the root entry itself'
foreach ($colDefs as $key => $colDef) {
    if (array_key_exists($key, $defaults)) {
        $arResult[$key] = $defaults[$key];
    } else {
        if ($colDef['call']) {
            $arResult[$key] = ar::call($colDef['call'], $colDef);
        } else {
            if ($colDef['entry']) {
                $root = \arc\path::head($colDef['entry']);
                $tail = \arc\path::tail($colDef['entry']);
                switch ($root) {
                    case 'data':
                        $first = \arc\path::head($tail);
                        $tail = \arc\path::tail($tail);
                        if (is_object($this->data->{$first})) {
                            $item = \arc\path::head($tail);
                            $tail = \arc\path::tail($tail);
                            if ($tail == '/') {
                                $arResult[$key] = $this->data->{$first}->{$item};
                            } else {
                                $arResult[$key] = \arc\hash::get($this->data->{$first}->{$item}, $tail);