Show
Ignore:
Timestamp:
05/24/08 16:18:40 (5 years ago)
Author:
Tatzelwurm
Message:

WYSIWYG Adaption

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • downloadDatabase/files/lib/acp/form/DownloadDBKatAddForm.class.php

    r453 r524  
    11<?php 
    22// wcf imports 
    3 require_once(WCF_DIR.'lib/acp/form/ACPForm.class.php'); 
     3require_once(WCF_DIR.'lib/acp/form/WysiwygCacheloaderForm.class.php'); 
    44require_once(WCF_DIR.'lib/data/downloadDB/DownloadDBKatEditor.class.php'); 
    55 
     
    1414 */ 
    1515 
    16 class DownloadDBKatAddForm extends ACPForm { 
     16class DownloadDBKatAddForm extends WysiwygCacheloaderForm { 
    1717        public $templateName = 'downloadDBKatAdd'; 
    1818        public $activeMenuItem = 'wcf.acp.menu.link.content.dldb'; 
     
    2828        public $groupIDs = array(1); 
    2929        public $uploadGroups = array(); 
    30          
     30        public $languageID = '1'; 
     31         
     32        public $showSettings = true; 
     33        public $showSmilies = true; 
     34        public $canUseSmilies = true; 
     35        public $showSignatureSetting = false; 
     36                 
    3137        public $action; 
    3238        private $valid = false; 
     
    5763                if (isset($_POST['sortOrder']))         $this->sortOrder        = intval($_POST['sortOrder']); 
    5864                if (isset($_POST['action']))            $this->action           = escapeString($_POST['action']); 
     65                if (isset($_POST['languageID']))        $this->languageID       = intval($_POST['languageID']); 
    5966        } 
    6067         
     
    106113                        // Kategorie speichern   
    107114                        // Neues Kategorie Objekt 
    108                         $category = DownloadDBKatEditor::createCategory($this->topID, $this->name, $this->description, $this->groupIDs, $this->uploadGroups, intval($this->sortOrder)); 
     115                        $moreData = array( 
     116                                        'parseURL'              => intval($this->parseURL), 
     117                                        'enableBBCodes' => intval($this->enableBBCodes), 
     118                                        'enableHtml'    => intval($this->enableHtml), 
     119                                        'enableSmilies' => intval($this->enableSmilies), 
     120                                        'languageID'    => intval($this->languageID) 
     121                        ); 
     122                        $category = DownloadDBKatEditor::createCategory($this->topID, $this->name, $this->description, $this->groupIDs, $this->uploadGroups, intval($this->sortOrder), $moreData); 
    109123                } 
    110124                $this->saved(); 
     
    120134        public function readData() { 
    121135                parent::readData(); 
     136                $this->languageID = WCF::getUser()->languageID; 
    122137                $this->readCategorys(); 
    123138        } 
     
    129144                parent::assignVariables(); 
    130145 
     146                WCFACP::getMenu()->setActiveMenuItem($this->activeMenuItem); 
     147                 
     148                $languagesArray = WCF::getLanguage()->getAvailableLanguages(); 
     149                         
     150                for ($i = 0; $i < count($languagesArray); $i++) { 
     151                        $languageItems = $languagesArray[$i]; 
     152                                 
     153                        $languageArray[] = array( 
     154                                        'languageID' => $languageItems['languageID'], 
     155                                        'languageName' => WCF::getLanguage()->get('wcf.global.language.'.$languageItems['languageCode']), 
     156                        ); 
     157                } 
     158                 
    131159                WCF::getTPL()->assign(array( 
    132160                        'topID'                         => $this->topID, 
     
    138166                        'uploadGroups'          => $this->uploadGroups, 
    139167                        'sortOrder'                     => $this->sortOrder, 
    140                         'action'                        => 'add' 
     168                        'action'                        => 'add', 
     169                        'enableBBCodes'         => $this->enableBBCodes, 
     170                        'enableHtml'            => $this->enableHtml, 
     171                        'enableSmilies'         => $this->enableSmilies, 
     172                        'language'                      => $languageArray, 
     173                        'languageID'            => $this->languageID 
    141174                )); 
    142175        } 
     
    145178                foreach ($this->katCache as $ID => $kategorie) { 
    146179                        if ($kategorie['topID'] == $katID) { 
    147                                 $this->katOptions[$kategorie['katID']] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".StringUtil::unescape($kategorie['name']); 
     180                                $this->katOptions[$kategorie['katID']] = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$kategorie['name']; 
    148181                                // weitere Unterkategorien suchen 
    149182                                $this->readSubKat($kategorie['katID']); 
     
    156189                foreach ($this->katCache as $ID => $kategorie) { 
    157190                        if ($kategorie['topID'] == NULL) { 
    158                                 $this->katOptions[$kategorie['katID']] = "&nbsp;&nbsp;&nbsp;&nbsp;".StringUtil::unescape($kategorie['name']); 
     191                                $this->katOptions[$kategorie['katID']] = "&nbsp;&nbsp;&nbsp;&nbsp;".$kategorie['name']; 
    159192                                $this->readSubKat($kategorie['katID']); 
    160193                        }