1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5
6/**
7 * Paste style overview table
8 *
9 * @author Alex Killing <alex.killing@gmx.de>
10 * @version $Id$
11 *
12 * @ingroup ServicesStyle
13 */
14class ilPasteStyleCharacteristicTableGUI extends ilTable2GUI
15{
16    /**
17     * @var ilCtrl
18     */
19    protected $ctrl;
20
21    /**
22     * @var ilAccessHandler
23     */
24    protected $access;
25
26
27    /**
28     * Constructor
29     */
30    public function __construct($a_parent_obj, $a_parent_cmd)
31    {
32        global $DIC;
33
34        $this->ctrl = $DIC->ctrl();
35        $this->lng = $DIC->language();
36        $this->access = $DIC->access();
37        $ilCtrl = $DIC->ctrl();
38        $lng = $DIC->language();
39        $ilAccess = $DIC->access();
40        $lng = $DIC->language();
41
42        parent::__construct($a_parent_obj, $a_parent_cmd);
43        $this->setTitle($lng->txt("sty_paste_characteristics"));
44        $this->setLimit(9999);
45        $st_c = explode(":::", $_SESSION["sty_copy"]);
46        $this->from_style_id = $st_c[0];
47        $this->from_style_type = $st_c[1];
48        $this->setData(explode("::", $st_c[2]));
49        $this->addColumn($this->lng->txt("name"));
50        $this->addColumn($this->lng->txt("type"));
51        $this->addColumn($this->lng->txt("sty_if_style_class_already_exists"));
52
53        $this->setEnableHeader(true);
54        $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
55        $this->setRowTemplate("tpl.paste_style_row.html", "Services/Style/Content");
56        $this->disable("footer");
57        $this->setEnableTitle(true);
58
59        //$this->addMultiCommand("", $lng->txt(""));
60        $this->addCommandButton("pasteCharacteristics", $lng->txt("paste"));
61        $this->addCommandButton("edit", $lng->txt("cancel"));
62        $this->addHiddenInput("from_style_id", $this->from_style_id);
63    }
64
65    /**
66     * Fill table row
67     */
68    protected function fillRow($a_set)
69    {
70        $lng = $this->lng;
71
72        $char = explode(".", $a_set);
73        $this->tpl->setVariable("CHAR", $a_set);
74        $this->tpl->setVariable("SEL_OVERWRITE", 'checked="checked"');
75        $this->tpl->setVariable("VAL_TYPE", $lng->txt("sty_type_" . $char[0]));
76        $this->tpl->setVariable("VAL_TITLE", $char[2]);
77        $this->tpl->setVariable("TXT_OVERWRITE", $lng->txt("sty_overwrite"));
78        $this->tpl->setVariable("TXT_IGNORE", $lng->txt("sty_keep_existing"));
79    }
80}
81