Overview

Packages

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

Classes

  • ArticleForumCollection
  • ArticleForumItem
  • ArticleForumLeftBottom
  • 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:  * @version SVN Revision $Rev:$
  9:  *
 10:  * @author Claus Schunk
 11:  * @copyright four for business AG <www.4fb.de>
 12:  * @license http://www.contenido.org/license/LIZENZ.txt
 13:  * @link http://www.4fb.de
 14:  * @link http://www.contenido.org
 15:  */
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * This class contains builds the content of the left frame
 20:  *
 21:  *
 22:  * @package Plugin
 23:  * @subpackage UserForum
 24:  */
 25: class ArticleForumLeftBottom extends cGuiPage {
 26: 
 27:     protected $_collection;
 28: 
 29:     public function __construct() {
 30:         parent::__construct('left_bottom', 'articlelist');
 31:         $this->_collection = new ArticleForumCollection();
 32:         $this->addScript('../plugins/user_forum/scripts/location.js');
 33:         $this->addStyle('../plugins/user_forum/styles/right_bottom.css');
 34:     }
 35: 
 36:     protected function getMenu() {
 37:         $arts = new ArticleForumCollection();
 38:         $result = $arts->getAllCommentedArticles();
 39:         if (count($result) == 0) {
 40:             echo UserForum::i18n("NOENTRY");
 41:         }
 42: 
 43:         // $this->addScript('../scripts/location.js');
 44:         $list = new cHTMLList();
 45:         global $area;
 46:         $ar = array();
 47:         $cfg = cRegistry::getConfig();
 48:         $client = cRegistry::getClientId();
 49:         $lang = cRegistry::getLanguageId();
 50: 
 51:         // get all forms of current client in current language
 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:             // add 'show form' link
 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(&quot;' . $message . '&quot;, 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:         if (count($forms) > 0) {
 88:             return $menu;
 89:         } else {
 90: 
 91:             return $menu;
 92:         }
 93:     }
 94: 
 95:     public function receiveData(&$get) {
 96:         if ($_GET['action'] === 'delete_form') {
 97:             // print_r($_GET['idart']);
 98:             $this->_collection->deleteAllCommentsById($get['idart']);
 99:         }
100: 
101:         return $this->getMenu();
102:     }
103: 
104: }
105: 
106: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0