コード例 #1
0
ファイル: dialog.add.list.php プロジェクト: poef/ariadne
$ARCurrent->nolangcheck = true;
if ($this->CheckLogin("add", ARANYTYPE) && $this->CheckConfig()) {
    require_once $this->store->get_config("code") . "modules/mod_yui.php";
    if (!$arReturnTemplate) {
        $arReturnTemplate = "dialog.new.php";
    }
    $server_name = preg_replace("|^[htps:/]*/|i", "", $AR->host);
    if ($_SERVER["HTTP_HOST"] == $server_name) {
        $currentpath = $this->store->get_config("root") . $this->path;
    } else {
        $currentpath = $this->make_ariadne_url();
    }
    if (!($showall && $this->CheckSilent("layout"))) {
        $showall = 0;
    }
    $typeslist = yui::getTypes($this, $showall);
    $itemlist = array();
    if ($typeslist && is_array($typeslist) && count($typeslist)) {
        $itemlist = yui::getItems($this, $typeslist, $currentpath, $arReturnTemplate);
    } else {
        error($ARnls["ariadne:no_adding_found"]);
    }
    echo '<div class="listcontainer">';
    foreach ($itemlist as $item) {
        echo '<a class="item ' . $item['class'] . '" href="' . $item['href'] . '" title="' . $item['type'] . '">';
        echo '<img class="icon" src="' . $item['icon'] . '" alt="' . $item['type'] . '" title="' . $item['type'] . '">';
        echo '<span class="name">' . htmlspecialchars($item['name']) . '</span>';
        echo '</a>';
    }
    echo '</div>';
}
コード例 #2
0
ファイル: dialog.add.form.type.php プロジェクト: poef/ariadne
<?php

if ($this->CheckLogin("read") && $this->CheckConfig()) {
    echo '<fieldset id="type">';
    if (!$location) {
        $location = $this->path;
    }
    $locationOb = current($this->get($location, "system.get.phtml"));
    $typeslist = yui::getTypes($locationOb, $showall);
    $itemlist = array();
    if ($typeslist && is_array($typeslist) && count($typeslist)) {
        $itemlist = yui::getItems($locationOb, $typeslist, $location, "dialog.add.php");
        foreach ($itemlist as $item) {
            if ($this->CheckSilent('add', $item['type'], $location)) {
                $typeslist[$item['type']] = ar('html')->el("div", ar('html')->el("img", array("src" => $item['icon'], "alt" => $item['name'], "title" => $item['name'])) . $item['name']);
            } else {
                unset($typeslist[$item['type']]);
            }
        }
    } else {
        // error($ARnls["ariadne:no_adding_found"]);
    }
    if ($arNewType) {
        echo "<legend>" . $ARnls['ariadne:new:create_object'] . "</legend>";
        $typeslist = array($arNewType => $typeslist[$arNewType]);
        $fields = array("arNewType" => array("type" => "radio", "value" => $arNewType, "options" => $typeslist, "label" => false, "class" => "type_selected"));
    } else {
        echo '<legend>' . $ARnls['ariadne:new:select_type'] . '</legend>';
        if ($this->CheckSilent("layout")) {
            $fields = array("showall" => array("type" => "checkbox", "value" => $showall, "label" => $ARnls['ariadne:new:show_all_types'], "checkedValue" => 1, "uncheckedValue" => 0));
            $snippit = ar('html')->form($fields, false)->getHTML()->childNodes;