/**
     * Output the Article config screen
     */
    function pmxc_ShowAdmArticleConfig()
    {
        global $context, $settings, $modSettings, $boarddir, $options, $txt;
        echo '
				<tr>
					<td>
						<div class="windowbg">
						<table class="pmx_table">
							<tr>
								<td style="width:50%;padding:4px;">
									<input type="hidden" name="id" value="' . $this->cfg['id'] . '" />
									<input type="hidden" name="owner" value="' . $this->cfg['owner'] . '" />
									<input type="hidden" name="contenttype" value="' . $this->cfg['ctype'] . '" />
									<input type="hidden" name="config[settings]" value="" />
									<input type="hidden" name="active" value="' . $this->cfg['active'] . '" />
									<input type="hidden" name="approved" value="' . $this->cfg['approved'] . '" />
									<input type="hidden" name="approvedby" value="' . $this->cfg['approvedby'] . '" />
									<input type="hidden" name="created" value="' . $this->cfg['created'] . '" />
									<input type="hidden" name="updated" value="' . $this->cfg['updated'] . '" />
									<input type="hidden" name="updatedby" value="' . $this->cfg['updatedby'] . '" />
									<input type="hidden" name="check_num_vars[]" value="[config][maxheight], \'\'" />
									<div style="height:61px;">
										<div style="float:left;width:100px; padding-top:1px;">' . $txt['pmx_article_title'] . '</div>';
        // all titles depend on language
        $curlang = '';
        foreach ($context['pmx']['languages'] as $lang => $sel) {
            $curlang = !empty($sel) ? $lang : $curlang;
            echo '
										<span id="' . $lang . '" style="white-space:nowrap;' . (!empty($sel) ? '' : ' display:none;') . '">
											<input style="width:65%;" type="text" name="config[title][' . $lang . ']" value="' . (isset($this->cfg['config']['title'][$lang]) ? htmlspecialchars($this->cfg['config']['title'][$lang], ENT_QUOTES) : '') . '" />
										</span>';
        }
        echo '
										<input id="curlang" type="hidden" value="' . $curlang . '" />
										<div style="clear:both; height:10px;">
											<img style="float:left;" src="' . $context['pmx_imageurl'] . 'arrow_down.gif" alt="*" title="" />
										</div>
										<div style="float:left; width:100px;">' . $txt['pmx_edit_title_lang'] . '
											<img class="info_toggle" onclick=\'Show_help("pmxBH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
										</div>
										<select style="float:left; width:165px;" size="1" onchange="setTitleLang(this)">';
        foreach ($context['pmx']['languages'] as $lang => $sel) {
            echo '
											<option value="' . $lang . '"' . (!empty($sel) ? ' selected="selected"' : '') . '>' . $lang . '</option>';
        }
        echo '
										</select>
										<div style="margin-left:280px;">
											<span style="vertical-align:6px;">' . $txt['pmx_edit_title_align'] . '</span>';
        // title align
        if (!isset($this->cfg['config']['title_align'])) {
            $this->cfg['config']['title_align'] = 'left';
        }
        echo '
											<input type="hidden" id="titlealign" name="config[title_align]" value="' . $this->cfg['config']['title_align'] . '" />';
        foreach ($txt['pmx_edit_title_align_types'] as $key => $val) {
            echo '
											<img id="img' . $key . '" src="' . $context['pmx_imageurl'] . 'text_align_' . $key . '.gif" alt="*" title="' . $txt['pmx_edit_title_helpalign'] . $val . '" style="cursor:pointer;vertical-align:1px;' . ($this->cfg['config']['title_align'] == $key ? 'background-color:#e02000;' : '') . '" onclick="setAlign(\'\', \'' . $key . '\')" />';
        }
        echo '
										</div>
									</div>
									<div id="pmxBH01" style="margin-top:4px;" class="info_frame">' . $txt['pmx_edit_titlehelp'] . '
									</div>';
        // Title icons
        $this->cfg['config']['title_icon'] = empty($this->cfg['config']['title_icon']) || $this->cfg['config']['title_icon'] == 'none.gif' ? 'none.png' : $this->cfg['config']['title_icon'];
        echo '
									<div style="float:left;height:40px;">
										<div style="float:left;width:100px; padding-top:8px;">' . $txt['pmx_edit_titleicon'] . '</div>
										<div class="ttliconDiv" onclick="setNewIcon(document.getElementById(\'pWind.icon_sel\'), event)">
											<input id="post_image" type="hidden" name="config[title_icon]" value="' . $this->cfg['config']['title_icon'] . '" />
											<input id="iconDD" value="' . ucfirst(str_replace('.png', '', $this->cfg['config']['title_icon'])) . '" readonly />
											<img id="pWind.icon" class="pwindiconBlk" src="' . $context['pmx_Iconsurl'] . $this->cfg['config']['title_icon'] . '" alt="*" />
											<img class="ddImageBlk" src="' . $context['pmx_imageurl'] . 'state_expanded.png" alt="*" title="" />
										</div>
										<ul class="ttlicondd Artedit" id="pWind.icon_sel" onclick="updIcon(this)">';
        foreach ($this->title_icons as $file => $name) {
            echo '
											<li id="' . $file . '" class="ttlicon' . ($this->cfg['config']['title_icon'] == $file ? ' active' : '') . '">
												<img src="' . $context['pmx_Iconsurl'] . $file . '" alt="*" /><span>' . $name . '</span>
											</li>';
        }
        echo '
										</ul>
										<script>$("li").hover(function(){$(this).toggleClass("active")});</script>
									</div>';
        // show article types
        echo '
								</td>
								<td style="padding:4px;">
									<div style="float:left;width:130px;">' . $txt['pmx_article_type'] . '</div>';
        $RegBlocks = $context['pmx']['RegBlocks'];
        foreach ($RegBlocks as $key => $val) {
            if (!in_array($key, array('html', 'script', 'bbc_script', 'php'))) {
                unset($RegBlocks[$key]);
            }
        }
        function cmpBDesc($a, $b)
        {
            return strcasecmp(str_replace(' ', '', $a["description"]), str_replace(' ', '', $b["description"]));
        }
        uasort($RegBlocks, 'cmpBDesc');
        if (allowPmx('pmx_admin, pmx_create')) {
            echo '
									<select style="width:60%;" size="1" name="ctype" onchange="FormFunc(\'edit_change\', \'1\')">';
            foreach ($RegBlocks as $type => $articleType) {
                echo '
										<option value="' . $type . '"' . ($this->cfg['ctype'] == $type ? ' selected="selected"' : '') . '>' . $articleType['description'] . '</option>';
            }
            echo '
									</select>';
        } else {
            echo '
									<input type="hidden" name="ctype" value="' . $this->cfg['ctype'] . '" />
									<input style="width:60%;" value="' . $RegBlocks[$this->cfg['ctype']]['description'] . '" disabled="disabled" />';
        }
        // all exist categories
        $selcats = array_merge(array(PortaMx_getDefaultCategory($txt['pmx_categories_none'])), $this->categories);
        $ordercats = array_merge(array(0), $context['pmx']['catorder']);
        $isWriter = allowPmx('pmx_create, pmx_articles', true);
        $isAdm = allowPmx('pmx_admin');
        echo '
										<div style="float:left;width:130px;margin-top:9px;">' . $txt['pmx_article_cats'] . '</div>
										<select style="width:60%;margin-top:9px;" size="1" name="catid">';
        foreach ($ordercats as $catorder) {
            $cat = PortaMx_getCatByOrder($selcats, $catorder);
            $cfg = unserialize($cat['config']);
            if (!empty($isAdm) || !empty($isWriter) && empty($cfg['global'])) {
                echo '
											<option value="' . $cat['id'] . '"' . ($cat['id'] == $this->cfg['catid'] ? ' selected="selected"' : '') . '">' . str_repeat('&bull;', $cat['level']) . ' ' . $cat['name'] . '</option>';
            }
        }
        echo '
										</select>
									</div>';
        // articlename
        echo '
									<div style="float:left;width:130px;margin-top:9px">' . $txt['pmx_article_name'] . '
										<img class="info_toggle" onclick=\'Show_help("pmxBH11")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
									</div>
									<input id="check.name" style="width:60%;margin-top:9px" onkeyup="check_requestname(this)" onkeypress="check_requestname(this)" type="text" name="name" value="' . $this->cfg['name'] . '" />
									<span id="check.name.error" style="display:none;">' . sprintf($txt['namefielderror'], $txt['pmx_article_name']) . '</span>
									<div id="pmxBH11" class="info_frame" style="margin-top:5px;">' . $txt['pmx_edit_pagenamehelp'] . '
									</div>
								</td>
							</tr>';
        // the editor area dependent on article type
        echo '
							<tr>
								<td colspan="2" style="padding:4px 4px 10px 4px;">';
        // show the editor
        if ($this->cfg['ctype'] == 'html') {
            $allow = allowPmx('pmx_admin') || allowPmx('pmx_blocks');
            $fnd = explode('/', str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']));
            $smfpath = str_replace('\\', '/', $boarddir);
            foreach ($fnd as $key => $val) {
                $fnd[$key] = $val;
                $rep[] = '';
            }
            $filepath = trim(str_replace($fnd, $rep, $smfpath), '/') . '/CustomImages';
            if (count($fnd) == count(explode('/', $smfpath))) {
                $filepath = '/' . $filepath;
            }
            $_SESSION['pmx_ckfm'] = array('ALLOW' => $allow, 'FILEPATH' => $filepath);
            echo '
								<div class="cat_bar catbg_grid">
									<h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4>
								</div>
								<textarea name="' . $context['pmx']['htmledit']['id'] . '">' . $context['pmx']['htmledit']['content'] . '</textarea>
								<script type="text/javascript">
									CKEDITOR.replace("' . $context['pmx']['htmledit']['id'] . '", {filebrowserBrowseUrl: "ckeditor/fileman/index.php"});
								</script>';
        } elseif ($this->cfg['ctype'] == 'bbc_script') {
            echo '
								<style type="text/css">
									.sceditor-container iframe{width:99.1% !important;}
									.sceditor-container{max-width:inherit;width:inherit !important; margin-right:-2px;}
									textarea{max-width:99% !important;width:99.2% !important;}
								</style>
								<div class="cat_bar catbg_grid" style="margin-right:1px;">
									<h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4>
								</div>
								<input type="hidden" id="smileyset" value="PortaMx" />
								<div id="bbcBox_message"></div>
								<div id="smileyBox_message"></div>
								<div style="padding-right:3px;margin-top:-10px;">', template_control_richedit($context['pmx']['editorID'], 'smileyBox_message', 'bbcBox_message'), '</div>';
        } elseif ($this->cfg['ctype'] == 'php') {
            $options['collapse_phpinit'] = empty($context['pmx']['phpInit']['havecont']);
            echo '
								<div class="cat_bar catbg_grid">
									<h4 class="catbg catbg_grid">
										<span style="float:right;display:block;margin-top:-2px;">
											<img onclick="php_syntax(\'' . $context['pmx']['phpShow']['id'] . '\')" style="padding:3px 5px 3px 10px;cursor:pointer;" alt="Syntax check" title="' . $txt['pmx_check_phpsyntax'] . '" src="' . $context['pmx_imageurl'] . 'syntaxcheck.png" class="pmxright" />
										</span>
										<span class="cat_left_title">' . $txt['pmx_edit_content'] . '
										<span id="upshrinkPHPinitCont"' . (empty($options['collapse_phpinit']) ? '' : ' style="display:none;"') . '>' . $txt['pmx_edit_content_show'] . '</span></span>
									</h4>
								</div>

								<div id="check_' . $context['pmx']['phpShow']['id'] . '" class="info_frame" style="line-height:1.4em;margin:1px 0;"></div>

								<textarea name="' . $context['pmx']['phpShow']['id'] . '" id="' . $context['pmx']['phpShow']['id'] . '" style="display:block;resize:vertical;width:' . $context['pmx']['phpShow']['width'] . ';height:' . $context['pmx']['phpShow']['height'] . ';">' . $context['pmx']['phpShow']['value'] . '</textarea>

								<div class="plainbox info_text" style="margin-top:5px;margin-right:0px;padding:5px 0 7px 0;display:block;">
									<div class="normaltext" style="margin:0 10px;">
									' . (empty($context['pmx']['phpInit']['havecont']) ? '<span style="margin-top:2px;margin-right:-4px;" id="upshrinkPHPshowImg" class="floatright ' . (empty($options['collapse_visual']) ? 'toggle_up" align="bottom"' : 'toggle_down" align="bottom"') . ' title="' . (empty($options['collapse_visual']) ? $txt['pmx_collapse'] : $txt['pmx_expand']) . $txt['pmx_php_partblock'] . '">
										</span>' : '') . '
										<span>' . $txt['pmx_php_partblock_note'] . '
											<img class="info_toggle" onclick=\'Toggle_help("pmxPHPH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" style="vertical-align: -3px;" />
										</span>
									</div>
									<div id="pmxPHPH01" style="display:none; margin:4px 10px 0;">' . $txt['pmx_php_partblock_help'] . '</div>
								</div>

								<div id="upshrinkPHPshowCont"' . (empty($options['collapse_phpinit']) ? '' : ' style="margin-top:5px;display:none;"') . '>
									<div class="cat_bar catbg_grid">
										<h4 class="catbg catbg_grid">
											<span style="float:right;display:block;margin-top:-2px;">
												<img onclick="php_syntax(\'' . $context['pmx']['phpInit']['id'] . '\')" style="padding:3px 5px 3px 10px;cursor:pointer;" title="' . $txt['pmx_check_phpsyntax'] . '" alt="Syntax check" src="' . $context['pmx_imageurl'] . 'syntaxcheck.png" class="pmxright" />
											</span>
											<span class="cat_left_title">' . $txt['pmx_edit_content'] . $txt['pmx_edit_content_init'] . '</span>
										</h4>
									</div>
									<div id="check_' . $context['pmx']['phpInit']['id'] . '" class="info_frame" style="line-height:1.4em;margin:1px 0;"></div>

									<textarea name="' . $context['pmx']['phpInit']['id'] . '" id="' . $context['pmx']['phpInit']['id'] . '" style="display:block;width:' . $context['pmx']['phpInit']['width'] . ';height:' . $context['pmx']['phpInit']['height'] . ';">' . $context['pmx']['phpInit']['value'] . '</textarea>
								</div>';
            if (empty($context['pmx']['phpInit']['havecont'])) {
                addInlineJavascript("\t" . str_replace("\n", "\n\t", PortaMx_compressJS('
						var upshrinkPHPshow = new smc_Toggle({
							bToggleEnabled: true,
							bCurrentlyCollapsed: ' . (empty($options['collapse_phpinit']) ? 'false' : 'true') . ',
							aSwappableContainers: [
								\'upshrinkPHPshowCont\',
								\'upshrinkPHPinitCont\'
							],
							aSwapImages: [
								{
									sId: \'upshrinkPHPshowImg\',
									altCollapsed: ' . JavaScriptEscape($txt['pmx_expand'] . $txt['pmx_php_partblock']) . ',
									altExpanded: ' . JavaScriptEscape($txt['pmx_collapse'] . $txt['pmx_php_partblock']) . '
								}
							],
							oCookieOptions: {
									bUseCookie: false
								}
						});')), true);
            }
        } else {
            echo '
									<div class="cat_bar catbg_grid">
										<h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_content'] . '</span></h4>
									</div>
									<textarea name="' . $context['pmx']['script']['id'] . '" id="' . $context['pmx']['script']['id'] . '" style="display:block;width:' . $context['pmx']['script']['width'] . ';height:' . $context['pmx']['script']['height'] . ';">' . $context['pmx']['script']['value'] . '</textarea>';
        }
        echo '
								</td>
							</tr>
							<tr>
								<td style="padding:4px;">
									<div style="min-height:182px;">
										<input type="hidden" name="config[settings]" value="" />';
        // show the settings area
        echo '
										<div class="cat_bar catbg_grid grid_padd">
											<h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_articles_types'][$this->cfg['ctype']] . ' ' . $txt['pmx_article_settings_title'] . '</span></h4>
										</div>
										<div>';
        if ($this->cfg['ctype'] == 'html') {
            echo '
											<div class="adm_check">
												<span class="adm_w80">' . $txt['pmx_html_teaser'] . '
													<img class="info_toggle" onclick=\'Show_help("pmxHTMLH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
												</span>
												<input type="hidden" name="config[settings][teaser]" value="0" />
												<div><input class="input_check" type="checkbox" name="config[settings][teaser]" value="1"' . (isset($this->cfg['config']['settings']['teaser']) && !empty($this->cfg['config']['settings']['teaser']) ? ' checked="checked"' : '') . ' /></div>
											</div>
											<div id="pmxHTMLH01" class="info_frame" style="margin-top:4px;">' . str_replace('@@', '<img src="' . $context['pmx_imageurl'] . 'pgbreak.png" alt="*" style="vertical-align:-5px;"/>', $txt['pmx_html_teasehelp']) . '</div>';
        } elseif ($this->cfg['ctype'] != 'php') {
            echo '
											<div class="adm_check">
												<span class="adm_w80">' . sprintf($txt['pmx_article_teaser'], $txt['pmx_teasemode'][intval(!empty($context['pmx']['settings']['teasermode']))]) . '
													<img class="info_toggle" onclick=\'Show_help("pmxHTMLH02")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
												</span>
												<div><input type="text" size="5" name="config[settings][teaser]" value="' . (isset($this->cfg['config']['settings']['teaser']) ? $this->cfg['config']['settings']['teaser'] : '') . '" /></div>
											</div>
											<div id="pmxHTMLH02" class="info_frame" style="margin-top:4px;">' . $txt['pmx_article_teasehelp'] . '</div>';
        }
        echo '
											<div class="adm_check">
												<span class="adm_w80">' . $txt['pmx_content_print'] . '</span>
												<input type="hidden" name="config[settings][printing]" value="0" />
												<div><input class="input_check" type="checkbox" name="config[settings][printing]" value="1"' . (!empty($this->cfg['config']['settings']['printing']) ? ' checked="checked"' : '') . ' /></div>
											</div>

											<div class="adm_check">
												<span class="adm_w80">' . $txt['pmx_article_footer'] . '
													<img class="info_toggle" onclick=\'Show_help("pmxARTH01")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
												</span>
												<input type="hidden" name="config[settings][showfooter]" value="0" />
												<div><input class="input_check" type="checkbox" name="config[settings][showfooter]" value="1"' . (isset($this->cfg['config']['settings']['showfooter']) && !empty($this->cfg['config']['settings']['showfooter']) ? ' checked="checked"' : '') . ' /></div>
											</div>
											<div id="pmxARTH01" class="info_frame" style="margin-top:4px;">' . $txt['pmx_article_footerhelp'] . '</div>
											<input type="hidden" name="config[show_sitemap]" value="0" />';
        if ($this->cfg['ctype'] != 'php') {
            echo '
											<div class="adm_check">
												<span class="adm_w80">' . $txt['pmx_articles_disableHSimage'] . '</span>
												<input type="hidden" name="config[settings][disableHSimg]" value="0" />
												<div><input class="input_check" type="checkbox" name="config[settings][disableHSimg]" value="1"' . (isset($this->cfg['config']['settings']['disableHSimg']) && !empty($this->cfg['config']['settings']['disableHSimg']) ? ' checked="checked"' : '') . (!empty($context['pmx']['settings']['disableHS']) ? ' disabled="disabled"' : '') . ' /></div>
											</div>';
        }
        echo '
										</div>
									</div>';
        // the group access
        echo '
									<div class="cat_bar catbg_grid grid_padd grid_top">
										<h4 class="catbg catbg_grid">
											<img class="grid_click_image pmxleft" onclick=\'Show_help("pmxBH03")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
											<span class="cat_msg_title">' . $txt['pmx_article_groups'] . '</span>
										</h4>
									</div>
									<select id="pmxgroups" onchange="changed(\'pmxgroups\');" style="width:83%;" name="acsgrp[]" multiple="multiple" size="5">';
        if (!empty($this->cfg['acsgrp'])) {
            list($grpacs, $denyacs) = Pmx_StrToArray($this->cfg['acsgrp'], ',', '=');
        } else {
            $grpacs = $denyacs = array();
        }
        foreach ($this->smf_groups as $grp) {
            echo '
										<option value="' . $grp['id'] . '=' . intval(!in_array($grp['id'], $denyacs)) . '"' . (in_array($grp['id'], $grpacs) ? ' selected="selected"' : '') . '>' . (in_array($grp['id'], $denyacs) ? '^' : '') . $grp['name'] . '</option>';
        }
        echo '
									</select>
									<div id="pmxBH03" class="info_frame">' . $txt['pmx_article_groupshelp'] . '</div>
									<script type="text/javascript">
										var pmxgroups = new MultiSelect("pmxgroups");
									</script>';
        // article moderate
        if (!isset($this->cfg['config']['can_moderate'])) {
            $this->cfg['config']['can_moderate'] = 1;
        }
        if (allowPmx('pmx_articles, pmx_create', true)) {
            echo '
									<input type="hidden" name="config[can_moderate]" value="' . $this->cfg['config']['can_moderate'] . '" />';
        }
        if (allowPmx('pmx_admin, pmx_articles, pmx_create')) {
            echo '
									<div class="cat_bar catbg_grid grid_padd grid_top">
										<h4 class="catbg catbg_grid">
											<span class="cat_msg_title">' . $txt['pmx_article_moderate_title'] . '</span>
										</h4>
									</div>';
        }
        if (allowPmx('pmx_admin')) {
            echo '
									<div class="adm_check">
										<span class="adm_w80">' . $txt['pmx_article_moderate'] . '
										</span>
										<input type="hidden" name="config[can_moderate]" value="0" />
										<div><input class="input_check" type="checkbox" name="config[can_moderate]" value="1"' . (!empty($this->cfg['config']['can_moderate']) ? ' checked="checked"' : '') . ' /></div>
									</div>';
        }
        echo '
									<input type="hidden" name="config[check_ecl]" value="0" />
									<input type="hidden" name="config[check_eclbots]" value="0" />';
        if (allowPmx('pmx_admin, pmx_articles, pmx_create') && !empty($modSettings['pmx_ecl'])) {
            echo '
									<div class="adm_check">
										<span class="adm_w80">' . $txt['pmx_check_artelcmode'] . '
										 <img class="info_toggle" onclick=\'Show_help("pmxArteclHelp")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
										</span>
										<div><input class="input_check" type="checkbox" name="config[check_ecl]" value="1"' . (!empty($this->cfg['config']['check_ecl']) ? ' checked="checked"' : '') . ' onclick="showeclbots(this)" /></div>
									</div>
									<div id="pmxArteclHelp" class="info_frame" style="margin-top:0px;">' . $txt['pmx_art_eclcheckhelp'] . '</div>
									<div id="eclextend" style="display:' . (!empty($this->cfg['config']['check_ecl']) ? 'block' : 'none') . '">
									<div class="adm_check">
										<span class="adm_w80">' . $txt['pmx_check_artelcbots'] . '
										 <img class="info_toggle" onclick=\'Show_help("pmxeclHelpbots")\' src="' . $context['pmx_imageurl'] . 'information.png" alt="*" title="' . $txt['pmx_information_icon'] . '" />
										</span>
										<div><input id="eclextendinp" class="input_check" type="checkbox" name="config[check_eclbots]" value="1"' . (!empty($this->cfg['config']['check_eclbots']) ? ' checked="checked"' : '') . ' /></div>
									</div>
									<div id="pmxeclHelpbots" class="info_frame" style="margin-top:0;">' . $txt['pmx_art_eclcheckbotshelp'] . '</div>
									<script type="text/javascript">
										function showeclbots(elm) {if(elm.checked == true) document.getElementById("eclextend").style.display = "block"; else {document.getElementById("eclextend").style.display = "none"; document.getElementById("eclextendinp").checked = false;}}
									</script>
								</td>';
        }
        // the visual options
        echo '
								<td id="set_col" style="padding:4px;">
									<div class="cat_bar catbg_grid grid_padd">
										<h4 class="catbg catbg_grid"><span class="cat_left_title">' . $txt['pmx_edit_visuals'] . '</span></h4>
									</div>
									<div style="float:left; height:30px; width:177px;">' . $txt['pmx_edit_cancollapse'] . '</div>
									<input style="padding-left:141px;" type="hidden" name="config[collapse]" value="0" />
									<input class="input_check" id="collapse" type="checkbox" name="config[collapse]" value="1"' . ($this->cfg['config']['visuals']['header'] == 'none' ? ' disabled="disabled"' : ($this->cfg['config']['collapse'] == 1 ? ' checked="checked"' : '')) . ' />
									<div style="clear:both;" /></div>
									<div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_collapse_state'] . '</div>
									<select style="width:46%;" size="1" name="config[collapse_state]">';
        foreach ($txt['pmx_collapse_mode'] as $key => $text) {
            echo '
										<option value="' . $key . '"' . (isset($this->cfg['config']['collapse_state']) && $this->cfg['config']['collapse_state'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>';
        }
        echo '
									</select>
									<br style="clear:both;" />
									<div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_overflow'] . '</div>
									<select style="width:46%;" size="1" id="mxhgt" name="config[overflow]" onchange="checkMaxHeight(this);">';
        foreach ($txt['pmx_overflow_actions'] as $key => $text) {
            echo '
										<option value="' . $key . '"' . (isset($this->cfg['config']['overflow']) && $this->cfg['config']['overflow'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>';
        }
        echo '
									</select>
									<br style="clear:both;" />
									<div style="float:left; min-height:30px; width:99%;">
										<div style="float:left; min-height:30px; width:180px;">' . $txt['pmx_edit_height'] . '</div>
										<div style="float:left; width:46%">
											<input onkeyup="check_numeric(this)" id="maxheight" type="text" size="4" name="config[maxheight]" value="' . (isset($this->cfg['config']['maxheight']) ? $this->cfg['config']['maxheight'] : '') . '"' . (!isset($this->cfg['config']['overflow']) || empty($this->cfg['config']['overflow']) ? ' disabled="disabled"' : '') . ' /><span class="smalltext">' . $txt['pmx_pixel'] . '</span><span style="display:inline-block; width:3px;"></span>
											<select id="maxheight_sel" style="float:right;width:52%;margin-right:-1%;" size="1" name="config[height]">';
        foreach ($txt['pmx_edit_height_mode'] as $key => $text) {
            echo '
												<option value="' . $key . '"' . (isset($this->cfg['config']['height']) && $this->cfg['config']['height'] == $key ? ' selected="selected"' : '') . '>' . $text . '</option>';
        }
        echo '
											</select>
										</div>
									</div>
									<br style="clear:both;" />
									<script type="text/javascript">
										checkMaxHeight(document.getElementById("mxhgt"));
									</script>

									<div style="float:left; height:30px; width:180px;">' . $txt['pmx_edit_innerpad'] . '</div>
									<input onkeyup="check_numeric(this, \',\')" type="text" size="4" name="config[innerpad]" value="' . (isset($this->cfg['config']['innerpad']) ? $this->cfg['config']['innerpad'] : '4') . '" /><span class="smalltext">' . $txt['pmx_pixel'] . ' (xy/y,x)</span>
									<br style="clear:both;" />';
        // CSS class settings
        echo '
									<div class="cat_bar catbg_grid grid_padd">
										<h4 class="catbg catbg_grid grid_botpad">
											<div style="float:left; width:177px;"><span class="cat_left_title">' . $txt['pmx_edit_usedclass_type'] . '</span></div>
											<span class="cat_left_title">' . $txt['pmx_edit_usedclass_style'] . '</span>
										</h4>
									</div>
									<div style="margin:0px 2px;">';
        // write out the classes
        foreach ($this->usedClass as $ucltyp => $ucldata) {
            echo '
										<div style="float:left; width:180px; height:30px; padding-top:2px;">' . $ucltyp . '</div>
										<select' . ($ucltyp == 'frame' || $ucltyp == 'postframe' ? ' id="pmx_' . $ucltyp . '" ' : ' ') . 'style="width:46%;" name="config[visuals][' . $ucltyp . ']" onchange="checkCollapse(this)">';
            foreach ($ucldata as $cname => $class) {
                echo '
											<option value="' . $class . '"' . (!empty($this->cfg['config']['visuals'][$ucltyp]) ? $this->cfg['config']['visuals'][$ucltyp] == $class ? ' selected="selected"' : '' : (substr($cname, 0, 1) == '+' ? ' selected="selected"' : '')) . '>' . substr($cname, 1) . '</option>';
            }
            echo '
										</select>
										<br style="clear:both;" />';
        }
        echo '
									</div>
									<div class="cat_bar catbg_grid grid_padd" style="margin-top:-2px;">
										<h4 class="catbg catbg_grid"><span class="cat_left_title" style="margin-left:-3px;">' . $txt['pmx_edit_canhavecssfile'] . '</span></h4>
									</div>
									<div style="float:left; margin:0px 2px; width:176px;">' . $txt['pmx_edit_cssfilename'] . '</div>
									<select id="sel.css.file" style="width:46%;margin-bottom:2px;" name="config[cssfile]" onchange="pmxChangeCSS(this)">
										<option value=""></option>';
        // custon css files exist ?
        if (!empty($this->custom_css)) {
            // write out custom mpt/css definitions
            foreach ($this->custom_css as $custcss) {
                if (is_array($custcss)) {
                    echo '
										<option value="' . $custcss['file'] . '"' . ($this->cfg['config']['cssfile'] == $custcss['file'] ? ' selected="selected"' : '') . '>' . $custcss['file'] . '</option>';
                }
            }
            echo '
									</select>
									<div style="clear:both; height:2px;"></div>';
            // write out all class definitions (hidden)
            foreach ($this->custom_css as $custcss) {
                if (is_array($custcss)) {
                    echo '
									<div id="' . $custcss['file'] . '" style="display:none;">';
                    foreach ($custcss['class'] as $key => $val) {
                        if (in_array($key, array_keys($this->usedClass))) {
                            echo '
										<div style="float:left; width:180px; padding:0 2px;">' . $key . '</div>' . (empty($val) ? sprintf($txt['pmx_edit_nocss_class'], $settings['theme_id']) : $val) . '<br />';
                        }
                    }
                    echo '
									</div>';
                }
            }
            echo '
									<script type="text/javascript">
										var elm = document.getElementById("sel.css.file");
										var fname = elm.options[elm.selectedIndex].value;
										if(document.getElementById(fname))
											document.getElementById(fname).style.display = "";
										function pmxChangeCSS(elm)
										{
											for(i=0; i<elm.length; i++)
											{
												if(document.getElementById(elm.options[i].value))
													document.getElementById(elm.options[i].value).style.display = "none";
											}
											var fname = elm.options[elm.selectedIndex].value;
											if(document.getElementById(fname))
												document.getElementById(fname).style.display = "";
										}
									</script>';
        } else {
            echo '
									</select>
									<div style="clear:both; height:6px;"></div>';
        }
        echo '
								</td>
							</tr>
							<tr>
								<td colspan="2" style="text-align:center;padding:4px 4px 0 4px;"><hr class="pmx_hr" />
									<div style="height:10px;"></div>
									<input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_exit'] . '" onclick="FormFuncCheck(\'save_edit\', \'1\')" />
									<input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_save_cont'] . '" onclick="FormFuncCheck(\'save_edit_continue\', \'1\')" />
									<input class="button_submit" type="button" style="margin-right:10px;" value="' . $txt['pmx_cancel'] . '" onclick="FormFunc(\'cancel_edit\', \'1\')" />
								</td>
							</tr>
						</table>
						</div>
					</td>
				</tr>';
    }
コード例 #2
0
/**
* Receive all the Posts from Categories Manager, check and save it.
* Finally the categories are prepared and the templare loaded.
*/
function PortaMx_AdminCategories()
{
    global $smcFunc, $context, $scripturl, $pmxCacheFunc, $txt;
    $admMode = isset($_GET['action']) ? $_GET['action'] : '';
    // fix the linktree
    if ($admMode == 'admin') {
        foreach ($context['linktree'] as $key => $data) {
            if (strpos($data['url'], 'pmx_categories') !== false) {
                $context['linktree'] = array_merge(array_slice($context['linktree'], 0, $key), array(array('url' => $scripturl . '?action=admin;area=pmx_center;' . $context['session_var'] . '=' . $context['session_id'], 'name' => $txt['pmx_extension'])), array_slice($context['linktree'], $key, count($context['linktree']) - $key));
                break;
            }
        }
    }
    if (($admMode == 'admin' || $admMode == 'portamx') && allowPmx('pmx_admin') && isset($_GET['area']) && $_GET['area'] == 'pmx_categories') {
        require_once $context['pmx_sourcedir'] . 'AdminSubs.php';
        $context['pmx']['subaction'] = isset($_POST['sa']) ? $_POST['sa'] : 'overview';
        // From template ?
        if (PortaMx_checkPOST()) {
            // check the Post session
            checkSession('post');
            // actions from overview ?
            if ($context['pmx']['subaction'] == 'overview' && empty($_POST['cancel_overview'])) {
                // updates from overview popups ?
                if (!empty($_POST['upd_overview'])) {
                    if (isset($_POST['xml'])) {
                        $xmlResult = '';
                    }
                    $updates = array();
                    foreach ($_POST['upd_overview'] as $updkey => $updvalues) {
                        foreach ($updvalues as $id => $values) {
                            if ($updkey == 'title') {
                                foreach ($values as $key => $val) {
                                    if ($key == 'lang') {
                                        foreach ($val as $langname => $langvalue) {
                                            $updates[$id]['config'][$updkey][$langname] = $langvalue;
                                        }
                                    } else {
                                        $updates[$id]['config'][$updkey . '_' . $key] = $val;
                                    }
                                }
                            } else {
                                $updates[$id][$updkey] = $values;
                            }
                        }
                    }
                    // save all updates
                    foreach ($updates as $id => $values) {
                        $request = $smcFunc['db_query']('', '
							SELECT config, acsgrp
							FROM {db_prefix}portamx_categories
							WHERE id = {int:id}', array('id' => $id));
                        $row = $smcFunc['db_fetch_assoc']($request);
                        $smcFunc['db_free_result']($request);
                        foreach ($values as $rowname => $data) {
                            // update config array
                            if ($rowname == 'config') {
                                $cfg = unserialize($row['config']);
                                foreach ($data as $ckey => $cval) {
                                    if ($ckey == 'title') {
                                        foreach ($cval as $lang => $val) {
                                            $cfg[$ckey][$lang] = $val;
                                        }
                                    } else {
                                        $cfg[$ckey] = $cval;
                                    }
                                }
                                $smcFunc['db_query']('', '
									UPDATE {db_prefix}portamx_categories
									SET config = {string:config}
									WHERE id = {int:id}', array('id' => $id, 'config' => serialize($cfg)));
                            } elseif ($rowname == 'catname') {
                                $smcFunc['db_query']('', '
									UPDATE {db_prefix}portamx_categories
									SET name = {string:val}
									WHERE id = {int:id}', array('id' => $id, 'val' => $data));
                            } else {
                                $mode = substr($rowname, 0, 3);
                                // update (replace)
                                if ($mode == 'upd') {
                                    $newacs = explode(',', $data);
                                } elseif ($mode == 'add') {
                                    $newacs = array_unique(array_merge(explode(',', $row['acsgrp']), explode(',', $data)));
                                } else {
                                    $newacs = array_unique(array_diff(explode(',', $row['acsgrp']), explode(',', $data)));
                                }
                                $smcFunc['db_query']('', '
									UPDATE {db_prefix}portamx_categories
									SET acsgrp = {string:val}
									WHERE id = {int:id}', array('id' => $id, 'val' => implode(',', $newacs)));
                                // send by xml?
                                if (isset($_POST['xml'])) {
                                    $acsnew = implode(',', $newacs);
                                    $xmlResult .= (!empty($xmlResult) ? '&' : '') . $id . '|' . $acsnew . '|' . count($newacs) . '|' . intval(allowPmxGroup($newacs)) . '|1';
                                }
                            }
                        }
                    }
                    // clear cache
                    $pmxCacheFunc['clean']();
                    if (isset($_POST['xml'])) {
                        // return update result
                        ob_start();
                        if (!empty($_POST['result'])) {
                            echo $_POST['result'];
                        } else {
                            echo $xmlResult;
                        }
                        ob_end_flush();
                        exit;
                    }
                }
                // add new category
                if (!empty($_POST['add_new_category'])) {
                    $category = PortaMx_getDefaultCategory();
                    $context['pmx']['subaction'] = 'editnew';
                } elseif (!empty($_POST['edit_category']) || !empty($_POST['clone_category'])) {
                    $id = PortaMx_makeSafe(!empty($_POST['clone_category']) ? $_POST['clone_category'] : $_POST['edit_category']);
                    // load the category for edit/clone
                    $request = $smcFunc['db_query']('', '
						SELECT *
						FROM {db_prefix}portamx_categories
						WHERE id = {int:id}', array('id' => $id));
                    $row = $smcFunc['db_fetch_assoc']($request);
                    $category = array('id' => $row['id'], 'name' => $row['name'], 'parent' => $row['parent'], 'level' => $row['level'], 'catorder' => $row['catorder'], 'acsgrp' => $row['acsgrp'], 'artsort' => $row['artsort'], 'config' => $row['config']);
                    $smcFunc['db_free_result']($request);
                    if (!empty($_POST['clone_category'])) {
                        $category['id'] = 0;
                        $category['parent'] = 0;
                        $category['level'] = 0;
                        $category['catorder'] = 0;
                        $context['pmx']['subaction'] = 'editnew';
                    } else {
                        $context['pmx']['subaction'] = 'edit';
                    }
                } elseif (!empty($_POST['delete_category'])) {
                    pmx_delete_cat(PortaMx_makeSafe($_POST['delete_category']));
                    // set catid in articles to none (0)
                    $smcFunc['db_query']('', '
						UPDATE {db_prefix}portamx_articles
						SET catid = 0
						WHERE catid = {int:id}', array('id' => PortaMx_makeSafe($_POST['delete_category'])));
                    // clear cache
                    $pmxCacheFunc['clean']();
                } elseif (!empty($_POST['move_category'])) {
                    pmx_move_cat(PortaMx_makeSafe($_POST['move_category']), PortaMx_makeSafe($_POST['catplace']), PortaMx_makeSafe($_POST['movetocat']));
                    // clear cache
                    $pmxCacheFunc['clean']();
                }
            } elseif (!empty($_POST['cancel_edit']) || !empty($_POST['cancel_overview'])) {
                $context['pmx']['subaction'] = 'overview';
            } elseif ($context['pmx']['subaction'] == 'editnew' || $context['pmx']['subaction'] == 'edit') {
                // check defined numeric vars (check_num_vars holds the posted array to check like [varname][varname] ...)
                if (isset($_POST['check_num_vars'])) {
                    if (isset($_POST['check_num_vars'])) {
                        foreach ($_POST['check_num_vars'] as $val) {
                            $data = explode(',', $val);
                            $post = '$_POST' . str_replace(array('[', ']'), array('[\'', '\']'), $data[0]);
                            if (eval("return isset({$post});") && eval("return !is_numeric({$post});")) {
                                eval("{$post} = {$data['1']};");
                            }
                        }
                    }
                }
                // get all data
                $category = array('id' => $_POST['id'], 'name' => PortaMx_makeSafe($_POST['name']), 'parent' => $_POST['parent'], 'level' => $_POST['level'], 'catorder' => $_POST['catorder'], 'acsgrp' => !empty($_POST['acsgrp']) ? implode(',', $_POST['acsgrp']) : '', 'artsort' => !empty($_POST['artsort']) ? implode(',', $_POST['artsort']) : '', 'config' => serialize($_POST['config']));
                // save category.
                if (empty($_POST['edit_change']) && (!empty($_POST['save_edit']) || !empty($_POST['save_edit_continue']))) {
                    // if new category get the last id and catorder
                    if ($context['pmx']['subaction'] == 'editnew') {
                        $category = pmx_insert_cat(PortaMx_makeSafe($_POST['catplace']), PortaMx_makeSafe($_POST['catid']), $category);
                        // get max catid
                        $request = $smcFunc['db_query']('', '
							SELECT MAX(id)
							FROM {db_prefix}portamx_categories', array());
                        list($maxid) = $smcFunc['db_fetch_row']($request);
                        $smcFunc['db_free_result']($request);
                        $category['id'] = strval(1 + ($maxid === null ? $category['id'] : $maxid));
                    }
                    // now save all data
                    $smcFunc['db_insert']('replace', '
						{db_prefix}portamx_categories', array('id' => 'int', 'name' => 'string', 'parent' => 'int', 'level' => 'int', 'catorder' => 'int', 'acsgrp' => 'string', 'artsort' => 'string', 'config' => 'string'), array($category['id'], $category['name'], $category['parent'], $category['level'], $category['catorder'], $category['acsgrp'], $category['artsort'], $category['config']), array('id'));
                    // clear cache
                    $pmxCacheFunc['clean']();
                    $context['pmx']['subaction'] = 'edit';
                }
                // continue edit ?
                if (!empty($_POST['save_edit'])) {
                    $context['pmx']['subaction'] = 'overview';
                }
            }
            if ($context['pmx']['subaction'] == 'overview') {
                redirectexit('action=' . $admMode . ';area=pmx_categories;' . $context['session_var'] . '=' . $context['session_id']);
            }
        }
        // load template, setup pagetitle
        loadTemplate($context['pmx_templatedir'] . 'AdminCategories');
        $context['page_title'] = $txt['pmx_categories'];
        $context['pmx']['AdminMode'] = $admMode;
        // direct edit request?
        if (isset($_GET['sa']) && PortaMx_makeSafe($_GET['sa']) == 'edit' && !empty($_GET['id'])) {
            // load the category for edit
            $request = $smcFunc['db_query']('', '
				SELECT *
				FROM {db_prefix}portamx_categories
				WHERE id = {int:id}', array('id' => PortaMx_makeSafe($_GET['id'])));
            if ($smcFunc['db_num_rows']($request) > 0) {
                $row = $smcFunc['db_fetch_assoc']($request);
                $category = array('id' => $row['id'], 'name' => $row['name'], 'parent' => $row['parent'], 'level' => $row['level'], 'catorder' => $row['catorder'], 'acsgrp' => $row['acsgrp'], 'artsort' => $row['artsort'], 'config' => $row['config']);
                $smcFunc['db_free_result']($request);
                $context['pmx']['subaction'] = 'edit';
            }
        }
        // continue edit or overview ?
        if ($context['pmx']['subaction'] == 'overview') {
            // load all categories
            $context['pmx']['categories'] = PortaMx_getCategories(true);
            // load popup js for overview
            loadJavascriptFile(PortaMx_loadCompressed('PortaMxPopup.js'), array('external' => true));
        } elseif (empty($_POST['save_edit'])) {
            // load the class file and create the object
            require_once $context['pmx_sysclassdir'] . 'PortaMx_AdminCategoriesClass.php';
            $context['pmx']['editcategory'] = new PortaMxC_SystemAdminCategories($category);
            $context['pmx']['editcategory']->pmxc_AdmCategories_loadinit();
        }
    } else {
        fatal_error($txt['pmx_acces_error']);
    }
}
コード例 #3
0
/**
* The main Subtemplate.
*/
function template_main()
{
    global $context, $txt, $scripturl;
    $curarea = isset($_GET['area']) ? $_GET['area'] : 'pmx_center';
    if (allowPmx('pmx_admin', true)) {
        $AdmTabs = array('pmx_center' => $txt['pmx_admincenter'], 'pmx_settings' => $txt['pmx_settings'], 'pmx_blocks' => $txt['pmx_blocks'], 'pmx_categories' => $txt['pmx_categories'], 'pmx_articles' => $txt['pmx_articles'], 'pmx_sefengine' => $txt['pmx_sefengine']);
        echo '
			<div style="height:2.8em;margin-top:5px;">
				<ul id="pmxmenu_nav" class="dropmenu sf-js-enabled">';
        foreach ($AdmTabs as $name => $desc) {
            echo '
					<li id="' . $name . '" class="subsections">
						<a ' . ($name == $curarea ? 'class="active"' : '') . 'href="' . $scripturl . '?action=portamx;area=' . $name . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $desc . '</a>
					</li>';
        }
        echo '
				</ul>
			</div>';
    }
    if (!isset($context['pmx']['articlestart'])) {
        $context['pmx']['articlestart'] = 0;
    }
    echo '
		<div class="cat_bar"><h3 class="catbg">' . $txt['pmx_adm_articles'] . '</h3></div>
		<p class="information" style="margin: 0;padding: 8px;">' . $txt['pmx_articles_desc'] . '</p>
		<div style="height:0.5em;"></div>';
    if ($context['pmx']['subaction'] == 'overview') {
        // create the pageindex
        $cururl = !empty($_GET) ? pmx_http_build_query($_GET, '', ';') . ';' : '';
        $pageindex = constructPageIndex($scripturl . '?' . $cururl . 'pg=%1$d', $context['pmx']['articlestart'], $context['pmx']['totalarticles'], $context['pmx']['settings']['manager']['artpage'], true);
        $pageindex = str_replace(';start=%1$d', '', $pageindex);
    }
    echo '
		<form id="pmx_form" accept-charset="' . $context['character_set'] . '" name="PMxAdminArticles" action="' . $scripturl . '?action=' . $context['pmx']['AdminMode'] . ';area=pmx_articles;' . $context['session_var'] . '=' . $context['session_id'] . '" method="post" style="margin: 0px;" onsubmit="submitonce(this);">
			<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
			<input type="hidden" name="sa" value="' . $context['pmx']['subaction'] . '" />
			<input type="hidden" name="articlestart" value="' . $context['pmx']['articlestart'] . '" />
			<input type="hidden" name="fromblock" value="' . (!empty($context['pmx']['fromblock']) ? $context['pmx']['fromblock'] : '') . '" />
			<input type="hidden" id="pWind.all.cats" value="' . pmx_getAllCatID() . '" />
			<input id="common_field" type="hidden" value="" />
			<input id="extra_cmd" type="hidden" value="" />
			<script>
				var Art = [];
				Art["active"] = "' . $txt['pmx_status_activ'] . ' - ' . $txt['pmx_status_change'] . '";
				Art["notactive"] = "' . $txt['pmx_status_inactiv'] . ' - ' . $txt['pmx_status_change'] . '";
				Art["approved"] = "' . $txt['pmx_article_approved'] . ' - ' . $txt['pmx_status_change'] . '";
				Art["notapproved"] = "' . $txt['pmx_article_not_approved'] . ' - ' . $txt['pmx_status_change'] . '";
			</script>';
    // ---------------------
    // all articles overview
    // ---------------------
    if ($context['pmx']['subaction'] == 'overview') {
        $cfg_titleicons = PortaMx_getAllTitleIcons();
        $cfg_smfgroups = PortaMx_getUserGroups();
        $categories = PortaMx_getCategories();
        $allNames = array();
        $allGroups = array();
        foreach ($cfg_smfgroups as $key => $grp) {
            $allGroups[] = $grp['id'];
            $allNames[] = str_replace(' ', '_', $grp['name']);
        }
        // common Popup input fields
        echo '
			<input id="pWind.language." type="hidden" value="' . $context['pmx']['currlang'] . '" />
			<input id="pWind.icon.url" type="hidden" value="' . $context['pmx_Iconsurl'] . '" />
			<input id="pWind.image.url" type="hidden" value="' . $context['pmx_imageurl'] . '" />
			<input id="pWind.name" type="hidden" value="" />
			<input id="pWind.id" type="hidden" value="" />
			<input id="pWind.catsel" type="hidden" value="" />
			<input id="pWind.side" type="hidden" value="" />
			<input id="set.filter.category" type="hidden" name="filter[category]" value="' . $_SESSION['PortaMx']['filter']['category'] . '" />
			<input id="set.filter.approved" type="hidden" name="filter[approved]" value="' . $_SESSION['PortaMx']['filter']['approved'] . '" />
			<input id="set.filter.active" type="hidden" name="filter[active]" value="' . $_SESSION['PortaMx']['filter']['active'] . '" />
			<input id="set.filter.myown" type="hidden" name="filter[myown]" value="' . $_SESSION['PortaMx']['filter']['myown'] . '" />
			<input id="set.filter.member" type="hidden" name="filter[member]" value="' . $_SESSION['PortaMx']['filter']['member'] . '" />
			<input id="allAcsGroups" type="hidden" value="' . implode(',', $allGroups) . '" />
			<input id="allAcsNames" type="hidden" value="' . implode(',', $allNames) . '" />
			<div id="addnodes" style="display:none"></div>';
        $filterActive = $_SESSION['PortaMx']['filter']['category'] != '' || $_SESSION['PortaMx']['filter']['approved'] != 0 || $_SESSION['PortaMx']['filter']['active'] != 0 || $_SESSION['PortaMx']['filter']['myown'] != 0 || $_SESSION['PortaMx']['filter']['member'] != '';
        // top pageindex
        echo '
			<div class="smalltext pmx_pgidx_top">' . $pageindex . '</div>';
        echo '
			<div style="margin-bottom:-10px;">
				<div class="cat_bar catbg_grid">
					<h4 class="catbg catbg_grid">
						<span' . (allowPmx('pmx_create, pmx_articles, pmx_admin') ? ' class="pmx_clickaddnew" title="' . $txt['pmx_articles_add'] . '" onclick="SetpmxArticleType()"' : '') . '></span>
						<span class="cat_msg_title_center">' . $txt['pmx_articles_overview'] . '</span>
					</h4>
				</div>
				<div class="windowbg wdbgtop" style="margin-bottom:4px;" id="RowMove-0">
					<div class="pmx_tbl" style="margin-bottom:3px;">
						<div class="pmx_tbl_tr windowbg2 normaltext" style="height:27px;">
							<div class="pmx_tbl_tdgrid" style="width:45px;"><b>' . $txt['pmx_article_order'] . '</b></div>
							<div class="pmx_tbl_tdgrid" onclick="pWindToggleLang(\'\')" title="' . $txt['pmx_toggle_language'] . '" style="width:48%;cursor:pointer;"><b>' . $txt['pmx_title'] . ' [<b id="pWind.def.lang.">' . $context['pmx']['currlang'] . '</b>]</b></div>
							<div class="pmx_tbl_tdgrid" style="width:25%;"><b>' . $txt['pmx_articles_type'] . '</b></div>
							<div class="pmx_tbl_tdgrid" style="width:25%;"><b>' . $txt['pmx_articles_catname'] . '</b>
								<span class="pmx_' . (empty($filterActive) ? 'nofilter' : 'filter') . '" title="' . $txt['pmx_article_filter'] . '" onclick="pmxSetFilter()"></span>
							</div>
							<div class="pmx_tbl_tdgrid" style="width:84px;"><b>' . $txt['pmx_options'] . '</b></div>
							<div class="pmx_tbl_tdgrid" style="width:45px;"><b>' . $txt['pmx_status'] . '</b></div>
							<div class="pmx_tbl_tdgrid" style="width:84px;"><b>' . $txt['pmx_functions'] . '</b></div>
						</div>';
        // call PmxArticleOverview for each article
        $articleCnt = count($context['pmx']['articles']);
        $artIDs = array();
        $pgCount = 0;
        foreach ($context['pmx']['articles'] as $article) {
            if ($pgCount >= $context['pmx']['articlestart'] && $pgCount < $context['pmx']['articlestart'] + $context['pmx']['settings']['manager']['artpage']) {
                PmxArticleOverview($article, $cfg_titleicons, $cfg_smfgroups, $categories);
            }
            $pgCount++;
            $artIDs[] = $article['id'];
        }
        echo '
					</div>
					<input id="pWind.all.ids." type="hidden" value="' . implode(',', $artIDs) . '" />
				</div>
				<div style="height:30px">
					<div class="smalltext pmx_pgidx_bot">' . $pageindex . '</div>
				</div>
			</div>';
        /**
        * Popup windows for overview
        **/
        echo '
			<div style="padding:0;margin:-15px 6px 0 6px">
				<table class="pmx_table_grid" style="border-color:transparent;table-layout:fixed;">
					<tr id="popupRow">
						<td class="tdnogrid" style="width:46px;">';
        // start row move popup
        echo '
							<div id="pmxRowMove" class="smalltext" style="width:340px;z-index:9999;display:none;left:1px;margin-top:-30px;">
								' . pmx_popupHeader('pmxRowMove', $txt['pmx_rowmove_title']) . '
									<input id="pWind.move.error" type="hidden" value="' . $txt['pmx_rowmove_error'] . '" />
									<div style="float:left;width:110px;">
										' . $txt['pmx_rowmove'] . '
										<div style="margin-top:6px;">' . $txt['pmx_rowmove_place'] . '</div>
										<div style="margin-top:10px;">' . $txt['pmx_rowmove_to'] . '</div>
									</div>
									<div style="padding-left:112px;">
										<div style="margin-left:5px; margin-top:2px;" id="pWind.move.pos"></div>
										<div style="margin-top:5px;">
											<input id="pWind.place.0" class="input_radio" type="radio" name="_" value="before" /><span style="padding:0 3px;">' . $txt['pmx_rowmove_before'] . '</span>
											<input id="pWind.place.1" class="input_radio" type="radio" name="_" value="after" checked="checked" /><span style="padding:0 3px;">' . $txt['pmx_rowmove_after'] . '</span><br />
										</div>
										<select id="pWind.sel" style="width:190px; margin-top:8px; margin-left:5px;" size="1">';
        foreach ($context['pmx']['article_rows'] as $id => $data) {
            echo '
											<option value="' . $id . '">[' . $id . '] ' . $data['name'] . ' (' . (empty($data['cat']) ? $txt['pmx_default_none'] : $data['cat']) . ')</option>';
        }
        echo '
										</select>
									</div>
									<div style="clear:both; text-align:right; margin-top:7px;">
										<input class="button_submit" type="button" value="' . $txt['pmx_save'] . '" onclick="pmxSendArtMove()" />
										<div style="height:20px;"></div>
									</div>
								</div>
							</div>';
        // end Move popup
        echo '	</td>
						<td class="tdnogrid" style="width:48%;">';
        // start title edit popup
        echo '
							<div id="pmxSetTitle" class="smalltext" style="width:420px;z-index:9999;display:none;margin-top:-30px;">
								' . pmx_popupHeader('pmxSetTitle', $txt['pmx_edit_titles'], '112px') . '
									<div style="float:left; width:75px;">' . $txt['pmx_edit_title'] . '</div>
									<input id="pWind.text" style="width:310px;" type="text" value="" />
									<input id="pWindID" type="hidden" value="" />
									<div style="clear:both; height:10px;">
										<img style="float:left;margin-top:-3px;" src="' . $context['pmx_imageurl'] . 'arrow_down.gif" alt="*" title="" />
									</div>
									<div style="float:left; width:75px;">' . $txt['pmx_edit_title_lang'] . '</div>
									<select id="pWind.lang.sel" style="float:left; width:165px;" size="1" onchange="pmxChgTitles_Lang(this)">';
        // languages
        foreach ($context['pmx']['languages'] as $lang => $sel) {
            echo '
										<option value="' . $lang . '">' . $lang . '</option>';
        }
        echo '
									</select>
									<div style="float:right;padding-right:1px;"><span style="vertical-align:6px;">' . $txt['pmx_edit_title_align'] . '</span>';
        // Title align
        foreach ($txt['pmx_edit_title_align_types'] as $key => $val) {
            echo '
										<img id="pWind.align.' . $key . '" src="' . $context['pmx_imageurl'] . 'text_align_' . $key . '.gif" alt="*" title="' . $txt['pmx_edit_title_helpalign'] . $val . '" style="vertical-align:2px; cursor:pointer;" onclick="pmxChgTitles_Align(\'' . $key . '\')" />';
        }
        echo '
									</div>
									<br style="clear:both;" />
									<input style="float:right; margin-top:9px;margin-right:1px;" class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '"  onclick="pmxUpdateTitles()" />
									<div style="float:left;width:75px; padding-top:8px;">' . $txt['pmx_edit_titleicon'] . '</div>';
        // Title icons
        echo '
									<div class="ttliconDiv" onclick="setNewIcon(document.getElementById(\'pWind.icon_sel\'), event)">
										<input id="post_image" type="hidden" name="config[title_icon]" value="" />
										<input id="iconDD" value="' . (isset($article['config']['title_icon']) ? ucfirst(str_replace('.png', '', $article['config']['title_icon'])) : 'None') . '" readonly />
										<img id="pWind.icon" class="pwindicon" src="' . $context['pmx_shortIconsurl'] . 'none.png" alt="*" />
										<img class="ddImage" src="' . $context['pmx_imageurl'] . 'state_expanded.png" alt="*" title="" />
									</div>
									<ul class="ttlicondd" id="pWind.icon_sel" onclick="updIcon(this)">';
        foreach ($cfg_titleicons as $file => $name) {
            echo '
										<li id="' . $file . '" class="ttlicon' . (isset($article['config']['title_icon']) && $article['config']['title_icon'] == $file ? ' active' : '') . '">
											<img src="' . $context['pmx_shortIconsurl'] . $file . '" alt="*" /><span>' . $name . '</span>
										</li>';
        }
        echo '
									</ul>
									<script>$("li").hover(function(){$(this).toggleClass("active")});</script>
								</div>
							</div>';
        // end title edit popup
        echo '
						</td>
						<td class="tdnogrid" style="width:25%;"></td>
						<td class="tdnogrid" style="width:25%;">';
        // categorie popup
        echo '
							<div id="pmxSetCats" class="smalltext" style="z-index:9999;width:220px;margin-top:-30px;display:none;">
								' . pmx_popupHeader('pmxSetCats', $txt['pmx_category_popup']) . '
									<select id="pWind.cats.sel" onchange="pmxChgCats(this)" style="width:100%;" size="6">';
        $selcats = array_merge(array(PortaMx_getDefaultCategory($txt['pmx_categories_none'])), $categories);
        $ordercats = array_merge(array(0), $context['pmx']['catorder']);
        $isWriter = allowPmx('pmx_create, pmx_articles', true);
        $isAdm = allowPmx('pmx_admin');
        $allcats = array();
        foreach ($ordercats as $catorder) {
            $cat = PortaMx_getCatByOrder($selcats, $catorder);
            $cfg = unserialize($cat['config']);
            // allcats html
            $details = PortaMx_getCatDetails($cat, $categories);
            $allcats[] = $cat['id'] . '|<div class="' . $details['class'] . '"><b>' . $details['level'] . '</b><span><span class="cat_names">' . $cat['name'] . '</span></span></div>';
            if (!empty($isAdm) || !empty($isWriter) && empty($cfg['global'])) {
                if (empty($cat)) {
                    $cat['id'] = 0;
                    $cat['name'] = $txt['pmx_categories_none'];
                }
                $details['parent'] .= $txt['pmx_chg_articlcats'];
                echo '
										<option value="' . $cat['id'] . '">' . str_repeat('&bull;', $cat['level']) . ' ' . $cat['name'] . '</option>';
            }
        }
        echo '
									</select><br />
									<div style="text-align:right;margin-top:7px;">
										<input class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateCats()" />&nbsp;
										<input class="button_submit" type="button" value="' . $txt['pmx_update_all'] . '" onclick="pmxUpdateCats(\'all\')" />
									</div>
								</div>
							</div>';
        // end categorie popup
        // start filter popup
        echo '
							<div id="pmxSetFilter" class="smalltext" style="width:280px;z-index:9999;margin-top:-60px;padding-top:36px;display:none;">
								' . pmx_popupHeader('pmxSetFilter', $txt['pmx_article_setfilter']) . '
									<div style="padding-bottom:3px; margin-top:-4px;">' . $txt['pmx_article_filter_category'] . '<span style="float:right; cursor:pointer" onclick="pmxSetFilterCatClr()">[<b>' . $txt['pmx_article_filter_categoryClr'] . '</b>]</span></div>
									<select id="pWind.filter.category" style="width:100%;" size="4" multiple="multiple">';
        $selcats = array_merge(array(PortaMx_getDefaultCategory($txt['pmx_categories_none'])), $categories);
        $ordercats = array_merge(array(0), $context['pmx']['catorder']);
        $catfilter = Pmx_StrToArray($_SESSION['PortaMx']['filter']['category']);
        $isWriter = allowPmx('pmx_create, pmx_articles', true);
        $isAdm = allowPmx('pmx_admin');
        foreach ($ordercats as $catorder) {
            $cat = PortaMx_getCatByOrder($selcats, $catorder);
            $cfg = unserialize($cat['config']);
            if (!empty($isAdm) || !empty($isWriter) && empty($cfg['global'])) {
                echo '
									<option value="' . $cat['id'] . '"' . (in_array($cat['id'], $catfilter) ? ' selected="selected"' : '') . '>' . str_repeat('&bull;', $cat['level']) . ' ' . $cat['name'] . '</option>';
            }
        }
        echo '
								</select><br />
								<div style="height:22px;padding-top:4px;">
									' . $txt['pmx_article_filter_approved'] . '
									<input id="pWind.filter.approved" style="float:right;" class="input_check" type="checkbox" value="1"' . (!empty($_SESSION['PortaMx']['filter']['approved']) ? ' checked="checked"' : '') . ' />
								</div>
								<div style="height:22px;">
									' . $txt['pmx_article_filter_active'] . '
									<input id="pWind.filter.active" style="float:right;" class="input_check" type="checkbox" value="1"' . (!empty($_SESSION['PortaMx']['filter']['active']) ? ' checked="checked"' : '') . ' />
								</div>';
        if (allowPmx('pmx_articles, pmx_admin')) {
            echo '
								<div style="height:22px;">
									' . $txt['pmx_article_filter_myown'] . '
									<input id="pWind.filter.myown" style="float:right;" class="input_check" type="checkbox" value="1"' . (!empty($_SESSION['PortaMx']['filter']['myown']) ? ' checked="checked"' : '') . ' />
								</div>
								<div style="height:18px;">
									' . $txt['pmx_article_filter_member'] . '
									<input id="pWind.filter.member" style="float:right;width:130px;" class="input_text" type="text" value="' . $_SESSION['PortaMx']['filter']['member'] . '" />
								</div>' . $txt['pmx_article_filter_membername'];
        }
        echo '
								<div style="text-align:right;margin-top:-5px;">
									<input class="button_submit" type="button" value="' . $txt['set_article_filter'] . '" onclick="pmxSendFilter()" />
									<div style="height:20px;"></div>
								</div>
							</div>
						</div>';
        $filterActive = $_SESSION['PortaMx']['filter']['category'] != '' || $_SESSION['PortaMx']['filter']['approved'] != 0 || $_SESSION['PortaMx']['filter']['active'] != 0 || $_SESSION['PortaMx']['filter']['myown'] != 0 || $_SESSION['PortaMx']['filter']['member'] != '';
        // end filter popup
        echo '
						</td>
						<td class="tdnogrid" style="width:63px;"></td>
						<td class="tdnogrid" style="width:45px;"></td>
						<td class="tdnogrid" style="width:84px;">';
        // start blocktype selection popup
        $RegBlocks = $context['pmx']['RegBlocks'];
        foreach ($RegBlocks as $key => $val) {
            if (!in_array($key, array('html', 'script', 'bbc_script', 'php'))) {
                unset($RegBlocks[$key]);
            }
        }
        function cmpBDesc($a, $b)
        {
            return strcasecmp(str_replace(' ', '', $a["description"]), str_replace(' ', '', $b["description"]));
        }
        uasort($RegBlocks, 'cmpBDesc');
        // start articletype selection popup
        echo '
							<div id="pmxArticleType" class="smalltext" style="width:220px;z-index:9999;margin-top:-30px;display:none;">
								' . pmx_popupHeader('pmxArticleType', $txt['pmx_add_new_articletype'], '65px') . '
									<div style="margin:-4px 0 5px 0;">' . $txt['pmx_articles_articletype'] . '</div>
									<select id="pmx.article.type" style="width:120px;" size="1">';
        foreach ($RegBlocks as $type => $articleType) {
            echo '
										<option value="' . $type . '">' . $articleType['description'] . '</option>';
        }
        echo '
									</select>
									<div style="text-align:right; margin-top:-23px;">
										<input class="button_submit" type="button" value="' . $txt['pmx_create'] . '" onclick="pmxSendArticleType()" />
									</div>
								</div>
							</div>';
        // end popup
        // start Access popup
        echo '
							<div id="pmxSetAcs" class="smalltext" style="width:210px;z-index:9999;display:none;margin-top:-30px;">
								' . pmx_popupHeader('pmxSetAcs', $txt['pmx_article_groups']) . '
									<div style="height:15px;margin-top:-5px;">
										<input id="pWindAcsModeupd" onclick="pmxSetAcsMode(\'upd\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_repl'] . '</span>
									</div>
									<div style="height:15px;">
										<input id="pWindAcsModeadd" onclick="pmxSetAcsMode(\'add\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_add'] . '</span>&nbsp;&nbsp;
									</div>
									<div style="height:15px;margin-bottom:10px;">
										<input id="pWindAcsModedel" onclick="pmxSetAcsMode(\'del\')" class="input_check" type="radio" name="_" value="" /><span style="vertical-align:3px; padding:0 3px;">' . $txt['pmx_acs_rem'] . '</span>
									</div>
									<select id="pWindAcsGroup" style="width:100%;" multiple="multiple" size="6" onchange="changed(\'pWindAcsGroup\');">';
        foreach ($cfg_smfgroups as $grp) {
            echo '
										<option value="' . $grp['id'] . '=1">' . $grp['name'] . '</option>';
        }
        echo '
									</select><br />
									<script type="text/javascript">
										var pWindAcsGroup = new MultiSelect("pWindAcsGroup");
									</script>
									<div style="text-align:right; margin-top:7px;">
										<input class="button_submit" type="button" value="' . $txt['pmx_update_save'] . '" onclick="pmxUpdateAcs()" />&nbsp;
										<input id="acs_all_button" class="button_submit" type="button" value="' . $txt['pmx_update_all'] . '" onclick="pmxUpdateAcs(\'all\')" />
									</div>
								</div>
							</div>';
        // end Access popup
        // start clone popup
        echo '
							<div id="pmxSetArtClone" class="smalltext" style="width:220px;z-index:9999;margin-top:-30px;display:none;">
								' . pmx_popupHeader('pmxSetArtClone', $txt['pmx_art_clone']) . '
									<div>' . $txt['pmx_confirm_artclone'] . '</div>
									<input id="pWind.artcloneid" type="hidden" value="" />
									<input style="float:right;font-size:11px;font-weight:bold;margin-top:5px;" class="button_submit" type="button" value="' . $txt['pmx_delete_button'] . '" onclick="pmxSendArtClone()" />
									<div style="height:25px;"></div>
								</div>
							</div>';
        // end clone popup
        // start delete popup
        echo '
							<div id="pmxSetArtDelete" class="smalltext" style="width:220px;z-index:9999;margin-top:-30px;display:none;">
								' . pmx_popupHeader('pmxSetArtDelete', $txt['pmx_art_delete']) . '
									<div>' . $txt['pmx_confirm_artdelete'] . '</div>
									<input id="pWind.artdelid" type="hidden" value="" />
									<input style="float:right;font-size:11px;font-weight:bold;margin-top:5px;" class="button_submit" type="button" value="' . $txt['pmx_delete_button'] . '" onclick="pmxSendArtDelete()" />
									<div style="height:25px;"></div>
								</div>
							</div>';
        // end delete popup
        echo '
						</td>
						<td class="tdnogrid" style="width:84px;"></td>
					</tr>
				</table>
			</div>';
    } elseif ($context['pmx']['subaction'] == 'edit' || $context['pmx']['subaction'] == 'editnew') {
        echo '
			<table class="pmx_table" style="margin-bottom:5px;table-layout:fixed;">
				<tr>
					<td style="text-align:center">
						<div class="cat_bar" style="border-bottom-left-radius:6px;border-bottom-right-radius:6px">
							<h3 class="catbg">
							' . $txt['pmx_article_edit'] . ' ' . $txt['pmx_articles_types'][$context['pmx']['editarticle']->cfg['ctype']] . '
							</h3>
						</div>
					</td>
				</tr>';
        // call the ShowAdmArticleConfig() methode
        $context['pmx']['editarticle']->pmxc_ShowAdmArticleConfig();
        echo '
			</table>';
    }
    echo '
		</form>';
}