Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • ArticleForumCollection
  • ArticleForumItem
  • ArticleForumLeftBottom
  • ArticleForumRightBottom
  • cContentTypeUserForum
  • UserForum
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the class for visualisation and interactions in the right frame.
  4:  *
  5:  * @package Plugin
  6:  * @subpackage UserForum
  7:  * @author Claus Schunk
  8:  * @copyright four for business AG <www.4fb.de>
  9:  * @license http://www.contenido.org/license/LIZENZ.txt
 10:  * @link http://www.4fb.de
 11:  * @link http://www.contenido.org
 12:  */
 13: 
 14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 15: 
 16: /**
 17:  * This class contains builds the content of the right frame.
 18:  *
 19:  *
 20:  * @package Plugin
 21:  * @subpackage UserForum
 22:  */
 23: 
 24: global $area;
 25: 
 26: /**
 27:  * Class ArticleForumRightBottom
 28:  */
 29: class ArticleForumRightBottom extends cGuiPage {
 30: 
 31:     /**
 32:      * @var int
 33:      */
 34:     private $_indentFactor = 20;
 35: 
 36:     /**
 37:      * @var ArticleForumCollection
 38:      */
 39:     protected $_collection;
 40: 
 41:     /**
 42:      *
 43:      */
 44:     function __construct() {
 45: 
 46:         $this->_collection = new ArticleForumCollection();
 47:         parent::__construct('right_bottom', 'user_forum');
 48:         $this->addStyle('right_bottom.css');
 49:         $this->addScript('location.js');
 50:         // Reload left bottom in this code because of irregular update problems in the location file
 51:         $this->setReload();
 52:     }
 53: 
 54:     /**
 55:      * @param $timeStamp
 56:      *
 57:      * @return array
 58:      */
 59:     protected function formatTimeString($timeStamp) {
 60:         $nullstring = '0';
 61:         if ($timeStamp == "0000-00-00 00:00:00") {
 62:             return array();
 63:         } else {
 64:             $ar = (date_parse($timeStamp));
 65:             // if elements are smaller than 2 digits add a '0' at front. e.g
 66:             // 2:10 -> 02:10
 67:             (cString::getStringLength($ar['day']) < 2) ? $ar['day'] = $nullstring . $ar['day'] : '';
 68:             (cString::getStringLength($ar['month']) < 2) ? $ar['month'] = $nullstring . $ar['month'] : '';
 69:             (cString::getStringLength($ar['minute']) < 2) ? $ar['minute'] = $nullstring . $ar['minute'] : '';
 70:             (cString::getStringLength($ar['hour']) < 2) ? $ar['hour'] = $nullstring . $ar['hour'] : '';
 71:         }
 72: 
 73:         return $ar;
 74:     }
 75: 
 76:     /**
 77:      * this function returns an deactive link or an link with mail-to directive
 78:      * if the given mail adress is valid
 79:      *
 80:      * @param string $emailadr
 81:      * @param string $realname
 82:      * @return cHTMLLink
 83:      */
 84:     protected function checkValidEmail($emailadr, $realname) {
 85:         $regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/';
 86:         // Run the preg_match() function on regex against the email address
 87:         if (preg_match($regex, $emailadr)) {
 88:             $mail = new cHTMLLink();
 89:             $mail->setClass('emailactive');
 90:             $mail->setLink("mailto:" . $emailadr);
 91:             $mail->setContent($realname);
 92:         } else {
 93:             $mail = new cHTMLLink();
 94:             $mail->setLink('#');
 95:             $mail->setClass('emaildeactive');
 96:             $mail->setContent($realname);
 97:         }
 98:         return $mail;
 99:     }
100: 
101:     /**
102:      * this function builds buttons for user interactions
103:      *
104:      * @param $key
105:      * @param $cont
106:      * @param $cfg
107:      * @param $mod
108:      * 
109:      * @return array with buttons
110:      */
111:     protected function buildOnlineButtonBackendListMode(&$key, &$cont, &$cfg, $mod = null) {
112:         global $area;
113:         $buttons = array();
114: 
115:         $id = $cont['id_user_forum'];
116: 
117:         // shows onlineState
118:         $online = new cHTMLLink();
119:         if ($cont['online'] == 1) {
120:             $online->setImage($cfg['path']['images'] . 'online.gif');
121:             $online->setCustom('action', 'online_toggle');
122:             $online->setAlt(UserForum::i18n('SETOFFLINE'));
123:         } else {
124:             $online->setImage($cfg['path']['images'] . 'offline.gif');
125:             $online->setCustom('action', 'offline_toggle');
126:             $online->setAlt(UserForum::i18n('SETONLINE'));
127:         }
128: 
129:         $online->setCLink($area, 4, 'show_form');
130:         $online->setTargetFrame('right_bottom');
131:         $online->setStyle('margin-right:10px;');
132: 
133:         $online->setCustom('action', 'online_toggle');
134:         $online->setCustom('idart', $cont['idart']);
135:         $online->setCustom('id_user_forum', $cont['id_user_forum']);
136:         $online->setCustom('idcat', $cont['idcat']);
137:         $online->setCustom('online', $cont['online']);
138: 
139:         $online->setAttribute('method', 'get');
140: 
141:         // link to edit mode
142:         $edit = new cHTMLButton("edit");
143:         $edit->setImageSource($cfg['path']['images'] . 'but_todo.gif');
144:         $edit->setEvent('click', "$('form[name=$id]').submit()");
145:         $edit->setStyle('margin-right:10px; ');
146:         $edit->setMode('image');
147:         $edit->setAlt(UserForum::i18n('EDIT'));
148: 
149:         // additional params to identify actions from moderator startpage
150:         if (isset($mod)) {
151:             $online->setCustom('mod', true);
152: //            $edit->setCustom('mod', true);
153:         }
154: 
155:         $message = UserForum::i18n('ALLDELETEFROMCATHIER');
156:         $level = $cont['level'];
157:         $keyy = $key;
158:         $id = $cont['id_user_forum'];
159:         $idacat = $cont['idcat'];
160:         $idaart = $cont['idart'];
161: 
162:         // button with delete action
163:         $deleteButton = '<a title="' . $cont['title'] . '" href="javascript:void(0)" onclick="Con.showConfirmation(&quot;' . $message . '&quot;, function(){ deleteArticlesByIdRight(' . $level . ', ' . $keyy . ', ' . $id . ', ' . $idacat . ', ' . $idaart . '); });return false;"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $message . '" alt="' . $message . '"></a>';
164: 
165:         // insert buttons to array for return
166:         $buttons['online'] = $online;
167:         $buttons['edit'] = $edit;
168:         $buttons['delete'] = $deleteButton;
169: 
170:         return $buttons;
171:     }
172: 
173:     /**
174:      * generate main menu
175:      *
176:      * @param $result array with comments
177:      * @return ArticleForumRightBottom
178:      */
179:     public function getMenu(&$result, $mod = null) {
180:         $table = new cHTMLTable();
181:         if (count($result) < 1) {
182:             return new cHTMLTable();
183:         }
184:         $table->setCellPadding('100px');
185:         global $area;
186:         $table->updateAttributes(array(
187:             "class" => "generic",
188:             "cellspacing" => "0",
189:             "cellpadding" => "2"
190:         ));
191: 
192:         if (count($result) > 0) {
193:             $tr = new cHTMLTableRow();
194:             $th = new cHTMLTableHead();
195:             $th->setContent(i18n("FORUM_POST", "user_forum"));
196:             $th->setStyle('text-align: center');
197:             $tr->appendContent($th);
198: 
199:             $th = new cHTMLTableHead();
200:             $th->setContent(i18n("ACTIONS", "user_forum"));
201:             $th->setStyle('widht:20px');
202:             $th->setStyle('text-align: center');
203:             $th->setAttribute('valign', 'top');
204:             $tr->appendContent($th);
205: 
206:             $table->appendContent($tr);
207:         }
208: 
209:         $menu = new cGuiMenu();
210:         $cfg = cRegistry::getConfig();
211: 
212:         foreach ($result as $key => $cont) {
213: 
214:             $set = false;
215:             $like = $cont['like'];
216:             $dislike = $cont['dislike'];
217:             $timestamp = $cont['timestamp'];
218: 
219:             $datearray = $this->formatTimeString($cont['timestamp']);
220:             $date =  (empty($datearray)) ? '' : $datearray['day'] . '.' . $datearray['month'] . '.' . $datearray['year'] . ' ' . UserForum::i18n("AT") . ' ' . $datearray['hour'] . ':' . $datearray['minute'] . ' ' . UserForum::i18n("CLOCK");
221: 
222:             $buttons = array();
223:             $buttons = $this->buildOnlineButtonBackendListMode($key, $cont, $cfg, $mod);
224: 
225:             $online = $buttons['online'];
226:             $edit = $buttons['edit'];
227:             $delete = $buttons['delete'];
228: 
229:             // row
230:             $tr = new cHTMLTableRow();
231:             $trLike = new cHTMLTableRow();
232: 
233:             $likeButton = new cHTMLImage($cfg['path']['images'] . 'like.png');
234:             // $likeButton->setAttribute('valign', 'bottom');
235:             $dislikeButton = new cHTMLImage($cfg['path']['images'] . 'dislike.png');
236: 
237:             // valid email
238:             $maili = $this->checkValidEmail($cont['email'], $cont['realname']);
239:             $text = $cont['forum'];
240: 
241:             $timestamp = $cont['editedat'];
242: 
243:             $editarray = $this->formatTimeString($cont['editedat']);
244:             $editdate = (empty($editarray)) ? '' : $editarray['day'] . '.' . $editarray['month'] . '.' . $editarray['year'] . ' ' . UserForum::i18n("AT") . ' ' . $editarray['hour'] . ':' . $editarray['minute'] . ' ' . UserForum::i18n("CLOCK");
245: 
246:             $userColl = new cApiUserCollection();
247:             $user = $userColl->loadItem($cont['editedby'])->get('username');
248: 
249:             if (($cont['editedby'] != '') && ($cont['editedat'] != '') && $cont['editedat'] != "0000-00-00 00:00:00") {
250:                 $edit_information = (UserForum::i18n("EDITED") . $editdate . ' ' . UserForum::i18n("FROM") . $user);
251:                 $edit_information = "<em>$edit_information</em>";
252:             } else {
253:                 $edit_information = "<br>";
254:             }
255: 
256:             $tdEmpty = new cHTMLTableData();
257:             $tdEmpty->appendContent($edit_information);
258:             $tdLike = new cHTMLTableData();
259:             $tdEmpty->setAttribute('valign', 'top');
260:             $tdLike->setAttribute('valign', 'top');
261:             $tdLike->setStyle('text-align: center');
262: 
263:             // add like/dislike functionality to table
264:             $tdLike->appendContent($likeButton);
265:             $tdLike->appendContent(" $like ");
266:             $tdLike->appendContent($dislikeButton);
267:             $tdLike->appendContent(" $dislike");
268: 
269:             // in new row
270:             $trLike->appendContent($tdEmpty);
271:             $trLike->appendContent($tdLike);
272: 
273:             // build form element
274:             $form = new cHTMLForm($cont['id_user_forum']);
275:             $form->setAttribute('action', 'main.php?' . "area=" . $area . '&frame=4');
276: 
277:             $tdForm = new cHTMLTableData();
278:             $tdForm->setStyle('padding-left:' . $cont['level'] * $this->_indentFactor . 'px');
279: 
280:             // build buttons
281:             $tdButtons = new cHTMLTableData();
282:             $tdButtons->setAttribute('valign', 'top');
283:             $tdButtons->setStyle(' text-align: center');
284: 
285:             $tdButtons->appendContent($online);
286: 
287:             // not allowed at moderator starpage overview
288:             $tdButtons->appendContent($edit);
289:             if (!isset($mod)) {
290:                 $tdButtons->appendContent($delete);
291:             }
292: 
293:             $tdButtons->appendContent('<br>');
294:             $tdButtons->appendContent('<br>');
295: 
296:             // create hidden-fields
297:             $hiddenIdart = new cHTMLHiddenField('idart');
298:             $hiddenIdcat = new cHTMLHiddenField('idcat');
299:             $hiddenId_user_forum = new cHTMLHiddenField('id_user_forum');
300:             $hiddenLike = new cHTMLHiddenField('like');
301:             $hiddenDislike = new cHTMLHiddenField('dislike');
302:             $hiddenName = new cHTMLHiddenField('realname');
303:             $hiddenEmail = new cHTMLHiddenField('email');
304:             $hiddenLevel = new cHTMLHiddenField('level');
305:             $hiddenEditdat = new cHTMLHiddenField('editedat');
306:             $hiddenEditedby = new cHTMLHiddenField('editedby');
307:             $hiddenTimestamp = new cHTMLHiddenField('timestamp');
308:             $hiddenForum = new cHTMLHiddenField('forum');
309:             $hiddenOnline = new cHTMLHiddenField('online');
310:             $hiddenMode = new cHTMLHiddenField('mode');
311:             $hiddenKey = new cHTMLHiddenField('key');
312:             $hiddenaction = new cHTMLHiddenField('action');
313: 
314:             // set values
315:             $hiddenIdart->setValue($cont['idart']);
316:             $hiddenIdcat->setValue($cont['idcat']);
317:             $hiddenId_user_forum->setValue($cont['id_user_forum']);
318:             $hiddenLike->setValue($cont['like']);
319:             $hiddenDislike->setValue($cont['dislike']);
320:             $hiddenName->setValue(str_replace('\\', '', conHtmlSpecialChars($cont['realname'])));
321:             $hiddenEmail->setValue(str_replace('\\', '', conHtmlSpecialChars($cont['email'])));
322:             $hiddenLevel->setValue($cont['level']);
323:             $hiddenEditdat->setValue($cont['editedat']);
324:             $hiddenEditedby->setValue($cont['editedby']);
325:             $hiddenTimestamp->setValue($date);
326:             $hiddenForum->setValue(str_replace('\\', '', conHtmlSpecialChars($cont['forum'])));
327:             $hiddenOnline->setValue($cont['online']);
328:             $hiddenMode->setValue('edit');
329:             $hiddenKey->setValue($key);
330:             $hiddenaction->setValue('edit');
331: 
332:             // append to hidden-fields to form
333:             $form->appendContent($hiddenIdart);
334:             $form->appendContent($hiddenIdcat);
335:             $form->appendContent($hiddenId_user_forum);
336:             $form->appendContent($hiddenLike);
337:             $form->appendContent($hiddenDislike);
338:             $form->appendContent($hiddenName);
339:             $form->appendContent($hiddenEmail);
340:             $form->appendContent($hiddenLevel);
341:             $form->appendContent($hiddenForum);
342:             $form->appendContent($hiddenEditdat);
343:             $form->appendContent($hiddenEditedby);
344:             $form->appendContent($hiddenTimestamp);
345:             $form->appendContent($hiddenMode);
346:             $form->appendContent($hiddenOnline);
347:             $form->appendContent($hiddenKey);
348:             $form->appendContent($hiddenaction);
349: 
350:             if (isset($mod)) {
351:                 $form->appendContent(new cHTMLHiddenField('mod'));
352:             }
353: 
354:             // generate output text
355:             $form->appendContent($date . " von " . str_replace('\\', '', $maili) . " <br><br>");
356:             $form->appendContent((str_replace('\\', '', $text)) . "<br><br>");
357: 
358:             $tdForm->setContent($form);
359:             $tdForm->setAttribute('valign', 'top');
360:             $tr->setContent($tdForm);
361:             $tr->appendContent($tdButtons);
362:             $tr->appendContent($trLike);
363:             $table->appendContent($tr);
364:         }
365: 
366:         $this->appendContent($table);
367: 
368:         return $this;
369:     }
370: 
371:     /**
372:      * generate dialog for editmode
373:      *
374:      * @param array $post
375:      * @return ArticleForumRightBottom
376:      */
377:     protected function getEditModeMenu($post) {
378: 
379:         global $area;
380:         $changes = 0;
381:         $cfg = cRegistry::getConfig();
382:         $idart = cRegistry::getArticleId();
383:         $idcat = cRegistry::getCategoryId();
384:         $menu = new cGuiMenu();
385:         $tr = new cHTMLTableRow();
386: 
387:         $th = new cHTMLTableHead();
388:         $th->setContent(UserForum::i18n("PARAMETER"));
389: 
390:         $th2 = new cHTMLTableHead();
391:         $th2->setContent(UserForum::i18n("CONTENT"));
392:         $th2->setStyle('widht:50px');
393:         $th2->setAttribute('valign', 'top');
394:         $tr->appendContent($th);
395:         $tr->appendContent($th2);
396: 
397:         // build form element
398:         $form1 = new cGuiTableForm("comment", "main.php?area=user_forum&frame=4", "post");
399:         $form1->addHeader($tr);
400:         $form1->setTableID("table");
401: 
402:         $user = new cApiUser();
403:         $user->loadByPrimaryKey($post['editedby']);
404:         $username = $user->getField('username');
405: 
406:         $id = $post['id_user_forum'];
407: 
408:         $likeButton = new cHTMLImage($cfg['path']['images'] . 'like.png');
409:         $dislikeButton = new cHTMLImage($cfg['path']['images'] . 'dislike.png');
410: 
411: 
412:         $name = new cHTMLTextBox("realname", str_replace('\\', '',(conHtmlSpecialChars($post['realname']))), 30, 255);
413:         $email = new cHTMLTextBox("email", $post['email'], 30, 255);
414:         $like = new cHTMLTextBox("like", $post['like'], 7, 7);
415:         $dislike = new cHTMLTextBox("dislike", $post['dislike'], 7, 7);
416: 
417:         $text = str_replace("<br />", "\n", conHtmlSpecialChars($post['forum']));
418:         $text = str_replace('\\', '', $text);
419: 
420:         $forum = new cHTMLTextArea("forum", $text);
421: 
422:         $datearray = $this->formatTimeString($post['timestamp']);
423:         $date = (empty($datearray)) ? '' : $datearray['day'] . '.' . $datearray['month'] . '.' . $datearray['year'] . ' ' . UserForum::i18n("AT") . ' ' . $datearray['hour'] . ':' . $datearray['minute'] . ' ' . UserForum::i18n("CLOCK");
424: 
425:         $editedatearray = $this->formatTimeString($post['editedat']);
426:         $editedat = (empty($editedatearray)) ? '' : $editedatearray['day'] . '.' . $editedatearray['month'] . '.' . $editedatearray['year'] . ' ' . UserForum::i18n("AT") . ' ' . $editedatearray['hour'] . ':' . $editedatearray['minute'] . ' ' . UserForum::i18n("CLOCK");
427: 
428:         $timestamp = new cHTMLTextBox("timestamp", $date, 30, 255);
429:         $editedat = new cHTMLTextBox("editedat", $editedat, 30, 255);
430:         $editedby = new cHTMLTextBox("editedby", $username, 30, 255);
431: 
432:         $editedat->setDisabled(true);
433:         $timestamp->setDisabled(true);
434:         $editedby->setDisabled(true);
435: 
436: 
437:         $form1->add(UserForum::i18n("USER"), $name, '');
438:         $form1->add(UserForum::i18n("EMAIL"), $email, '');
439:         $form1->add(UserForum::i18n("LIKE"), $like, '');
440:         $form1->add(UserForum::i18n("DISLIKE"), $dislike, '');
441:         $form1->add(UserForum::i18n("TIME"), $timestamp, '');
442:         $form1->add(UserForum::i18n("EDITDAT"), $editedat, '');
443:         $form1->add(UserForum::i18n("EDITEDBY"), $editedby, '');
444: 
445:         // handle moderation mode actions
446:         if (isset($post['mod'])) {
447:             $form1->setVar('mod', 'mod');
448:             $form1->addCancel("main.php?area=user_forum&frame=4&action=back&mod=mod");
449:         } else {
450:             $form1->addCancel("main.php?area=user_forum&frame=4&action=back&idart=$idart&idcat=$idcat");
451:         }
452: 
453:         $onlineBox = new cHTMLCheckbox("onlineState", "");
454: 
455:         $onlineBox->setChecked(($post['online'] == 1) ? true : false);
456:         $form1->add(UserForum::i18n("ONLINE"), $onlineBox, '');
457: 
458:         $idart = $post['idart'];
459:         $idcat = $post['idcat'];
460: 
461:         $form1->add(UserForum::i18n("COMMENT"), $forum, '');
462: 
463:         // $form1->setVar('online', $post['online']);
464:         $form1->setVar("id_user_forum", $post['id_user_forum']);
465:         $form1->setVar("idart", $post['idart']);
466:         $form1->setVar("idcat", $post['idcat']);
467:         $form1->setVar("action", 'update');
468:         $form1->setVar("mode", "list");
469:         $form1->setVar("activeChanges", $changes);
470: 
471:         $this->appendContent($form1);
472: 
473:         return $this;
474:     }
475: 
476:     /**
477:      * @param $id_cat
478:      * @param $id_art
479:      * @param $id_lang
480:      *
481:      * @return ArticleForumRightBottom
482:      */
483:     public function getForum($id_cat, $id_art, $id_lang) {
484:         $arrUsers = $this->_collection->getExistingforum();
485: 
486:         $arrforum = array();
487: 
488:         $this->_collection->getTreeLevel($id_cat, $id_art, $id_lang, $arrUsers, $arrforum);
489:         $result = array();
490:         $this->normalizeArray($arrforum, $result);
491: 
492:         $ret = $this->getMenu($result);
493: 
494:         return $ret;
495:     }
496: 
497:     /**
498:      * @param     $arrforum
499:      * @param     $result
500:      * @param int $level
501:      */
502:     protected function normalizeArray($arrforum, &$result, $level = 0) {
503:         if (is_array($arrforum)) {
504:             foreach ($arrforum as $key => $value) {
505:                 $value['level'] = $level;
506:                 unset($value['children']);
507:                 $result[$key] = $value;
508:                 $this->normalizeArray($arrforum[$key]['children'], $result, $level + 1);
509:             }
510:         }
511:     }
512: 
513:     /**
514:      * this function calls different actions depending on the received values
515:      * via $_POST oder $_GET.
516:      *
517:      * @param $get
518:      * @param $post
519:      * @throws Exception
520:      */
521:     public function receiveData(&$get, &$post) {
522:         if (isset($_REQUEST['action']) && $_REQUEST['action'] != NULL) {
523:             $this->switchActions();
524:         }
525:     }
526: 
527: 
528:     /**
529:      */
530:     public function getStartpage() {
531: 
532: 
533:         $cGuiNotification = new cGuiNotification();
534:         echo $cGuiNotification->returnNotification(cGuiNotification::LEVEL_INFO, UserForum::i18n('MODMODE'));
535:         echo '<br />';
536: 
537:         $comments = $this->_collection->getUnmoderatedComments();
538:         $this->getMenu($comments, 'mod');
539: 
540:     }
541: 
542: 
543:     /**
544:      * switch case action calling
545:      *
546:      * @throws Exception
547:      */
548:     protected function switchActions() {
549: 
550:         $lang = cRegistry::getLanguageId();
551:         $idart = $_REQUEST['idart'];
552:         $idcat = $_REQUEST['idcat'];
553:         $action = $_REQUEST["action"];
554:         $online = (isset($_REQUEST['onlineState'])) ? 1 : 0;
555: 
556: 
557:         switch ($action) {
558: 
559:             // after click on online button in std dialog
560:             case 'online_toggle':
561:                 $this->_collection->toggleOnlineState($_REQUEST['online'], $_REQUEST['id_user_forum'], $idart);
562: 
563:                 if(!isset($_REQUEST['mod'])) {
564:                     $this->getForum($idcat, $idart, $lang);
565:                 } else{
566:                     $this->getStartpage();
567:                 }
568: 
569:                 break;
570:             // after click on delete button in std dialog
571:             case 'deleteComment':
572:                 $this->_collection->deleteHierarchy($_REQUEST['key'], $_REQUEST['level'], $idart, $idcat, $lang);
573:                 $this->getForum($idcat, $idart, $lang);
574:                 break;
575:             // after click on save button in edit dialog
576:             case 'update':
577:                 $this->_collection->updateValues($_POST['id_user_forum'], $_POST['realname'], $_POST['email'], $_POST['like'], $_POST['dislike'], $_POST['forum'], $online);
578:                 if(!isset($_REQUEST['mod'])) {
579:                     $this->getForum($idcat, $idart, $lang);
580:                 } else{
581:                     $this->getStartpage();
582:                 }
583: 
584:                 break;
585:             case 'show_form':
586:                 // lists all comments from given articleId
587:                 $this->getForum($idcat, $idart, $lang);
588:                 break;
589:             case 'edit':
590:                 // shows edit mode for a comment
591:                 $this->getEditModeMenu($_POST);
592:                 break;
593:                 // cancel Button in edit dialog
594:             case 'back':
595:                 if(!isset($_REQUEST['mod'])) {
596:                     $this->getForum($idcat, $idart, $lang);
597:                 } else{
598:                     $this->getStartpage();
599:                 }
600: //                $this->getForum($idcat, $idart, $lang);
601:                 break;
602:             case 'empty':
603:                 // $this->getForum($idcat, $idart, $lang);
604:                 break;
605:             default:
606:                 $this->getForum($idcat, $idart, $lang);
607:                 throw new Exception('$_GET["action"] type ' . $_REQUEST["action"] . ' not implemented');
608:         }
609:     }
610: 
611: }
612: 
613: ?>
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0