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: protected $_collection;
26:
27: public function __construct() {
28: parent::__construct('left_bottom', 'userforum');
29: $this->_collection = new ArticleForumCollection();
30: $this->addScript('location.js');
31: $this->addStyle('right_bottom.css');
32: }
33:
34: protected function () {
35: $arts = new ArticleForumCollection();
36: $result = $arts->getAllCommentedArticles();
37: if (count($result) == 0) {
38: echo UserForum::i18n("NOENTRY");
39: }
40:
41: $cfg = cRegistry::getConfig();
42:
43:
44: $forms = $arts->getAllCommentedArticles();
45:
46: if (false === $forms) {
47: return '';
48: }
49:
50: global $area;
51:
52: $menu = new cGuiMenu();
53: for ($i = 0; $i < count($forms); $i++) {
54:
55: $formName = $result[$i]['title'];
56: $menu->setTitle($i, $formName);
57:
58:
59: $link = new cHTMLLink();
60:
61: $link->setCLink($area, 4, 'show_form');
62: $link->setTargetFrame('right_bottom');
63: $link->setClass('linktext');
64: $link->setCustom('idart', $result[$i]['idart']);
65: $link->setCustom('idcat', $result[$i]['idcat']);
66: $link->setContent($formName);
67: $menu->setLink($i, $link);
68:
69: $link = new cHTMLLink();
70:
71: $arg = $result[$i]['idart'];
72: $message = UserForum::i18n('ALLDELETEFROMCAT');
73: $link->setLink('javascript:void(0)');
74: $link->setAttribute("onclick", 'Con.showConfirmation("' . $message . '", function(){ deleteArticlesByIdLeft(' . $arg . '); }); return false;');
75: $link->setImage($cfg['path']['images'] . 'delete.gif');
76: $link->setAlt($message);
77: $menu->setActions($i, 'delete', $link);
78: }
79:
80: return $menu;
81: }
82:
83: public function receiveData(&$get) {
84: if ($_GET['action'] === 'delete_form') {
85: $this->_collection->deleteAllCommentsById($get['idart']);
86: }
87:
88: return $this->getMenu();
89: }
90:
91: }
92:
93: ?>