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
    • SIWECOS
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • ArticleForum
  • 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 left
  4:  * frame.
  5:  *
  6:  * @package Plugin
  7:  * @subpackage UserForum
  8:  * @author Claus Schunk
  9:  * @copyright four for business AG <www.4fb.de>
 10:  * @license http://www.contenido.org/license/LIZENZ.txt
 11:  * @link http://www.4fb.de
 12:  * @link http://www.contenido.org
 13:  */
 14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 15: 
 16: /**
 17:  * This class contains builds the content of the left frame
 18:  *
 19:  *
 20:  * @package Plugin
 21:  * @subpackage UserForum
 22:  */
 23: class ArticleForumLeftBottom extends cGuiPage {
 24:     /**
 25:      * @var ArticleForumCollection
 26:      */
 27:     protected $_collection;
 28: 
 29:     /**
 30:      * ArticleForumLeftBottom constructor.
 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:      * @return cGuiMenu|string
 41:      * @throws cDbException
 42:      */
 43:     protected function getMenu() {
 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:         // get all forms of current client in current language
 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:             // add 'show form' link
 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(&quot;' . $message . '&quot;, 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:      * @param $get
 94:      *
 95:      * @return cGuiMenu|string
 96:      * @throws cDbException
 97:      * @throws cInvalidArgumentException
 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: ?>
CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0