Content.php
3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrights_Edit_Tab_Content extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
// $this->setTemplate('anc/printconfigproduct/ancpcpcalendar.phtml');
// $this->setTemplate('anc/album/multiuploadncimage.phtml');
if (Mage::registry('anc_lib')) {
$data = Mage::registry('anc_lib')->getData();
} else {
$data = array();
}
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('anc_lib', array('name' => 'name')); //Mage::helper('news')->__('news information')));
$fieldset->addField('name', 'text', array(
'label' => Mage::helper('anc_lib/data')->__('Name'),
'class' => 'required-entry',
'required' => true,
'name' => 'name',
));
//
//
//
// $fieldset->addField('name', 'text', array(
// 'label' => Mage::helper('anc_album/data')->__('Name'),
// 'class' => 'required-entry',
// 'required' => true,
// 'name' => 'name',
// ));
//
// $fieldset->addField('comment', 'textarea', array(
// 'label' => Mage::helper('anc_album/data')->__('Comment'),
// 'class' => 'required-entry',
// 'required' => true,
// 'name' => 'comment',
// ));
// $fieldset->addField('link', 'link', array(
// 'label' => "Link",
// 'style' => "test",
// 'href' => 'www.excellencemagentoblog.com',
// 'value' => 'Magento Blog',
// 'name' => 'comment',
// 'after_element_html' => ''
// ));
// /**
// * Setzen der Hidden Id für Admin muss über den $data array erfolgen da sonst Magento für neue Elemente 0 setzt
// */
$data['admin_user_id'] = $admin = Mage::getSingleton('admin/session')->getUser()->getId();
$fieldset->addField('admin_user_id', 'hidden', array('name' => 'admin_user_id'));
//
//
//
$form->addValues($data);
return parent::_prepareForm();
}
// protected function _prepareForm() {
// if (Mage::registry('anc_album')) {
// $data = Mage::registry('anc_album')->getData();
// } else {
// $data = array();
// }
// $form = new Varien_Data_Form();
// $this->setForm($form);
// $fieldset = $form->addFieldset('anc_album', array('name' => 'Info'));//Mage::helper('news')->__('news information')));
//
//// $this->_addButton('order_reorder', array(
//// 'label' => Mage::helper('sales')->__('Print Labels'),
//// 'onclick' => 'window.open(\'/printouts/' . $this->getOrder()->getRealOrderId() . '.pdf\')',
//// ));
// $fieldset->addField('link', 'link', array(
// 'label' => Mage::helper('form')->__('Link'),
// 'style' => "",
// 'href' => 'www.excellencemagentoblog.com',
// 'value' => 'Magento Blog',
// 'after_element_html' => ''
// ));
// $form->addButton('btn_add', array(
// 'label' => Mage::helper('adminhtml')->__('Add new record'),
// 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/new') .'\')',
// 'class' => 'add',
// ),-1,3);
// $data['admin_user_id'] = $admin = Mage::getSingleton('admin/session')->getUser()->getId();
// $fieldset->addField('admin_user_id', 'hidden', array('name' => 'admin_user_id'));
//
//
//
// $form->setValues($data);
// return parent::_prepareForm();
// }
}