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