1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
22:
23: include_once dirname(__DIR__) . '/include/common.php';
24:
25: function publisher_items_menu_show($options)
26: {
27: $block = array();
28:
29: $publisher = Publisher::getInstance();
30:
31:
32: $block_categoriesObj = $publisher->getCategoryHandler()->getCategories(0, 0, 0);
33:
34: if (count($block_categoriesObj) == 0) return $block;
35:
36:
37: $block['inModule'] = $publisher->isCurrentModule();
38:
39: $catlink_class = 'menuMain';
40:
41: $categoryid = 0;
42:
43: if ($block['inModule']) {
44:
45: $categoryid = isset($_GET['categoryid']) ? (int)($_GET['categoryid']) : 0;
46:
47: if ($categoryid != 0) {
48:
49: $categoryObj = $publisher->getCategoryHandler()->get($categoryid);
50: $block['currentcat'] = $categoryObj->getCategoryLink('menuTop');
51: $catlink_class = 'menuSub';
52: }
53: }
54:
55: foreach ($block_categoriesObj as $catid => $block_categoryObj) {
56: if ($catid != $categoryid) {
57: $block['categories'][$catid]['categoryLink'] = $block_categoryObj->getCategoryLink($catlink_class);
58: }
59: }
60:
61: return $block;
62: }
63:
64: function publisher_items_menu_edit($options)
65: {
66: $form = new Xoops\Form\BlockForm();
67:
68: $catEle = new Xoops\Form\Label(_MB_PUBLISHER_SELECTCAT, PublisherUtils::createCategorySelect($options[0], 0, true, 'options[0]'));
69: $orderEle = new Xoops\Form\Select(_MB_PUBLISHER_ORDER, 'options[1]', $options[1]);
70: $orderEle->addOptionArray(array(
71: 'datesub' => _MB_PUBLISHER_DATE,
72: 'counter' => _MB_PUBLISHER_HITS,
73: 'weight' => _MB_PUBLISHER_WEIGHT,
74: ));
75: $dispEle = new Xoops\Form\Text(_MB_PUBLISHER_DISP, 'options[2]', 10, 255, $options[2]);
76:
77: $form->addElement($catEle);
78: $form->addElement($orderEle);
79: $form->addElement($dispEle);
80:
81: return $form->render();
82: }
83: