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:
44: $list = new cHTMLList();
45: global $area;
46: $ar = array();
47: $cfg = cRegistry::getConfig();
48: $client = cRegistry::getClientId();
49: $lang = cRegistry::getLanguageId();
50:
51:
52: $forms = $arts->getAllCommentedArticles();
53:
54: if (false === $forms) {
55: return '';
56: }
57:
58: global $area;
59:
60: $menu = new cGuiMenu();
61: for ($i = 0; $i < count($forms); $i++) {
62:
63: $formName = $result[$i]['title'];
64: $menu->setTitle($i, $formName);
65:
66:
67: $link = new cHTMLLink();
68:
69: $link->setCLink($area, 4, 'show_form');
70: $link->setTargetFrame('right_bottom');
71: $link->setClass('linktext');
72: $link->setCustom('idart', $result[$i]['idart']);
73: $link->setCustom('idcat', $result[$i]['idcat']);
74: $link->setContent($formName);
75: $menu->setLink($i, $link);
76:
77: $link = new cHTMLLink();
78:
79: $arg = $result[$i]['idart'];
80: $message = UserForum::i18n('ALLDELETEFROMCAT');
81: $link->setLink('javascript:void(0)');
82: $link->setAttribute("onclick", 'showConfirmation("' . $message . '", function(){ deleteArticlesByIdLeft(' . $arg . '); }); return false;');
83: $link->setImage($cfg['path']['images'] . 'delete.gif');
84: $link->setAlt($message);
85: $menu->setActions($i, 'delete', $link);
86: }
87:
88:
89:
90: return $menu;
91:
92: }
93:
94: public function receiveData(&$get) {
95: if ($_GET['action'] === 'delete_form') {
96:
97: $this->_collection->deleteAllCommentsById($get['idart']);
98: }
99:
100: return $this->getMenu();
101: }
102:
103: }
104:
105: ?>