Changeset 524
- Timestamp:
- 05/24/08 16:18:40 (5 years ago)
- Location:
- downloadDatabase
- Files:
-
- 7 modified
-
acptemplates/downloadDBDataAdd.tpl (modified) (2 diffs)
-
acptemplates/downloadDBDataList.tpl (modified) (1 diff)
-
acptemplates/downloadDBKatAdd.tpl (modified) (2 diffs)
-
acptemplates/downloadDBKatList.tpl (modified) (3 diffs)
-
files/lib/acp/form/DownloadDBDataAddForm.class.php (modified) (12 diffs)
-
files/lib/acp/form/DownloadDBKatAddForm.class.php (modified) (10 diffs)
-
files/lib/acp/form/DownloadDBKatEditForm.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
downloadDatabase/acptemplates/downloadDBDataAdd.tpl
r453 r524 1 1 {include file='header'} 2 {include file='wysiwyg'} 2 3 <div class="mainHeadline"> 3 4 <img src="{@RELATIVE_WCF_DIR}icon/downloadDBData{@$action|ucfirst}L.png" alt="" /> … … 47 48 //]]></script> 48 49 </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> 68 82 {if $action == 'edit' && $fileName != ''} 69 83 <div class="formElement" id="fileNameDiv"> -
downloadDatabase/acptemplates/downloadDBDataList.tpl
r402 r524 74 74 <img src="{@RELATIVE_WCF_DIR}icon/deleteDisabledS.png" alt="" title="{lang}wcf.acp.dldb.delete{/lang}" /> 75 75 {/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} 76 81 <a href="index.php?form=DownloadDBDataEdit&dataID={@$data.dataID}&packageID={@PACKAGE_ID}{@SID_ARG_2ND}">{lang}{$data.name}{/lang}</a> 77 82 </td> -
downloadDatabase/acptemplates/downloadDBKatAdd.tpl
r402 r524 1 1 {include file='header'} 2 {include file='wysiwyg'} 2 3 3 4 <div class="mainHeadline"> … … 41 42 </div> 42 43 </div> 43 <div class="formElement {if $errorField == 'description'} formError{/if}">44 <div class="formElement"> 44 45 <div class="formFieldLabel"> 45 <label for=" gwsOptions">{lang}wcf.acp.dldb.description{/lang}</label>46 <label for="languageID">{lang}wcf.user.language{/lang}</label> 46 47 </div> 47 48 <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> 54 54 </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>61 55 </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"} 62 74 </fieldset> 63 75 <fieldset> -
downloadDatabase/acptemplates/downloadDBKatList.tpl
r408 r524 29 29 <h3 class="subHeadline"> 30 30 <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} 31 37 32 38 {if $this->user->getPermission('admin.dldb.canEditKat')} … … 61 67 <img src="{@RELATIVE_WCF_DIR}icon/downloadDBKatS.png" alt="" title="{lang}wcf.acp.dldb.kategorie{/lang}" /> 62 68 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 63 75 {if $this->user->getPermission('admin.dldb.canEditKat')} 64 76 <select name="positions[{@$subkategorie.katID}]"> … … 94 106 <img src="{@RELATIVE_WCF_DIR}icon/downloadDBKatS.png" alt="" title="{lang}wcf.acp.dldb.kategorie{/lang}" /> 95 107 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} 96 113 {if $this->user->getPermission('admin.dldb.canEditKat')} 97 114 <select name="positions[{@$subsubkat.katID}]"> -
downloadDatabase/files/lib/acp/form/DownloadDBDataAddForm.class.php
r453 r524 1 1 <?php 2 2 // wcf imports 3 require_once(WCF_DIR.'lib/acp/form/ ACPForm.class.php');3 require_once(WCF_DIR.'lib/acp/form/WysiwygCacheloaderForm.class.php'); 4 4 require_once(WCF_DIR.'lib/data/downloadDB/DownloadDBDataEditor.class.php'); 5 5 require_once(WCF_DIR.'lib/system/io/Tar.class.php'); … … 16 16 */ 17 17 18 class DownloadDBDataAddForm extends ACPForm {18 class DownloadDBDataAddForm extends WysiwygCacheloaderForm { 19 19 public $templateName = 'downloadDBDataAdd'; 20 20 public $activeMenuItem = 'wcf.acp.menu.link.content.dldb'; … … 42 42 public $activ = 0; 43 43 public $isExtern = false; 44 public $languageID = '1'; 45 46 public $showSettings = true; 47 public $showSmilies = true; 48 public $canUseSmilies = true; 49 public $showSignatureSetting = false; 44 50 45 51 public $action; … … 55 61 56 62 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'])); 59 65 if (isset($_POST['previewIMG'])) $this->previewIMG = StringUtil::encodeHTML($_POST['previewIMG']); 60 66 if (isset($_POST['previewFile'])) $this->previewFile = StringUtil::encodeHTML($_POST['previewFile']); … … 68 74 if (isset($_POST['supportThread'])) $this->supportThread = escapeString($_POST['supportThread']); 69 75 if (isset($_POST['activ'])) $this->activ = intval($_POST['activ']); 76 if (isset($_POST['languageID'])) $this->languageID = intval($_POST['languageID']); 70 77 // for File Upload 71 78 if (isset($_FILES['upload'])) $this->upload = $_FILES['upload']; … … 196 203 $this->link = $dataset->getURL(); 197 204 // Datensatz speichern mit File 198 $dataset->updateDataset(array(205 $dataset->updateDataset(array( 199 206 'katID' => intval($this->katID), 200 207 'name' => $this->name, … … 212 219 'sortOrder' => intval($this->sortOrder), 213 220 '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))); 215 227 } 216 228 } else { … … 228 240 'sortOrder' => intval($this->sortOrder), 229 241 '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))); 231 248 // Vorschaubild anlegen und Variablen setzen 232 249 if ($this->previewArray && ($this->previewArray['error'] == 0)) { … … 244 261 $this->previewFile = $this->previewIMG = NULL; 245 262 $this->groesse = $this->downloads = $this->katID = 0; 246 $this->sortOrder = 1;263 $this->sortOrder = $this->languageID = 1; 247 264 // reset cache 248 265 WCF::getCache()->clear(WCF_DIR.'cache/', 'cache.dldbKat.php'); … … 258 275 public function readData() { 259 276 parent::readData(); 277 $this->languageID = WCF::getUser()->languageID; 260 278 // read Category Cache 261 279 WCF::getCache()->addResource('dldbKat', … … 272 290 parent::assignVariables(); 273 291 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 274 305 $maxFileSize = WCF::getUser()->getPermission('user.dldb.maxFileSize'); 306 275 307 WCF::getTPL()->assign(array( 276 308 'katOptions' => $this->katOptions, … … 296 328 'fileExtensions' => DOWNLOADDB_ALLOWED_FILE_EXT, 297 329 'maxFileSize' => $maxFileSize, 298 'isExtern' => $this->isExtern 330 'isExtern' => $this->isExtern, 331 'languageID' => $this->languageID, 332 'language' => $languageArray 299 333 )); 300 334 } -
downloadDatabase/files/lib/acp/form/DownloadDBKatAddForm.class.php
r453 r524 1 1 <?php 2 2 // wcf imports 3 require_once(WCF_DIR.'lib/acp/form/ ACPForm.class.php');3 require_once(WCF_DIR.'lib/acp/form/WysiwygCacheloaderForm.class.php'); 4 4 require_once(WCF_DIR.'lib/data/downloadDB/DownloadDBKatEditor.class.php'); 5 5 … … 14 14 */ 15 15 16 class DownloadDBKatAddForm extends ACPForm {16 class DownloadDBKatAddForm extends WysiwygCacheloaderForm { 17 17 public $templateName = 'downloadDBKatAdd'; 18 18 public $activeMenuItem = 'wcf.acp.menu.link.content.dldb'; … … 28 28 public $groupIDs = array(1); 29 29 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 31 37 public $action; 32 38 private $valid = false; … … 57 63 if (isset($_POST['sortOrder'])) $this->sortOrder = intval($_POST['sortOrder']); 58 64 if (isset($_POST['action'])) $this->action = escapeString($_POST['action']); 65 if (isset($_POST['languageID'])) $this->languageID = intval($_POST['languageID']); 59 66 } 60 67 … … 106 113 // Kategorie speichern 107 114 // 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); 109 123 } 110 124 $this->saved(); … … 120 134 public function readData() { 121 135 parent::readData(); 136 $this->languageID = WCF::getUser()->languageID; 122 137 $this->readCategorys(); 123 138 } … … 129 144 parent::assignVariables(); 130 145 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 131 159 WCF::getTPL()->assign(array( 132 160 'topID' => $this->topID, … … 138 166 'uploadGroups' => $this->uploadGroups, 139 167 '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 141 174 )); 142 175 } … … 145 178 foreach ($this->katCache as $ID => $kategorie) { 146 179 if ($kategorie['topID'] == $katID) { 147 $this->katOptions[$kategorie['katID']] = " ". StringUtil::unescape($kategorie['name']);180 $this->katOptions[$kategorie['katID']] = " ".$kategorie['name']; 148 181 // weitere Unterkategorien suchen 149 182 $this->readSubKat($kategorie['katID']); … … 156 189 foreach ($this->katCache as $ID => $kategorie) { 157 190 if ($kategorie['topID'] == NULL) { 158 $this->katOptions[$kategorie['katID']] = " ". StringUtil::unescape($kategorie['name']);191 $this->katOptions[$kategorie['katID']] = " ".$kategorie['name']; 159 192 $this->readSubKat($kategorie['katID']); 160 193 } -
downloadDatabase/files/lib/acp/form/DownloadDBKatEditForm.class.php
r453 r524 8 8 * 9 9 * @author Robert "Tatzelwurm" Hempel 10 * @copyright 2007/2008 INSIDE das H rspiel10 * @copyright 2007/2008 INSIDE das Hörspiel 11 11 * @license GNU LGPL http://www.gnu.org/licenses/lgpl.txt 12 12 * @package de.inside.wcf.downloaddb … … 42 42 $this->groupIDs = explode(",",$kategorie['groupIDs']); 43 43 $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']; 46 46 $this->topID = $kategorie['topID']; 47 47 $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']; 48 53 } 49 54 } … … 79 84 if ($this->valid && $this->katID) { 80 85 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 ); 81 93 $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); 83 95 WCF::getCache()->clear(WCF_DIR.'cache/', 'cache.dldbData.php'); 84 96 $this->saved();
