1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20: 21: 22: 23: 24:
25: class ArticleForumLeftBottom extends cGuiPage {
26:
27: protected $_collection;
28:
29: public function __construct() {
30: parent::__construct('left_bottom', 'userforum');
31: $this->_collection = new ArticleForumCollection();
32: $this->addScript('location.js');
33: $this->addStyle('right_bottom.css');
34: }
35:
36: protected function () {
37: $arts = new ArticleForumCollection();
38: $result = $arts->getAllCommentedArticles();
39: if (count($result) == 0) {
40: echo UserForum::i18n("NOENTRY");
41: }
42:
43: $cfg = cRegistry::getConfig();
44:
45:
46: $forms = $arts->getAllCommentedArticles();
47:
48: if (false === $forms) {
49: return '';
50: }
51:
52: global $area;
53:
54: $menu = new cGuiMenu();
55: for ($i = 0; $i < count($forms); $i++) {
56:
57: $formName = $result[$i]['title'];
58: $menu->setTitle($i, $formName);
59:
60:
61: $link = new cHTMLLink();
62:
63: $link->setCLink($area, 4, 'show_form');
64: $link->setTargetFrame('right_bottom');
65: $link->setClass('linktext');
66: $link->setCustom('idart', $result[$i]['idart']);
67: $link->setCustom('idcat', $result[$i]['idcat']);
68: $link->setContent($formName);
69: $menu->setLink($i, $link);
70:
71: $link = new cHTMLLink();
72:
73: $arg = $result[$i]['idart'];
74: $message = UserForum::i18n('ALLDELETEFROMCAT');
75: $link->setLink('javascript:void(0)');
76: $link->setAttribute("onclick", 'Con.showConfirmation("' . $message . '", function(){ deleteArticlesByIdLeft(' . $arg . '); }); return false;');
77: $link->setImage($cfg['path']['images'] . 'delete.gif');
78: $link->setAlt($message);
79: $menu->setActions($i, 'delete', $link);
80: }
81:
82: return $menu;
83: }
84:
85: public function receiveData(&$get) {
86: if ($_GET['action'] === 'delete_form') {
87: $this->_collection->deleteAllCommentsById($get['idart']);
88: }
89:
90: return $this->getMenu();
91: }
92:
93: }
94:
95: ?>