Changeset 524

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

WYSIWYG Adaption

Location:
downloadDatabase
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • downloadDatabase/acptemplates/downloadDBDataAdd.tpl

    r453 r524  
    11{include file='header'} 
     2{include file='wysiwyg'} 
    23<div class="mainHeadline"> 
    34        <img src="{@RELATIVE_WCF_DIR}icon/downloadDBData{@$action|ucfirst}L.png" alt="" /> 
     
    4748                                                //]]></script> 
    4849                                        </div> 
    49                                         <div class="formElement{if $errorField == 'description'} formError{/if}" id="descriptionDiv"> 
    50                                                 <div class="formFieldLabel"> 
    51                                                         <label for="description">{lang}wcf.acp.dldb.data.description{/lang}</label> 
    52                                                 </div> 
    53                                                 <div class="formField"> 
    54                                                         <textarea name="description" id="description" rows="5" cols="20">{$description}</textarea> 
    55                                                         {if $errorField == 'description'} 
    56                                                                 <p class="innerError"> 
    57                                                                         {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if} 
    58                                                                 </p> 
    59                                                         {/if} 
    60                                                 </div> 
    61                                                 <div class="formFieldDesc hidden" id="descriptionHelpMessage"> 
    62                                                         <p>{lang}wcf.acp.dldb.data.description.description{/lang}</p> 
    63                                                 </div> 
    64                                                 <script type="text/javascript">//<![CDATA[ 
    65                                                         inlineHelp.register('description'); 
    66                                                 //]]></script> 
    67                                         </div> 
     50                                <div class="formElement"> 
     51                                        <div class="formFieldLabel"> 
     52                                                <label for="languageID">{lang}wcf.user.language{/lang}</label> 
     53                                        </div> 
     54                                        <div class="formField"> 
     55                                                <select name="languageID"> 
     56                                                        {foreach from=$language item=item} 
     57                                                                <option value="{$item.languageID}" {if $item.languageID == $languageID}selected{/if}>{@$item.languageName}</option> 
     58                                                        {/foreach} 
     59                                                </select> 
     60                                        </div> 
     61                                </div> 
     62                                </fieldset> 
     63                                <fieldset> 
     64                                        <legend>{lang}wcf.acp.dldb.data.description{/lang}</legend> 
     65                                        <textarea name="description" id="text" rows="5" cols="20">{$description}</textarea> 
     66                                        {if $errorField == 'description'} 
     67                                                <p class="innerError"> 
     68                                                        {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if} 
     69                                                        {if $errorType == 'tooLong'}{lang}wcf.message.error.tooLong{/lang}{/if} 
     70                                                        {if $errorType == 'censoredWordsFound'}{lang}wcf.message.error.censoredWordsFound{/lang}{/if} 
     71                                                </p> 
     72                                        {/if} 
     73                                        <div class="formFieldDesc hidden" id="descriptionHelpMessage""> 
     74                                                <p>{lang}wcf.acp.dldb.data.description.description{/lang}</p> 
     75                                        </div> 
     76                                        <script type="text/javascript">//<![CDATA[ 
     77                                                inlineHelp.register('description'); 
     78                                        //]]></script> 
     79                                        {include file="messageFormTabs"} 
     80                                </fieldset> 
     81                                <fieldset> 
    6882                                        {if $action == 'edit' && $fileName != ''} 
    6983                                                <div class="formElement" id="fileNameDiv"> 
  • downloadDatabase/acptemplates/downloadDBDataList.tpl

    r402 r524  
    7474                                                        <img src="{@RELATIVE_WCF_DIR}icon/deleteDisabledS.png" alt="" title="{lang}wcf.acp.dldb.delete{/lang}" /> 
    7575                                                {/if} 
     76                                                {foreach from=$languageArray item=item} 
     77                                                        {if $data.languageID == $item.languageID} 
     78                                                                <img src="{RELATIVE_WCF_DIR}icon/language{$item.languageCode}S.png" /> 
     79                                                        {/if} 
     80                                                {/foreach} 
    7681                                                <a href="index.php?form=DownloadDBDataEdit&amp;dataID={@$data.dataID}&amp;packageID={@PACKAGE_ID}{@SID_ARG_2ND}">{lang}{$data.name}{/lang}</a> 
    7782                                        </td> 
  • downloadDatabase/acptemplates/downloadDBKatAdd.tpl

    r402 r524  
    11{include file='header'} 
     2{include file='wysiwyg'} 
    23 
    34<div class="mainHeadline"> 
     
    4142                                        </div> 
    4243                                </div> 
    43                                 <div class="formElement{if $errorField == 'description'} formError{/if}"> 
     44                                <div class="formElement"> 
    4445                                        <div class="formFieldLabel"> 
    45                                                 <label for="gwsOptions">{lang}wcf.acp.dldb.description{/lang}</label> 
     46                                                <label for="languageID">{lang}wcf.user.language{/lang}</label> 
    4647                                        </div> 
    4748                                        <div class="formField"> 
    48                                                 <textarea name="description" id="description" rows="5" cols="20">{$description}</textarea> 
    49                                                 {if $errorField == 'description'} 
    50                                                         <p class="innerError"> 
    51                                                                 {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if} 
    52                                                         </p> 
    53                                                 {/if} 
     49                                                <select name="languageID"> 
     50                                                        {foreach from=$language item=item} 
     51                                                                <option value="{$item.languageID}" {if $item.languageID == $languageID}selected{/if}>{@$item.languageName}</option> 
     52                                                        {/foreach} 
     53                                                </select> 
    5454                                        </div> 
    55                                         <div class="formFieldDesc hidden" id="descriptionHelpMessage""> 
    56                                                 <p>{lang}wcf.acp.dldb.description.description{/lang}</p> 
    57                                         </div> 
    58                                         <script type="text/javascript">//<![CDATA[ 
    59                                                 inlineHelp.register('description'); 
    60                                         //]]></script> 
    6155                                </div> 
     56                        </fieldset> 
     57                        <fieldset> 
     58                                <legend>{lang}wcf.acp.dldb.description{/lang}</legend> 
     59                                <textarea name="description" id="text" rows="5" cols="20">{$description}</textarea> 
     60                                {if $errorField == 'description'} 
     61                                        <p class="innerError"> 
     62                                                {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if} 
     63                                                {if $errorType == 'tooLong'}{lang}wcf.message.error.tooLong{/lang}{/if} 
     64                                                {if $errorType == 'censoredWordsFound'}{lang}wcf.message.error.censoredWordsFound{/lang}{/if} 
     65                                        </p> 
     66                                {/if} 
     67                                <div class="formFieldDesc hidden" id="descriptionHelpMessage""> 
     68                                        <p>{lang}wcf.acp.dldb.description.description{/lang}</p> 
     69                                </div> 
     70                                <script type="text/javascript">//<![CDATA[ 
     71                                        inlineHelp.register('description'); 
     72                                //]]></script> 
     73                                {include file="messageFormTabs"} 
    6274                        </fieldset> 
    6375                        <fieldset> 
  • downloadDatabase/acptemplates/downloadDBKatList.tpl

    r408 r524  
    2929                                                        <h3 class="subHeadline"> 
    3030                                                                <img src="{@RELATIVE_WCF_DIR}icon/downloadDBKatS.png" alt="" title="{lang}wcf.acp.dldb.kat.kategorie{/lang}" /> 
     31 
     32                                                                {foreach from=$languageArray item=item} 
     33                                                                        {if $kategorie.languageID == $item.languageID} 
     34                                                                                <img src="{RELATIVE_WCF_DIR}icon/language{$item.languageCode}S.png" /> 
     35                                                                        {/if} 
     36                                                                {/foreach} 
    3137 
    3238                                                                {if $this->user->getPermission('admin.dldb.canEditKat')} 
     
    6167                                                                                                        <img src="{@RELATIVE_WCF_DIR}icon/downloadDBKatS.png" alt="" title="{lang}wcf.acp.dldb.kategorie{/lang}" /> 
    6268                                                                                                                 
     69                                                                                                        {foreach from=$languageArray item=item} 
     70                                                                                                                {if $subkategorie.languageID == $item.languageID} 
     71                                                                                                                        <img src="{RELATIVE_WCF_DIR}icon/language{$item.languageCode}S.png" /> 
     72                                                                                                                {/if} 
     73                                                                                                        {/foreach} 
     74 
    6375                                                                                                        {if $this->user->getPermission('admin.dldb.canEditKat')} 
    6476                                                                                                                <select name="positions[{@$subkategorie.katID}]"> 
     
    94106                                                                                                                        <img src="{@RELATIVE_WCF_DIR}icon/downloadDBKatS.png" alt="" title="{lang}wcf.acp.dldb.kategorie{/lang}" /> 
    95107                                                                                                                                 
     108                                                                                                                        {foreach from=$languageArray item=item} 
     109                                                                                                                                {if $subsubkat.languageID == $item.languageID} 
     110                                                                                                                                        <img src="{RELATIVE_WCF_DIR}icon/language{$item.languageCode}S.png" /> 
     111                                                                                                                                {/if} 
     112                                                                                                                        {/foreach} 
    96113                                                                                                                        {if $this->user->getPermission('admin.dldb.canEditKat')} 
    97114                                                                                                                                <select name="positions[{@$subsubkat.katID}]"> 
  • downloadDatabase/files/lib/acp/form/DownloadDBDataAddForm.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/DownloadDBDataEditor.class.php'); 
    55require_once(WCF_DIR.'lib/system/io/Tar.class.php'); 
     
    1616 */ 
    1717 
    18 class DownloadDBDataAddForm extends ACPForm { 
     18class DownloadDBDataAddForm extends WysiwygCacheloaderForm { 
    1919        public $templateName = 'downloadDBDataAdd'; 
    2020        public $activeMenuItem = 'wcf.acp.menu.link.content.dldb'; 
     
    4242        public $activ = 0; 
    4343        public $isExtern = false; 
     44        public $languageID = '1'; 
     45         
     46        public $showSettings = true; 
     47        public $showSmilies = true; 
     48        public $canUseSmilies = true; 
     49        public $showSignatureSetting = false; 
    4450         
    4551        public $action; 
     
    5561                                 
    5662                if (isset($_POST['katID']))                     $this->katID            = intval($_REQUEST['katID']); 
    57                 if (isset($_POST['name']))                      $this->name                     = escapeString($_REQUEST['name']); 
    58                 if (isset($_POST['description']))       $this->description      = escapeString($_POST['description']); 
     63                if (isset($_POST['name']))                      $this->name                     = escapeString(StringUtil::trim($_REQUEST['name'])); 
     64                if (isset($_POST['description']))       $this->description      = escapeString(StringUtil::trim($_POST['description'])); 
    5965                if (isset($_POST['previewIMG']))        $this->previewIMG       = StringUtil::encodeHTML($_POST['previewIMG']); 
    6066                if (isset($_POST['previewFile']))       $this->previewFile      = StringUtil::encodeHTML($_POST['previewFile']); 
     
    6874                if (isset($_POST['supportThread']))     $this->supportThread = escapeString($_POST['supportThread']); 
    6975                if (isset($_POST['activ']))                     $this->activ            = intval($_POST['activ']); 
     76                if (isset($_POST['languageID']))        $this->languageID       = intval($_POST['languageID']); 
    7077                // for File Upload 
    7178                if (isset($_FILES['upload']))           $this->upload           = $_FILES['upload']; 
     
    196203                                        $this->link = $dataset->getURL(); 
    197204                                        // Datensatz speichern  mit File 
    198                                         $dataset->updateDataset(array( 
     205                                        $dataset->updateDataset(array( 
    199206                                                        'katID'                 => intval($this->katID), 
    200207                                                        'name'                  => $this->name, 
     
    212219                                                        'sortOrder'             => intval($this->sortOrder), 
    213220                                                        'thread'                => $this->supportThread, 
    214                                                         'activ'                 => true)); 
     221                                                        'activ'                 => true, 
     222                                                        'parseURL'              => intval($this->parseURL), 
     223                                                        'enableBBCodes' => intval($this->enableBBCodes), 
     224                                                        'enableHtml'    => intval($this->enableHtml), 
     225                                                        'enableSmilies' => intval($this->enableSmilies), 
     226                                                        'languageID'    => intval($this->languageID))); 
    215227                                } 
    216228                        } else { 
     
    228240                                                        'sortOrder'             => intval($this->sortOrder), 
    229241                                                        'thread'                => $this->supportThread, 
    230                                                         'activ'                 => true)); 
     242                                                        'activ'                 => true, 
     243                                                        'parseURL'              => intval($this->parseURL), 
     244                                                        'enableBBCodes' => intval($this->enableBBCodes), 
     245                                                        'enableHtml'    => intval($this->enableHtml), 
     246                                                        'enableSmilies' => intval($this->enableSmilies), 
     247                                                        'languageID'    => intval($this->languageID))); 
    231248                                // Vorschaubild anlegen und Variablen setzen 
    232249                                if ($this->previewArray && ($this->previewArray['error'] == 0)) { 
     
    244261                $this->previewFile = $this->previewIMG = NULL; 
    245262                $this->groesse = $this->downloads = $this->katID = 0; 
    246                 $this->sortOrder = 1; 
     263                $this->sortOrder = $this->languageID = 1; 
    247264                // reset cache 
    248265                WCF::getCache()->clear(WCF_DIR.'cache/', 'cache.dldbKat.php'); 
     
    258275        public function readData() { 
    259276                parent::readData(); 
     277                $this->languageID = WCF::getUser()->languageID; 
    260278                // read Category Cache 
    261279                WCF::getCache()->addResource('dldbKat', 
     
    272290                parent::assignVariables(); 
    273291 
     292                WCFACP::getMenu()->setActiveMenuItem($this->activeMenuItem); 
     293                 
     294                $languagesArray = WCF::getLanguage()->getAvailableLanguages(); 
     295                         
     296                for ($i = 0; $i < count($languagesArray); $i++) { 
     297                        $languageItems = $languagesArray[$i]; 
     298                                 
     299                        $languageArray[] = array( 
     300                                        'languageID' => $languageItems['languageID'], 
     301                                        'languageName' => WCF::getLanguage()->get('wcf.global.language.'.$languageItems['languageCode']), 
     302                        ); 
     303                } 
     304                 
    274305                $maxFileSize = WCF::getUser()->getPermission('user.dldb.maxFileSize'); 
     306                 
    275307                WCF::getTPL()->assign(array( 
    276308                        'katOptions'    => $this->katOptions, 
     
    296328                        'fileExtensions' => DOWNLOADDB_ALLOWED_FILE_EXT, 
    297329                        'maxFileSize'   => $maxFileSize, 
    298                         'isExtern'              => $this->isExtern 
     330                        'isExtern'              => $this->isExtern, 
     331                        'languageID'    => $this->languageID, 
     332                        'language'              => $languageArray 
    299333                )); 
    300334        } 
  • 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                        }  
  • downloadDatabase/files/lib/acp/form/DownloadDBKatEditForm.class.php

    r453 r524  
    88 *  
    99 * @author              Robert "Tatzelwurm" Hempel 
    10  * @copyright   2007/2008 INSIDE das Hrspiel 
     10 * @copyright   2007/2008 INSIDE das Hörspiel 
    1111 * @license     GNU LGPL http://www.gnu.org/licenses/lgpl.txt 
    1212 * @package             de.inside.wcf.downloaddb 
     
    4242                                        $this->groupIDs         = explode(",",$kategorie['groupIDs']); 
    4343                                        $this->uploadGroups = explode(",",$kategorie['uploadGroups']); 
    44                                         $this->name                     = StringUtil::unescape($kategorie['name']); 
    45                                         $this->description      = StringUtil::unescape($kategorie['description']); 
     44                                        $this->name                     = $kategorie['name']; 
     45                                        $this->description      = $kategorie['description']; 
    4646                                        $this->topID            = $kategorie['topID']; 
    4747                                        $this->sortOrder        = $kategorie['sortOrder']; 
     48                                        $this->parseURL         = $kategorie['parseURL']; 
     49                                        $this->enableSmilies = $kategorie['enableSmilies']; 
     50                                        $this->enableHtml       = $kategorie['enableHtml']; 
     51                                        $this->enableBBCodes = $kategorie['enableBBCodes']; 
     52                                        $this->languageID       = $kategorie['languageID']; 
    4853                                }  
    4954                        } 
     
    7984                if ($this->valid && $this->katID) { 
    8085                        if ($this->topID == 0) $this->topID = "NULL"; 
     86                        $moreData = array( 
     87                                'parseURL'              => intval($this->parseURL), 
     88                                'enableBBCodes' => intval($this->enableBBCodes), 
     89                                'enableHtml'    => intval($this->enableHtml), 
     90                                'enableSmilies' => intval($this->enableSmilies), 
     91                                'languageID'    => intval($this->languageID) 
     92                        ); 
    8193                        $category = new DownloadDBKatEditor($this->katID); 
    82                         $category->updateCategory(intval($this->topID),escapeString($this->name),escapeString($this->description),$this->groupIDs,$this->uploadGroups,intval($this->sortOrder)); 
     94                        $category->updateCategory(intval($this->topID),$this->name,$this->description,$this->groupIDs,$this->uploadGroups,intval($this->sortOrder),$moreData); 
    8395                        WCF::getCache()->clear(WCF_DIR.'cache/', 'cache.dldbData.php'); 
    8496                        $this->saved();